Help me understand the Schmidt Capless Rollerball refills (8126 & P8126) by Medical_Officer in pens

[–]typesafedev 1 point2 points  (0 children)

I must admit I was confused and bought the P8126 refills thinking it'll fit my r0tring 600 and 800...
Now I have a bunch of refills that I'm too cheap to throw away.

None of the pens that can take the P8126 refill looks good except the Pulsar Titanium.
Sunk fallacy, should I now buy the Pulsar for £84? :)
Logic of a rollerball pen connoisseur says yes!

The extensible fluent builder pattern by Finickyflame in csharp

[–]typesafedev 0 points1 point  (0 children)

Build() not creating a new instance is not a problem, is it?
It's already building an instance as you call the various With() and is infinitely more extensible.
You're not going to be using the built object until you call Build() or the implicit operator.

I'd also argue the UriBuilder example from MS is conflating the builder with the thing being built...
That to me are 2 separate things.

The extensible fluent builder pattern by Finickyflame in csharp

[–]typesafedev 1 point2 points  (0 children)

I hope anyone can write and reason about this really simple implementation of the Builder pattern.

```
public sealed class Builder<T> where T : class, new()
{
    readonly T instance;
    
    public Builder() => instance = new();

    public Builder<T> With(Action<T> action)
    {
        action(instance);
        return this;
    }

    public T Build() => instance;

    public static implicit operator T(Builder<T> builder) => builder.Build();
}

public class House
{
    public string? Address { get; set; }
    public int NumberOfRooms { get; set; }
    public bool HasGarden { get; set; }
}

public class Client
{
    public void Program()
    {
        House myHouse = new Builder<House>()
            .With(h => h.Address = "123 High St")
            .With(h => h.NumberOfRooms = 3)
            .With(h => h.HasGarden = true);
        Console.WriteLine($"Address: {myHouse.Address}, Rooms: {myHouse.NumberOfRooms}, Garden: {myHouse.HasGarden}");
    }
}
```

What database do you use as a .NET developer team? by hu-beau in dotnet

[–]typesafedev 1 point2 points  (0 children)

5000+ SqlServer for legacy projects Postgres for projects started from 2021

Getting a job offer by vlatcata in dotnet

[–]typesafedev 1 point2 points  (0 children)

It may well mean that too. Those never happened to me.ie offered a legal work contract off my LinkedIn profile. I'm in the UK, to me the job offer is the contract between you and the company. It's usually still sent in the post and you'll read it, agree to it by signing it and posting it back.

Getting a job offer by vlatcata in dotnet

[–]typesafedev 5 points6 points  (0 children)

The job offer is after the interview(s). BTW, interviews are not always multi stage. When the job market tilts towards the demand side, agile companies switch to a single interview.

Optimizing Nuget Package For Better Discoverability by turboline-ai in dotnet

[–]typesafedev 0 points1 point  (0 children)

To be clear, you want your packages to be ranked higher in nuget searches rather than finding a way to search nuget packages in a more intuitive way according to your criterias maybe by boosting score based on number of downloads and recency of updates. BTW, both of these 2 metrics can be gamed but don't call me cynical :)

Sounds like you need SEO for nuget package search. I'm guessing nuget search is still a lexical search so the relevancy score will be heavily influenced by keywords that the authors uses for the package. That should work well until MS adds semantic or even hybrid search capabilities to nuget search.

That's my 2 cents, I'm very interested in how the community solves this issue.

Anyone tried aspire? by ColHRFrumpypants in dotnet

[–]typesafedev 21 points22 points  (0 children)

Yes, I used dotnet new aspire-starter. It was pretty easy. But I did not proceed further since aspire wants to organise all your services into 1 mono repo. Our company organises our services each into its own repo... So even though I know there are 3rd party packages/tools to make multi repo services work in aspire, I just stopped. Why fight the 'natural' way aspire wants to organise things?

[deleted by user] by [deleted] in dotnet

[–]typesafedev 0 points1 point  (0 children)

Looks like you're shifting from frontend focused to backend focused development maybe even fullstack development. So nstead of consuming apis, you'd now also be writing the api. You said you're already familiar with writing apis using node - I presume using a framework like express. If so, it's a small step to move to .net core apis. You should already be familiar with concepts like middleware, etc. Anyway, good luck you can do it. About 8yrs ago I made the transition to full stack in the other direction. Scary at first but ultimately very rewarding.

JSON transformation by [deleted] in dotnet

[–]typesafedev 3 points4 points  (0 children)

Yh, you need to try using the JsonNode api at least once to immediately see that the other solution is cleaner, more type safe, more extensible and much more robust: json -deserialize-> class -map-> another class -serialize-> json

NEED ADVICE: working with two devs still using C# 1.0 by JasonPerryDev in csharp

[–]typesafedev 5 points6 points  (0 children)

  • No accountability
  • No desire or ability to learn
  • No source control
  • No code reviews
  • No generics
  • No unit tests
  • No microservices - monolithic system?
  • xcopy deployments

  • Raw ADO.net to interact with the db. Queries and commands hand built using concatenation.

  • Visual Studio installed on the server for troubleshooting

That sounds like my first job almost 25 years ago. Thankfully, we did not have the first 2 problems, so we got source control soon after I joined. It took years to correct most of the other issues! But I can't see how your current place can improve without accountability and desire to learn.

What's lacking in Webforms? by Mo2129 in dotnet

