The Digital Lumberjack

Hacking Code When Life Goes Digital

Ada Love Story


Post date 27 Oct 2009
Filed under

Programs must be written for people to read, and only incidentally for machines to execute Abelson & Sussman, SICP

Right before my first programming assignment at my University, we all had big expectations regarding the language we had to work with. Back then Visual Basic, C++ and Delphi were the big guys, but I as much as my colleagues agreed, maybe that was a too much for starting. C seemed the most promising option, it was after all, the language of the hackers. All the real macho programmers could code any thing they dreamed in it.

You cannot imagine our surprise when we found out that our assignments were to be made in something called Ada. Greatly concerned about the quality of our education, we started our own research.

A language from 1983? Come on! It is older than C! It looked like some evil board of professors wanted to punish us with a Cobol or Fortran look alike. Sadly, even those languages were heard of, maybe as dinosaurs, but even so, much more than it. What was it good for anyway? That thing was born in the hands of the USA army, but they seemed to ditch its development. At first sight, not a single company cared about it.

Ever since all went just bad. Suddenly programming became harder. That stupid compiler could not stop complaining at every single line of code. The semester went through with a great deal of pain. After such experience, the question about which programming language was used in every other course had quite a deep meaning along it.

However I've always had this nasty habit of calling for trouble with the most challenging solutions. So I started picking up language and compiler oriented courses. I've been always convinced that understanding what is going on between the language and the machine can help me to become a far better programmer. That way you can quickly find the most efficient way to execute your code, the safest coding style, all your options... and quite specially, to understand those moments when you have a hard time trying to understand why your code is not doing what is supposed to do. You might very well call it: the Coding-X-Vision Superpower.

On the other hand, compilers are the most exciting tools to work on because you can put to work everything you know about computer science. You must have highly complex data handling, concurrent/distributed programming, come up with all kind of optimizations. The design and robustness must be perfect because compilers are supposed to live an eternity while having always room for improvement. No other thing will demand a better understanding of the operative system and the processor. If on top of that you love the job well enough to be turned on with some assembly lines of code. What else might you dream of?

Much to my surprise I noticed that some of the courses used Ada in their lab assignments. It caught my attention that some things could be only done in it, and even if something was done in another language, it had its origin in Ada.

Before Ada 2005 object oriented programming in Ada didn't look as elegant as what you can do with Java, but even so, Ada was the first standardized language to support it. If you use exceptions, you should say thanks to Ada. What if you want to use threads or develop a distributed application? Hats down for Ada again. Not that the beloved C/C++ cannot do it, they have libraries for that, it is just that Ada defines that in its own standard, plus, they had it even before C. Standards translate into extreme portability which software that behaves exactly the same everywhere. One of Ada big points is that all its features are exquisitely defined and well documented. No place for surprises! No Sir!.

The story went on from distributed computing to language and compiler design. I started to learn about those ambiguous legal constructions in the main languages and the gaps in their definitions. Something compiled with no problems but then something failed. If by then you tried looking in the standard you might find the expression behaviour undefined. Well, that is a very bad word you will not find in Ada!

When I had to choose a project to finish my career, I went for Ada, and although that made my life more difficult than necessary, I definitely developed a great admiration for the language. Maybe it took me way longer than any other project, but I had the chance to work with two great engineers: José Fortes, highly skilled in compilers and Javier Miranda, a tireless GNAT hacker.

My experience with my professors and Ada has changed the way I think about programming, refined my tastes and influenced my career life before it really started. Although I hope this article raises your interest for the language, I will not try to convince you to use it. Sadly it is a greatly misunderstood language and you will not find many opportunities to work with it (neither do I). I just wish that more people could value Ada for what it is, and how it has affected so many other languages that despite being more famous, still cannot beat it.

blog comments powered by Disqus