Day by Day Daily Cartoon by Chris Muir

The Mad Scientist... Mwahahahahahahahaha

Wednesday, January 07, 2009

New Year Stuff

Okay, so the new year has rolled around - Merry Christmas and Happy New Year!

Still on my GeekBlogger Interlude, until the end of Jan, more or less (Chinese New Year falls on Jan 26th, which coincidentally is the very date for Australia Day). So, let's continue to roll, shall we?

When I consider all the possible programming languages in the world (at least those that vaguely look like English), I come back to my first ever programming language learned (aside from scripts/batch files); Ada. What do I like about Ada? Well, pretty much everything, really. It's clean, it's elegant, it's named after the first ever programmer (woman programmer, at that!), it's fully documented, but the biggest thing I love about Ada is that it's really, really hard to write WTF code with it. The IOCCC gives you an idea how easy it is to bugger up C source; doing the same with Ada requires two hundred times the amount of creativity and ingenuity (or sheer bad luck).

C is, as many people have put it, a portable assembler. We're not exactly at the MOV AX, CX level when we use C, but you can certainly emit some seriously bollixed source code in C. There are programming languages out there that will compile whatever you write (the compilers for these languages pretty much modify your code until it does something, just not necessarily what you want or thought it would do); Ada compilers pretty much sit on your code until you fix everything.

Considering that Ada is a real-time, concurrent, multi-threading, object-oriented language used by the military all over the world, it's really no wonder it's mighty hard to bring down. But see, here's the thing. If you learn to code in Ada, switching to any other language is going to suck balls, and suck hard. In Ada, there's a lot of stuff that the compiler enforces on you that other languages call 'good coding practices'. If you write code in Ada, it's practically impossible to get buffer overruns - simply because the language prevents it. Move over to another language, much less strongly typed and where your input is not sanitised... say, VB, or even C++, and bye bye! to your compiler checks.

Of course, you could always emit Ada-like code in such languages, but you also have to write your own buffer-overflow detection and prevention code. And that's stupid - the compiler should do that for you.

So, yeah, anyways, I like Ada a lot.

No comments: