6 ms·
I still think C# is one of, if not the best of designed languages exist. Even it moves in much smaller steps than it was before I think it's for good. I left .
by tarasmatsyk 6y ago
I still think C# is one of, if not the best of designed languages exist. Even it moves in much smaller steps than it was before I think it's for good.
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_rationalist 6y agoTo me C# is the second best designed language, the first being IMHO Kotlin. I'm very interested in what you think would make C# more well designed than the latter :}
- bulldoa 6y agoMay I ask why do you think kotlin is best designed?
- djanogo 6y agoI think kotlin is ugly hack, if you take away the superficial syntax (?) it will start showing ugly side. I think it only gotten popular because of Googles push due to Oracle Java lawsuit.
- monocasa 6y agoI don't think Kotlin is being pushed because of the Oracle lawsuit. Most of Oracle's complaints were at the VM and standard library level, which Kotlin doesn't help with.
- eggsnbacon1 6y agoKotlin allows Google to hang out in Java 8 forever. If they want new features they can just add them at the Kotlin layer. Insulates them from OpenJDK and any changes Oracle wants to make. All great opportunities to fragment the Java ecosystem
- monocasa 6y agoOpenJDK was always fine for them to pull in, being GPLed. They got in trouble because they based their class library on Apache Harmony originally, and Sun pulled the TCK rug out from under Harmony.
- t-writescode 6y agoKotlin is written by JetBrains.
- searchableguy 6y agoCan you elaborate on ugly side?
- deleted 6y ago[deleted]
- The_Colonel 6y agoIt has the benefit of 15 years more hindsight. 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.
- belinder 6y ago> Except for - it doesn't work with immutable classes (the ones with readonly fields). Well good thing they're adding that in C# 9 then
- The_Colonel 6y agoOh, cool, I didn't notice that! Still, they are playing catch-up here.
- illvm 6y agoI mean... if you go that route then I would say Kotlin isn't really ready to be used as a production language in most places due to the severe lack of tooling, especially when it comes to things like static analysis. Sure ktlint is there, but the rules library is lacking. So from that perspective, Kotlin is playing catch-up.
- The_Colonel 6y agoDiscussion was about the design of the language only.
- jayd16 6y agoOverall I find the syntax to be a little too inconsistent for the sake of conciseness but its a well designed language. It might just be my lack of experience and the amount of features in Kotlin. 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.
- oaiey 6y agoInterestingly, both are done by companies who care about developer productivity. When you here Anders Hejlsberg talking it is all about productivity (C# and TypeScript). I do not know the kotlin designers, but I bet they talk similar.
- G4BB3R 6y agoIt's about trade off. A language that keep getting new features every year, will make some users happy, but will lose compiler speed and it will be harder to learn.
- deleted 6y ago[deleted]
- nathanaldensr 6y agoI love C# and have used it since the beginning (my online handles are often VisualCSharp), but I do worry about the cognitive burden of remembering idioms and dealing with multiple ways to do the same thing. This is already a huge issue with C++, and now it's slowly happening to C#. I work with many, many developers--some overseas--that are still in the string.Format era. The language is starting to show some warts due to inheriting bad decisions from former language maintainers (e.g., nullable value types and nullable reference types being treated completely differently). 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.
- balfirevic 6y ago> The language is starting to show some warts due to inheriting bad decisions from former language maintainers (nullable value types and nullable reference types being treated completely differently). 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.
- geewee 6y agoThis is one of my biggest pet peeves with C# - it's so annoying that value and reference types behave differently in respect to nullability.
- D_Guidi 6y ago> I do worry about the cognitive burden of remembering idioms and dealing with multiple ways to do the same thing 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 :)
- fortran77 6y agoIt's by far my favorite general purpose language. Works well everywhere, and the best tools around.
- canada_dry 6y ago> Works well everywhere 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).
- tguedes 6y agoWell now you use .NET Core and it works flawlessly :-)
- Nullabillity 6y agoYeah, now it's an officially supported bug-ridden piece of crap. Just like on Windows. Woo, I guess?
- cyral 6y agoYeah I remember the days of subtle mono bugs and segfaults, but the new(-ish, its been out for years) .NET Core brings official support to linux. ASP.NET Core is definitely a solid platform for web apps on Linux now too.
- The_Colonel 6y agoOfficial support for some .NET things. WinForms are not on linux and won't ever be. Even the newly announced MAUI is only "community supported" on linux.
- fgonzag 6y agoTo answer your question first: It's faster on Linux than Windows now (marginally) and completly stable on Linux. I've been running a .net core systemd service for 9 months with 0 downtime (not using the new HostedService class though). It hasn't leaked any memory at all, it's still running perfectly even though it opens thousands of files and thousands of connections to a web service every hour. 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.
- klipt 6y agoDidn't C# start with Microsoft poaching the lead Delphi architect from Borland? A lot of people loved Delphi back in the day for its design too.
- pjmlp 6y agoActually Borland's management helped quite a bit believing some Anders interviews.
- balfirevic 6y agoIt's funny, the languages I ended up using the most throughout the years are Delphi, C# and most recently Typescript (where Anders is also a lead architect). And my very first lines of code could very well have been written in Turbo Pascal (also by him), if I remember correctly. 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.
- tarasmatsyk 6y agoI’ve been using Delphi before and it looks like a grown/better Pascal. C# is a c-family language which seems weird right after the switch, however you start appreciate C syntax a bit later. I think C# was an attempt to design MS Java which is better than Java
- dragonwriter 6y agoYour both right, C# was MS Java-but-better designed by the designer of Delphi, who had recently (perhaps specifically for that project) been hired by MS.
- oaiey 6y agoThe little ugly fact is that Anders was also involved in the Microsoft Java effort.
- eggsnbacon1 6y agoIt really is wonderful. Used it at work years ago and still miss it dearly. 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.
- HeyLaughingBoy 6y agoFunny you should say that because I wrote an application that has both Excel and PDF output and both libraries were free on NuGet.
- eggsnbacon1 6y agothere's free libraries, I used a bunch of them. I guess I'm just asking you to trust me that's its not nearly as good as in Java. C# is a better language, there's no question. But I jumped off the MS bandwagon years ago because there just wasn't the community support that Java has, for better (or probably) worse
- Arainach 6y agoI wouldn't expect that to change any time soon. The Microsoft/Sun lawsuit still stings inside the company and has legal impact decades later (https://www.cnet.com/news/sun-microsoft-settle-java-suit/ https://www.cnet.com/news/sun-microsoft-settle-java-suit/). It's the reason why, for instance, you can't download Windows 98 or Visual Studio 6 on MSDN/Visual Studio subscriptions. Microsoft is now friendlier to open source than it has been, but I would be shocked if they ever got friendlier with Java. (Disclaimer: I haven't worked at MS in several years)
- 6y ago
- ipiz0618 6y agoFeeling the same here. It's elegant, and imo easier to read than most languages. There aren't many choices of libraries in C#, but they cover most use cases. Still I found myself happy to publish to NuGet my own package because I love exploring the language and its features. 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.
- D_Guidi 6y ago> It's amazing how the language advances over years 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.