Live data from Hacker News

C# is the past, the present and the future

blog.filipekberg.se

31–40 of 57 posts

Re: C# is the past, the present and the future

#31

Earlier quoted context omitted.

I don't want to be a second class citizen. I don't want to be a second class citizen ever. I don't want to be a second class citizen. I don't want to be a second class citizen ever. "Really good" is so much different from "The Most Awesome Edition" you get with languages like Java or Ruby. I can tinker with a "Really good" tech on home projects all right (except I prefer Clojure), but not in the workplace.

There are real companies out there making real money off Mono. So it's not a toy reserved for weekend tinkering. Enough companies trust Mono to use it in production.

That's news to me. Not that I disbelieve. Really interested. Can you point me to some use cases? Why do they not just use Windows?

Re: C# is the past, the present and the future

#32
post #11

Earlier quoted context omitted.

I thought office was the cash cow...lot more desktops out there than (Windows) servers.

But lots of those desktops comes with cheap, sponsered OEM-licenses of Windows and Office. You don't get OEM rebates for your MS server-park.

Not the ones in corporations, they don't get oem anything. MS can, and does, extort practically whatever it wants from big business who basically are incapable of realizing alternatives to office/windows.

Re: C# is the past, the present and the future

#33

Earlier quoted context omitted.

There are real companies out there making real money off Mono. So it's not a toy reserved for weekend tinkering. Enough companies trust Mono to use it in production.

I'm happy for them, but I'm not going to risk it. The reward is nice but not nearly worth the risk. When adopting Java, you can trust it will just work, but with Mono you have to bet it's going to work, you're not going to run into compatibility problems and tooling will be adequate.

Java comes with its own problems, especially in enterprise environments where you might be pinned to a single version. There are plenty of insecure JVMs out there that can't be upgraded on both servers and clients, mainly to ensure compatibility or meet support requirements.

Re: C# is the past, the present and the future

#34

Earlier quoted context omitted.

I'm happy for them, but I'm not going to risk it. The reward is nice but not nearly worth the risk. When adopting Java, you can trust it will just work, but with Mono you have to bet it's going to work, you're not going to run into compatibility problems and tooling will be adequate.

Java comes with its own problems, especially in enterprise environments where you might be pinned to a single version. There are plenty of insecure JVMs out there that can't be upgraded on both servers and clients, mainly to ensure compatibility or meet support requirements.

