Hacker News new | ask | show | jobs
by jimmaswell 41 days ago
C# is as close to an ideal language as you can get for most things IMO. I find AI does a great job with it.
2 comments

I like C#, it's how I make a living, but it's way too large today. I can program in valid C# and it looks like C or I can program in C# and it looks like a functional language or I can program in C# and it's looks all angle-brakety like C++.

The problem with that is everyone has an opinion on what good C# looks like.

For personal projects, I'll take a much simpler language any day.

C# has recreated the C++ dialect conundrum. For some it’s effectively an idempotent functional language with unfortunate failings of exhaustiveness, for others it’s Java ca 2009, for others it’s C++ but not quite.

Discipline, effort, linters, reviews, more discipline, more effort, retraining, discipline… and foot guns everywhere because so much of the adaptation has been a 95% solution. Personally I got everything C# promises even now when F# was dropped years ago and have found the interim pretty annoying.

While C# is a particularly egregious case, I think all reasonably long-lived, popular languages suffer from this problem. Go is being very intentional about not falling in this trap, but JavaScript, Python, Java.. modern/idiomatic code in all of these languages looks very different from the code you'd write using them 15 years ago.

At my workplace, we use the .editorconfig and static analysis heavily to push us towards a consistent C# feature-set and style. This plays the same role that pyupgrade would in python, for instance.

I do agree. C# is an hidden gem for IA. There are not that much different ways to get somewhere so the model have probably been trained on the framework and libraries everybody uses (the Microsoft ones).

Compared to most languages, including Java, C# will have a hard time letting you compile incoherent code.

You barely need any dependencies other than aspnetcore and efcore for most applications and your AI knows them well.

It’s easy to do TDD with it so it’s easy to keep your IA from hallucinating.

I definitely agree with the sentiment. However this part.

> There are not that much different ways to get somewhere

This is far from true. C# is a language where you can operate on the raw pointers through unsafe keyword. On the other end of the spectrum, you can have duck-typing in dynamic blocks.

For operating on collections you can use old style loops, or chain of lambdas or sql like syntax.

I have been coding in C# old school way for most of my life at this point, and I feel like I'm in a foreign land reading code from some other C# projects.