by tarasmatsyk · 6y ago · 0 comments
I left .NET land at 6.0 and .NET 4.x versions mostly because of Windows eco-system (small open source community, almost no alternatives to out of the MS things, bad linux support). Since that I've been working with Java, Swift,JS, Python, Golang and I still think that C# is one of the best-designed languages. Very few of them keep evolving through the decades, hopefully it can become the language of the year at some point, always liked to see how new features got implemented under the hood and what kind of features get into next release.
Well done C# team
It's amazing how the language advances over years
The only thing I don't miss is the lack of community. Many things you can get for free in Java/Python cost money in Microsoft land. Even common stuff like decent excel and PDF support. Its getting better but was still the case last time I looked.
What C# needs is Java interop. The VM and bytecode structures are similar enough for it to work. There was a guy maintaining a library for this until recently :(
Official CLR Java interop would kill Java. Within a few years every new project would be in C#.
The only other places I'm aware Java has a big advantage is GC and monitoring. C#'s GC is old school, has long pause times. Makes C# a no-go for many uses. Java also has better monitoring and profiling support.
There -are- still a couple sore points, PDF comes to mind. But there are at least a couple different good projects out there for working with Excel at this point.
Bigger problem is a larger portion of C# developers and their managers are frightened of shifting away from the Microsoft blessed stack. That's what creates this chicken-egg situation where good projects don't have enough community behind them because there aren't enough people using them.
GC in C# isn't perfect but works fairly well if you understand it. There's plenty of ways to write minimal or zero-allocation code and it's gotten a lot easier with the newer Span types.
Monitoring though... yeah The first time I learned about Blackbox and the like I got a bit jealous :)
As an aside, although common, I dislike the term "poaching" when it comes to hiring. It's negative connotations are inescapable, but also inappropriate when talking about hiring.
I think C# was an attempt to design MS Java which is better than Java
Now developing in Python at work, I can find a multitude of packages for every need I have to meet, which is perfect for productivity, but I feel I can never understand the language enough because all I do is to import some packages and get work done.
I really hope C# gets more popular among devs. Where I live only large non-tech companies use it internally, which might explain why there are not many open source libraries in C# compared to other languages.
Though, with all the comments here saying C# is turning into F#, I'm tempted to try out F# as my first functional programming language now.
Perhaps it's gotten better - TBH I haven't checked in years - but it used to be a horrible bug ridden mess for doing things aimed at Linux (i.e. via mono).
It's just a process that picks zip files from the local SFTP service, sends each entry in the zip to an external web service, and writes the result of the file to a new zip in the SFTP directory. Extremely simple, but also the kind of application in which resource leaks become apparent very fast, and it's been far more stable than anything we had on Windows where we had to reboot servers once a month just as a precaution.
A few years ago I was playing with Kotlin when it had been recently released, and I remember thinking that eventually it would be a likely candidate as a default language for new enterprise projects. My reasoning was based mostly on it being a better Java, it solved just the right problems but wasn't too different and thus easy to learn. And at the time the JVM had too many advantages over .NET (multi plataform, open source, supported every technology under the sun)
Fast forward a few years, and .net now supports Linux natively, and is even faster on Linux than Windows. Microsoft has or is open sourcing pretty much everything, and with the rise of Nuget the third party library ecosystem has grown by leaps and bounds. C# has become an amazing language, considering that back in 2000 it was basically Java. While Oracle has regressed and is oppressing the ecosystem in its typical ways.
Even though I still like Kotlin better (purely from a language design standpoint), C# has evolved so much it nearly matches it, while Java is just a kitchen sink of non-cohesive features and libraries. C# in 2020 almost seems as it was designed from the ground up to be a semi-functional asynchronous OOP language with reifed generics, linq, async / await, null safety, and many more features.
That is absolutely mind boggling, because it is a language that made nearly all the mistakes that the originally Java did back in the days (save checked exceptions), and now a days I think it should pretty much be the default plataform for any app that needs to interact with enterprise technologies, and should honestly be considered in all green field projects if the team has development expertise in it. We've stopped being a mix shop and are now pretty much .net exclusively.
Not sure what you're referring to here. Java/JVM has been open sourced for a while as well.
> while Java is just a kitchen sink of non-cohesive features and libraries
I disagree. If you look at the new features coming out (pattern matching, records, green threads/fibers, value types, etc.) the Java designers are taking a very principled approach. Everything fits very well with the language design.
Even the newly announced MAUI is only "community supported" on linux.
I hope for C#'s sake that at some point it can metamorphize--not just evolve--into a new language that can leave some of the crufty decisions behind.
That's being a little too harsh, in my opinion. Even if you were designing both kinds of nullable types right now, it'd be difficult to have them behave the same way without adding runtime support for keeping track of nullability of reference types. And that's quite a big task.
To me, VS 2019 refactoring suggestions and Roslynator extensions helped a lot to learn and use new syntax capabilities and idioms: you write code in "the same old way" and then often roslyn is able to convert this code using new features, often in a concise, readable but undebuggable way :)
I think that with the latest improvements (from v7 to now) Microsoft is trying to "fill the gap" between F# and C#, and let C# developers embrace functional paradigms (at least, some of) without switching to F# itself.
Code examples have a lot of what looks like lambda callback hell and I find it hard to read but again, I might just need more practice.
As an example, during this time the development community figured out that using immutability as the default brings benefits.
Kotlin is designed with this in mind, but C# isn't - e.g. C# has this cool feature for object initialization which is so handy and all developers use it. Except for - it doesn't work with immutable classes (the ones with readonly fields). As an effect developers dislike to use immutable classes since it's not ergonomic in C# and instead use standard POCO.
Another example is that C# still in this age does not support readonly parameters and local variables (which even Java and JavaScript (!) support). In Kotlin "readonly" local variables is the idiomatic code practice which doesn't make code any more verbose. And in the case they decide to add it to C#, it will have to be at the cost of verbosity (similarly to how Java does it) because of backwards compatibility.
Well good thing they're adding that in C# 9 then