I don't see how it is relevant WRT considering a language/platform for a new project. You're talking about legacy stuff. I don't see how this can't happen to project in any language (PHP? Ruby? Perl? C#?)

Re: C# is the past, the present and the future

#36
This article has a great title. Would have been nice if there was a bit more content to it; maybe we wouldn't have ended up with a bunch of hostile comments with spelling mistakes.

So let's give it a go. An opinionated past, present, and future for C#:

The past:

.NET emerged seemingly in 2002/2003 with a feature set similar to Java. This was pre-generics, and all code written in C# in this era is alien and involves a bit of casting.

Microsoft released Visual Studio 2002, containing support for (at least) Visual C#, VB.net, Visual C++ .NET (of course. let's blend two completely different object systems. my actual favourite: Objective-C++ .NET), real C++, and Visual J#, the successor to Visual J++ (which Sun had sued the crap out of them for). Of course you're not jealous of the JVM, Microdollar! We believe you.

C# did have structs at this point, distinct from classes, which are a pretty cool feature. They're more lightweight than classes, and I believe are passed by value rather than by reference like with classes.

Also, unsigned integer types. As a man who had to make a small machine 'emulator' in Java as part of a not incredibly well thought-out practical, I appreciate not having to bend my mind around poking the sign bit to try and get the real number I'm actually after.

And automatic unboxing and boxing of types was cool too. Int basically the same as int. So they did have a few original thoughts.

Event handling also deserves a mention, so there we go.

I personally was coding in VB6 at this time, and viewed VB.net with a mixture of bewilderment and contempt. So many keywords! Although the My.* namespace looked really cool. Actually being able to find out and change things about the current system, without being e.g. only allowed to change registry settings in a VisualBasic area of the registry.

That was about the time that I was messing around with threads thanks to the AddressOf operator, so really, a move was probably on the cards. (You had to bind the Windows threading API yourself, and when you tried to pause in the IDE it would only pause one thread, get confused, and crash.)

I eventually moved to VB.net (in the 2.0 era) and turned to treating C# with a mixture of bewilderment and disgust. (Clearly, I'm a quick learner.)

Re: C# is the past, the present and the future

#37
post #36

This article has a great title. Would have been nice if there was a bit more content to it; maybe we wouldn't have ended up with a bunch of hostile comments with spelling mistakes. So let's give it a go. An opinionated past, present, and future for C#: The past: .NET emerged seemingly in 2002/2003 with a feature set similar to Java. This was pre-generics, and all code written in C# in this era is alien and involves a…

The 2.0 era

Java and .NET got generics around about the same time, a few years later. Java (sanely, to be honest) implemented generics via type erasure - so the compiler does the type checking, and then emits code that has no type information for generic containers - whereas the .NET team elected to break backwards compatibility* and make the runtime understand generics.

I think Mono appeared around this time.

This is the time when .NET started to get going, to be honest. Never settle for writing XNA ran 2.0, although Microsoft's bored of trying to get people who aren't amateurs to use that now. Running my own code on the Xbox 360 was pretty cool though. But they seriously needed to put a better garbage collector on that thing. It was, er, rubbish.

* An annoying but possibly necessary decision. To this day, .NET 1.0/1.1 and 2.0+ apps require two separate runtimes to be installed, on Windows. Although Mono just deals with it, I think. Still, coming across the odd remaining 1.1 program can be a nasty surprise.

Re: C# is the past, the present and the future

#38
post #37
post #36

This article has a great title. Would have been nice if there was a bit more content to it; maybe we wouldn't have ended up with a bunch of hostile comments with spelling mistakes. So let's give it a go. An opinionated past, present, and future for C#: The past: .NET emerged seemingly in 2002/2003 with a feature set similar to Java. This was pre-generics, and all code written in C# in this era is alien and involves a…

The 2.0 era Java and .NET got generics around about the same time, a few years later. Java (sanely, to be honest) implemented generics via type erasure - so the compiler does the type checking, and then emits code that has no type information for generic containers - whereas the .NET team elected to break backwards compatibility* and make the runtime understand generics. I think Mono appeared around this time. This i…

The present (kinda): 3.0/3.5

Man, why would anyone want any of this LINQ or closure stuff? I don't get it. We already have event handlers, and for blocks can do anything LINQ can do (that I'd use it for)!

It was about this time that I got into Haskell, somewhat out of necessity as that's what our uni course starts teaching. I've only grown more fond of Haskell since those days, mostly after learning a little OCaml/F# and seeing how comparatively nasty ML syntax is. Yeuch.

VB.net kinda lagged implementation-wise for these features vs. C# - I guess I wasn't the only person who moved from the former to the latter - but in C# they were fairly glorious.

No more would we be teased about the relative verbosity of our language! Fine, we still might go a bit long horizontally, but now we too can fit an amount of functionality on one line sufficient to guarantee the confusion of the reader and thus job security. Not that I have a job. Does job security keep you out of a job if you don't have one? Hm.

LINQ uses method extensions (a hilarious but occasionally useful bit of the language) to add new functions to all the collections types whenever LINQ is imported. Mapping and 'aggregating' (folding) and what have you arrived in C# 3.0, with surprisingly nippy implementations, and a whole lot more came with 3.5/4.0 (I forget).

Cool stuff. Cooler with closures. With events we didn't have to worry about writing inner Listener classes willy-nilly (insert comedy projectile vomiting here), but you still had to define the type of the function you were writing explicitly. Not so with closures. They're cool. I sometimes use them like private inner functions, but I'm pretty sure that's my fault.

