Tuesday, March 11, 2008

The lost code?

I still have some 5 1/4 and 3 1/2 floppies with some homeworks and early projects. Maybe a 70% is Turbo Pascal code and the rest C/C++.

Last tinme I made a backup, I saw a lot of toy examples. Some from books, and some from my head. The typical tiny program began with a problem sentence, and the coded solution was an algorithm. But in the middle there was the problem of the user interface. So the classic solution was to code a text menu with numbers to entre the options. Then someone came with one of those big "bible" books, were an author explain more less the trick to code some popup & pull down menus. Wow, that was really something.

But one of the first serious problems were the graphics. I remember one of my teachers asked us for a parabollic throw simulator. So the equations were easy, but because of the lack of technical info, I did it in text mode. Not bad, but looks ugly.

Then, when the group reacted and we started to plan about making some code library, a new language appeared: assembly.

Life is too short to program everything in assembly language, so a nice technique was the binding of macros in a library to use it with other languages.

And then came C/C++. Even with the power and speed of C, I remember that time was easely lost trying to find syntax errors and memory leaks. Even when C++ improves the logic, is hard to master it. The mother of my university projects: a Pascal compiler. One whole week programming day and night. And the best of all: it works.

And when Smalltalk appeared on scene, everything was beautyfull (all except my hardware). Great develoment enviroment, great power of expresion, and a networking simulator was completed in 3 days, without debbuging.

So, for some people toy samples may be a waste of time, but they reflect the essence of what it makes a good programmer: practice.

No comments: