9 ms·
C# was mostly irrelevant to me a long time when Microsoft's implementation was closed, but there are some neat things about it. They've done a lot of interestin
by twotwotwo 9y ago
C# was mostly irrelevant to me a long time when Microsoft's implementation was closed, but there are some neat things about it. They've done a lot of interesting stuff in the language since it first came out, including pragmatic sugar-y stuff like type inference (`var`), async/await, and recently some moves towards more functional-style pattern matching though they're not totally there yet (https://www.kenneth-truyers.net/2016/01/20/new-features-in-c-sharp-7/ https://www.kenneth-truyers.net/2016/01/20/new-features-in-c... discusses proposals, some of which didn't make C# 7). Interfaces and value types also seemed like important things to have early, and there's some other handy looking stuff like the SustainedLowLatency GC mode (defer full-heap compactions as long as it can).
Can be tempting to think of it as a Java clone because of its early history and the shared general category (OO-focused GC'd imperative statically typed language whose first major impl was bytecode/VM-based), but there's signs of more to it than that.
- eighthnate 9y agoC# is a more polished and "prettier" Java. It has done well with it's incorporation of functional programming, generics, dynamic programming and syntactic sugar in the last few releases. Too bad it's pretty much confined to the windows ecosystem.
- jimmaswell 9y agoIt's not confined to the Windows ecosystem, aside from Mono there's now the officially supported cross-platform .NET Core.
- cat_phat 9y agoIt's definitely not confined to the windows ecosystem. I develop C# on OSX via Jetbrain's Project Rider and run the developed code on anything from linux to docker instances.
- megaman22 9y agoIn some alternate reality, progress on the Java language doesn't get lost in the shuffle in the death of Sun after 1.6 was released. Those five years of relative stasis hurt, especially where C# was making such strides. I took the AP CS test in high school with Java 6, and four years later, the jobs I was looking at after college were still Java 6. The ones where companies weren't still on Java 5, or even more archaic releases.
- Coincoin 9y ago> Too bad it's pretty much confined to the windows ecosystem. We released games written in C# for iOS, Android, Windows Phone, Windows PC and Linux servers.
- mythz 9y agoOur server library and framework software suite and Apps have been running cross-platform for several years and with the support of .NET Core 2.0 they now run fast and flawlessly on Linux which is a very popular deployment target for our Customers, in fact all our .NET Core Live Demos were developed on Windows and deployed to and running on Linux: - https://github.com/NetCoreApps/LiveDemos - https://github.com/NetCoreWebApps/LiveDemos Each project can also be opened and developed on Linux or Mac with VS Code or Rider. Xamarin's solutions has been making C# a popular language for developing native high-performance iOS/Android Apps for several years and the stigma of C# server apps being confined to Windows should be eradicated with the advent of .NET Core.
- pwdisswordfish 9y ago> pretty much confined to the windows ecosystem. That's interesting. Apparently I'm dreaming that I'm developing with C# on my macOS and deploying to Linux?
- jackmott 9y agoI've been making a game that can target Windows, Linux, Mac, Android, and IOS with one codebase in C#. I have a production system in F# (also .net) that is linux only. Developed on linux and runs on linux.
- Const-me 9y agoIt's cross platform now. I've recently implemented a rich GUI software for embedded ARM linux, running on .net core 2. Works OK, however I spent substantial time implementing GUI stack (dllimport, NanoVG, GLES, DRM/KMS).
- jmkni 9y agoI feel as though, with C#, Microsoft's brilliance was to get a number of very clever people in a room together (Anders Hejlsberg, Eric Lippert, etc). Somebody at Microsoft said to themselves, these guys are clearly brilliant, let's see what happens if we hire them all, task them with creating a new object oriented programming language, pay them a tonne of money, and see what happens. C# was the result, and it's awesome!
- seanmcdirmid 9y agoDon’t forget former Arhus professor Mads Tergesen, he’s been the lead C# designer for sometime now.
- na85 9y agoThe problem with C# for me is the fragmented ecosystem that's hard to navigate, coupled with dense and hard to find documentation that seems to be spread out over 14 different msdn domains and GitHub projects. CoreFX? CoreCLR? No idea what these are or what they're for. And don't get me started on the dumpster fire that is roslyn. I've tried no less than 10 times over the last few months to get "intellisense" working in emacs via roslyn and it has never worked. C#'s a cool language that I want to like but it's just so much work to get started with.
- lwansbrough 9y agoThere are many more names for things in C# than what you really need to be aware of as a C# developer. Want to write C# that targets Linux? Download the .NET Core SDK. Simple as. Everything else: .NET Standard, .NET Framework, are just names used by the .NET contributors to keep things straight in their head, but you honestly rarely deal with that stuff if you’re starting fresh with .NET Core. If you’re trying to write C# in emacs you’re doing it wrong. C# has probably the best tooling in the world if you embrace it.
- qdot76367 9y agoAgreed. I basically live in emacs, but for C#, I'm in VS 2017 community and it works great.
- logicallee 9y agoout of curiosity why do you know so much about a language that was "mostly irrelevant to you"? Were you forced to develop in it for work, or what happened? For being irrelevant, your comment suggests you've been tracking it super closely (you link a discussion of proposals) ... (quoting you) "since it first came out"!
- twotwotwo 9y agoI just read about and play with things I don't use for work or any real projects--recently-ish I posted about Dart/Flutter here, and I worked through some basic Kotlin exercises after Google announced it as a supported language for Android. ML languages fascinated me early on; I think OCaml was the first language I saw with both strong typing and good type inference to keep code from getting verbose. Once I started looking deeper the pattern matching seemed like a key feature. Stuff like WebKit's new Riptide GC for JS is interesting (concurrent and generational but not copying is a neat corner of the space I hadn't heard much about). Rust is making progress on low-cost memory- and thread-safety. Computers can be interesting! HS/college was a lot of C(++). My work has been Perl (I'm old) and then Python/Django (with the usual sprinkling of other stuff: JS, bash, etc.). Go has been a surprisingly intense hobby over the past few years and it's probably the only lang I could bust something interesting out in soon without much of a learning curve. (I guess also some of the close cousins of JS out there, but not really a brand-new environment then.) I did play with very early (pre-`var`) C# more than 10 years back (I'm old!), but that was before most of these improvements happened and before I understood the relevance of the things like value types that were in there from the start. It's interesting now mostly as another point in the space of programming languages/environments, e.g. different tradeoffs around GC, generics, etc. Guess it has somewhat more potential to be relevant to me as an open/cross-platform project, but it's hard to see myself making the big time investment to actually get up to building-stuff speed in it just for giggles. Similar feelings about Swift or Kotlin, FWIW. (Not that I'm totally ruling anything out, but I've got stuff to do!) That specific discussion of proposals I just Googled up looking for the C# pattern matching stuff. I first heard about it via a different link posted on lobste.rs a while back, but it was faster to Google this than look for that.
- 9y ago
- acangiano 9y agoIt's worth mentioning that C# is one of the most flexible languages available today. Not many languages can claim a great web development, native GUI, native mobile apps, and first-class gaming development, story.
- hossbeast 9y ago"Can be tempting to think of it as a Java clone". C# is superior to Java in every way I can think of. Just a couple examples, unsigned types, simple value types without boxing, and a real generics implementation (java generics are truly awful). The reflection API is c# is also far more useful and easy to understand.
- jayd16 9y agoJava enums are better. Seeing as C# is going to run on more than Windows that's about all I can think of.
- Pxtl 9y agoAnonymous inner classes are more powerful than c# anonymous types. I think c# wins out overall, but there are a few corners where Java has features c# is missing, coming from the fact that c# was a bit more pragmatic where Java was a bit more oop-purist in its origins.
- noblethrasher 9y agoAnonymous delegates (which have been available since 2.0) are the equivalent feature in C#, at least as far as use cases go.
- Pxtl 9y agoWhile anonymous inner classes are more verbose, they're also more powerful because you can create a whole class instead of a single method.
- noblethrasher 9y agoBut, they're equivalently powerful with respect to an API. In Java, a method might expect one instance of a class, to which you can pass an instance of anonymous class, whereas in C# a method might expect a set of delegates, to which you can pass a set of anonymous delegates or lambda expressions. However, thanks to C#'s type inference, it actually ends up being far less verbose, yet more flexible, because anonymous delegates and lambdas can close over local variables. So, strictly speaking, they're more powerful than anonymous inner classes. On the other hand, as someone that greatly admires Smalltalk, I sometimes envy Java's slightly better purity.
- j_s 9y ago> They've done a lot of interesting stuff in the language since it first came out It was always interesting to see which features were just syntactic sugar (and thus backwards compatible) vs. which required runtime support.
- n4r9 9y ago> handy looking stuff like the SustainedLowLatency GC mode Don't forget "server mode" GC. I have a long-running, memory-intensive console app which was taking about 45 minutes to process a typical batch of data. With some profiling I discovered that after the 20 minute mark, most of the time was spent in GC. Some of the classic optimisations (classes to structs, new list to list.clear) helped get the processing down to 30 minutes. After some more Googling I discovered and tried server mode GC. Suddenly it took less than 13 minutes.