Something else most definitely worth mentioning that came around here that is undoubtedly a good and cool thing was type inference, or the super magic 'var' keyword. (Like the C++ auto keyword, THAT CAME AFTERWARDS (possibly). We're inventing! Yay!)

Out with the List stringList = new List()! In with the var sl = new List()! Glorious.

While I'm going long here, I need to also mention automatic property implementations.

So we don't have getWhatever and setWhatever functions in C# - (though we do agree with our Java brethren that generally exposed fields Are A Bad Thing) - we have: public whatever { get { return _whatever; } private set { _whatever = value; } }.

But in 3.0, you can do e.g. public whatever { get; private set; } and the boilerplate is written for you. If you ever want to swap them out with some code that actually does something at a point after that, you can then go ahead and do that. Awesome stuff. Java coders love this when they learn about it.

I think Mono also came of age here and stopped sucking. A new generational garbage collector (sgen), far greater API support, and the demands of game developers embedding the runtime left, right and center undoubtedly helped. (Mono runs on Windows and consoles, too, you know!)

Their System.Drawing implementation is still a bit crappy, though. I've had to do some weird things to alpha channels and what have you.

Re: C# is the past, the present and the future

#39
post #38
post #37

Earlier quoted context omitted.

The 2.0 era Java and .NET got generics around about the same time, a few years later. Java (sanely, to be honest) implemented generics via type erasure - so the compiler does the type checking, and then emits code that has no type information for generic containers - whereas the .NET team elected to break backwards compatibility* and make the runtime understand generics. I think Mono appeared around this time. This i…

The present (kinda): 3.0/3.5 Man, why would anyone want any of this LINQ or closure stuff? I don't get it. We already have event handlers, and for blocks can do anything LINQ can do (that I'd use it for)! It was about this time that I got into Haskell, somewhat out of necessity as that's what our uni course starts teaching. I've only grown more fond of Haskell since those days, mostly after learning a little OCaml/F#…

The future:

.NET 4.0 gave unto us the second revision of the F# language, and the Async and Await keywords. These are extremely cool, and I have had a great deal of fun writing seemingly-synchronous code (e.g. a character generation module for a MUD) that turns out to be asynchronous with the right words in the right places. Marvelous, great job, etc.

F# didn't begin existing at this point, but it basically did for me. F# is open source as heck, so it has a bit of the cool factor, and it really is just another take on OCaml. Unfortunately F# 'objects' (things, I mean) aren't real .NET objects, but you can explicitly write real .NET objects within the language with only slightly more verbose syntax and going the other way is really easy.

F# is a lot of fun and a real functional language. If you haven't tried it, you really should. Async and await are amazing here too.

Also gave us the .NET Framework 4 vs. .NET Framework 4 Client Profile as distinct framework targets. Clearly the latter is a cut-down version of the former, except that there's almost no difference in the available functionality, and the downloads for both runtimes are almost the same. Hm. Mono ignores the distinction completely, and I think we should too.

Whatever. Clearly C# is a labor of love, and we are going to get all the features we can ever pretend to understand over the coming years. I look forward to the eventual relaxing of having to put startup code in void main instead of just loose in the file (maybe), the IDE having more understanding of code (even if .NET intellisense in VS blows the C++ version out of the water and, indeed, at least three levels of atmosphere), and (optimistically) a more coherent F#.

.NET 4.0/4.5 has a bunch of features I can't even remember right now, and I look forward to learning more about the language, even if Littlecurrency politics seem to currently neglect .NET for C++ and Javascript in Metro apps a bit. (WinRT is a really cool framework though.) C'mon, only C++ apps allowed to use Direct3D? What year is this?

I'm still going to keep using C#, and I'm not the only one. (I use other languages too. Doesn't everyone? Go rules, Ruby has some very exciting ideas, and I wrote a node.js app the other day that to my surprise wasn't actually a piece of shit. So that's nice.)

I think that 'a slightly better Java than Java' is an idea that will prove promising for years to come.

A little about Mono:

Mono is a great platform, for what it's worth. With their new garbage collector (that can be tuned!), almost complete* support for the latest .NET 4.5 feature set, and their own additional features (tasklets and SIMD instructions, a REPL, and Compiler as a Service, anyone?) on top, I think it's pretty cool, and you might, too.

At the risk of preemptively lowering the tone - the current discussion here isn't that bad - the current best defense of Mono is an old Jo Shields rant at http://apebox.org/wordpress/rants/124/, though its tone is a little inflammatory at the start.

To summarize: Mono is independent from Microsoft, covered by the Open Invention Network re. patents, is a free implementation of an international standard by a convicted monopolist (a la the entire GNU system for UNIX) and is actually quite awesome in its own right. It's not just a compatibility framework. It isn't 100% compatible with the .NET Framework, and it doesn't need to be.

* Mono doesn't support WPF.

Re: C# is the past, the present and the future

#40
post #36

This article has a great title. Would have been nice if there was a bit more content to it; maybe we wouldn't have ended up with a bunch of hostile comments with spelling mistakes. So let's give it a go. An opinionated past, present, and future for C#: The past: .NET emerged seemingly in 2002/2003 with a feature set similar to Java. This was pre-generics, and all code written in C# in this era is alien and involves a…

> which Sun had sewed the crap out of them for

Speaking of spelling mistakes...

Post reply on HN