.NET and I
I learned C# in 2000, when the compiler and tools were still in beta (I think. I know I was working with the beta, but maybe the finals were released unbeknownst to me (hehehe! The Firefox spellchecker does not recognize “unbeknownst”!))
I remember that I liked the language. It was clean and relatively compact, it had a largish and useful library, it was like C++ and Java (benefit? really?) and it had a command-line compiler. My impression at the time was that it was more suitable for small and quick programs, and very suitable for teaching programming. I even suggested it to my teachers at university as a replacement for Pascal, which was then thought as the first language to CE students (this was maybe 4 years before I met Lisp, or better yet, Python.) This was also before the whole .NET fucked-up-ness happened with all the WinForms and ASP.NET and whatever other shit they are peddling these days. In those days, .NET and C# produced console applications, unless you ventured into the river of diarrhea output that is the Win32 GUI API; but that was pretty much what you generally had, back then.
Anyways, my shallow and brief delving into the world of .NET was barely deep enough for me to familiarize myself with the inner workings of MSIL and the JIT compiler and the virtual machine. I learned little about these, and I have not kept up with the new developments in .NET, and I have no regrets there. I generally hate GUIs and network technologies that aim to solve all problems on all levels for everybody. They may suit some, and I have absolutely no doubt that many .NET-based applications wouldn’t have been as easy-to-write for other libraries and runtimes1. But I don’t generally like .NET and this opinion (I suspect) would be very hard to change.
The most obvious reason for this obvious dislike is the one I mentioned above. .NET is the champion of the all-for-all thoughtcrime. More than anything else that I have seen, it tries to do all for everyone and everything; without giving them an inkling of what the hell is really going on on any level below the most superficial. This may suit some, but it shouldn’t.
I seriously believe that every programmer needs to know what’s going on under the hood. Total abstractions almost never work beyond the most simple and trivial cases2. If you don’t know jackshit about your platform and your programs seem to have worked so far, you are just lucky. Let me give you an analogy. If you don’t know anything about how cars work and you drive one, when your cars breaks down in the middle of nowhere and you have no means of communication, the you are royally fucked. The fact that this has not happened so far, it just means that the Random Number Gods have smiled upon you so far. It may never happen, but it just as well might. That’s the way it is with programming. Except that the level of quality discrepancies among software and hardware products that you use is much wider.
All programming languages abstract the platform in some form and manner. But as some languages hide not much and what they hide, they do with much shame and much apologies (Assembly, C, etc.) others do as much as they can to distance you from the hardware. They even boast this feature!
In short, every good programmer that I know and I know of knows the whole stack of software and hardware underneath deeply and intimately. In fact, it might even be true that the better they know this mess, the better they are3.
Let me conclude now. I am not saying that technologies like .NET and Java and all those “high-level” languages are useless. I’m just saying they make it harder to be conscious about the actual platform and the rest that lies under your code. I’m pretty certain that the best .NET programmers can pretty much generate the MSIL code and the machine code that their compiler and the JIT compiler generate for any given part of their code. Maybe you should too.
1: Note that I don’t use the word “platform” here, and any other use of the word for a software technology in unintentional and a result of the force of (a bad) habit. No software is a platform; hardware is. It’s always the hardware that runs the code, and the hardware is always the platform. If you think otherwise, I believe you are the subject of the same kind of conditioning that has affected most of us.
2: Read this post on Joel Spolsky’s great (yet now sadly dormant) blog for the original presentation of the Law of Leaky Abstractions. Also read the Wikipedia page (and then the talk page for an interesting discussion.) Also read this Coding Horror post for a hilarious (well, not really!) example. Fuck LINQ!
3: I don’t believe that it’s this knowledge that they acquired first and it magically made them good programmers. I think on the way of becoming good, they had to acquire this knowledge. I have to ponder this a bit more.
As I always have to disagree, I need to raise a point that the cause and effect analysis is often glossed over in a seemingly logical argument.
“it might even be true that the better they know this mess, the better they are”
I would argue that this is not strictly a cause-and-effect scenario. Good programmers seem to also be interested in the details of the platform. But it’s not entirely essential to know about the platform to be a good programmer. Now let me add that some knowledge of the platform will help develop a “programmer’s mentality”. But the wider the gap between the platform and the software, the less useful such knowledge becomes. This is coming from a guy who once coded a RISC CPU on an FPGA and wrote a pong game on it with keyboard/mouse/monitor interface, then moved on to develop web applications with java and later moved to the fucking MATLAB. If I was a game developer, then the detailed knowledge of the GPU would have been useful, but when you have to code your shit in MATLAB, then even God himself can’t help you.
Read footnote 3!
Also, wouldn’t you agree that even in MATLAB, knowing the way memory and cache behave, and having some knowledge about the ISA of the underlying CPU, and being intimately familiar with the workings of the MATLAB compiler/interpreter/whatever-kind-of-shit-it-has will help you?
Of course, these days the hardware is so complex and the behavior of even the lowest-level programs so unpredictable, that you already have to rely really heavily on profiling. That’s even more true in higher-level environments. But a knowledge of the hardware, the operating system, and the MATLAB compiler and runtime will definitely help you understand the behavior you observe.
Not directly relevant, but you might want to take a look at this presentation by Mike Acton (a very good programmer!): http://www.insomniacgames.com/research_dev/articles/2010/1522262
Granted, he is a game programmer and some of the ideas presented are controversial, but it is worth thinking about.
By the way MatGill, don’t you miss those days when you programmed on the bare metal? When men were men and wrote their own operating systems? (device drivers, at least!)
Well, I don’t consider the MATLAB interpreter to be part of the platform. Though I do believe that a deeper knowledge of the way MATLAB interprets your code can greatly improve the quality of your programs. But as I said, because of the wide gap between the MATLAB code and the machine code, knowledge of the hardware is not that useful for a programmer of that sort. Same goes for java-based enterprise web applications. In fact for a web application developer, knowledge of network hardware/infrastructure/protocols might be much more useful than the way cpu cache works at L1 and L2. I do believe that a good web developer should know all the details about the way caching works for databases and how ssl traffic is handled through routers and all that shit. As for a MATLAB developer, you should know linear algebra inside out, or you’r just fucked.
As for MatGill, nicknames are generally chosen by others. And I do miss those days. I really think I would have been an awesome hardware engineer if I went that way. Now I’m only a mediocre AI guy with no stamina to work.
also you can develop a Big Web-App with CGI or even asm-8086 !!!
But that’s only news if you think computers are magical beasts, driven by forces beyond comprehension. To everyone else, what you say is pretty much obvious.
I’ve read your post and to be true I wasn’t sure what you are going to say at the end. It seems that your now some kind of OK with .Net after all. Thank you the Random Number Gods!
Let’s learn F# in near future
Hey, I’m just saying that C# the language is not bad and .NET technologies have their place (a small place in the world, mind you!) but this huge craze over them is just… well… not healthy!
And if I’m going to learn a functional language, I prefer to brush up on Common Lisp or even Scheme. I cannot learn any .NET languages for political reasons!