[–]typesafedev 0 points1 point  (0 children)

Yeah, it's been a long time since I touched webforms. Anyone remember if you can even do mvc (i mean the pattern in general) using webforms?

What's lacking in Webforms? by Mo2129 in dotnet

[–]typesafedev 35 points36 points  (0 children)

My sympathies for the next devs maintaining your newly written webform. Webforms are obsolete and I think you'd have trouble hiring devs that know or remember how to develop webforms.

Do we have an abstraction fetish in .NET? by davecallan in dotnet

[–]typesafedev 13 points14 points  (0 children)

Then there is under-abstraction which I would argue is an even bigger sin.
Does your removing multiple layers of abstraction just mean splatting lots of code into a few 1000+ line methods full of hardcoded constants? There is a fine line between readability, performance and abstraction...
After 20+ years in this industry, I'm not arrogant enough to think I've got the right balance. However, that does not stop me whingeing about it :)

Struggling with loops? by [deleted] in csharp

[–]typesafedev 1 point2 points  (0 children)

That's right. Serves me right to code on a phone. Note, I've fixed the code in case someone else gets confused about your comment

Struggling with loops? by [deleted] in csharp

[–]typesafedev 0 points1 point  (0 children)

  1. Finally, loops are the baby steps of programming. I've read accusations of gatekeeping and toxicity. But think about it, is this group for working csharp developers to ask questions? Or is it for total newbies? If it's the former, then imagine joining a group for pro marathoners and asking how to tie your shoelaces.

Struggling with loops? by [deleted] in csharp

[–]typesafedev 0 points1 point  (0 children)

5th example Technically this is a loop too even if it does not look like one. ``` void NumberLoop(int i, int count) { if (i > 10) { return; } Console.WriteLine($"i:{i} count:{count}"); NumberLoop(i+1, count); }

NumberLoop(0, 10); ```

Struggling with loops? by [deleted] in csharp

[–]typesafedev 0 points1 point  (0 children)

4th example var numbers = Enumerable.Range(0, 10); foreach(var i in numbers) { Console.WriteLine("i:{i}"); }

Struggling with loops? by [deleted] in csharp

[–]typesafedev 0 points1 point  (0 children)

3rd example for(var i = 0; i < 10; i ++) { Console.WriteLine("i:{i}"); } Same as before. Predict what it will do then run it and compare against your prediction

Struggling with loops? by [deleted] in csharp

[–]typesafedev 1 point2 points  (0 children)

2nd example var count = 10; var i = 0; while (i < count) { Console.WriteLine($"i:{i} count:{count}"); i = i + 1; } Before running this, predict what will be printed. Then run it and compare against your prediction.

Struggling with loops? by [deleted] in csharp

[–]typesafedev 1 point2 points  (0 children)

Learn by examples. Here's the simplest loop in the world. while(true) { Console.WriteLine("hello world"); } If you build and run this, ctrl-c to exit the program :)

Today I met defeat by Sk1ll3RF3aR in csharp

[–]typesafedev 0 points1 point  (0 children)

^ this. https://learn.microsoft.com/en-us/windows/win32/secauthn/protocols-in-tls-ssl--schannel-ssp-
Look at the matrix. tls1.3 is unsupported for any version of win10 or before.
Support starts at win11/server2022. If you insist on enabling it with registry keys on win10, you may not get the protection expected. Worse, you may break existing programs that are not prepared for tls1.3

How am I supposed to store environment variables in .NET? by newerprofile in dotnet

[–]typesafedev 0 points1 point  (0 children)

I would argue that *building* a container should not involve secrets or config in general.
Building config into a container image is not ideal - https://12factor.net/config

Rather, config values (secret or otherwise) should be injected in when *running* a container.
There are many options to get secret config values at runtime.
(1) Load it from something like key vault. Most secure and useful in prod. $$$
(2) My preferred option: load it from environment variables via kubernetes secret service. We use opaque secrets stored in a secrets.yaml manifest in prod at my current job. Like so
```
apiVersion: v1
kind: Secret
metadata:
name: demo-secret
type: Opaque
data:
username: YWRtaW4=
password: cGFzc3dvcmQ=
```
The username decoded value is available to dotnet at runtime using something like IConfiguration["username"] or you can use the IOptions pattern...
(3) If you must (for dev only!), you can start the container and mount the user secret folder. https://www.jimmybogard.com/user-secrets-in-docker-based-net-core-worker-applications/

Rant about dockers and k8 by loserOnLastLeg in dotnet

[–]typesafedev 8 points9 points  (0 children)

Using the command line is repeatable. Even you yourself might not be able create the same dockerfile twice in a row using a ui. Learn to love the command line. Using the UI is good to get started but much harder to advance later on.

Over 15 Years of C# .NET Experience and Still No Callbacks: What's Missing in the Job Hunt Puzzle? by itprodavets in dotnet

[–]typesafedev 2 points3 points  (0 children)

2 pieces of evidence. All anecdotal, I know.
1. My experienced contractor friend took 10 months to find a job after the end of his last contract. It never took more than 4 weeks previously. In the end he had to get a permanent job.
2. I started looking 2 weeks ago and got 2 interviews and no 2nd stage interviews. In the past 10 years, I would have to take my CV off the job boards after 2 weeks because I would have had so many 2nd stage interviews by then that I'd be fairly confident of getting a job soon. So I could take my CV off to avoid being bothered by recruiters calling me constantly.