Programming style (or lack thereof)...
Jun. 18th, 2009 11:17 amThere was a time I used to program for a living, back in the days when it was all a C compiler could do to spit out assembler code, much less perform the kinds of checks that were later built into languages like Pascal. My first major project was written in line-numbered BASIC on a system with 8K of memory. After having suffered through the process of dealing with my own "spaghettti" code in the course of system deployment, I became an avid devotee of structured code all on my own, turned to C, and never looked back (at least, not at BASIC, not as implemented back in the day).
Some time later - I think I was still at Borland at the time - Microsoft came out with something called Visual Basic, which was to BASIC what military music is to music (and you can take that any way you like). VB, as it's called, formed the basis for writing macro code in Microsoft Office (or, at least, in Word).
One neat aspect of Word is its ability to "record" a macro, meaning that once you set the recording process in motion, you simply use the mouse and keyboard to accomplish what you want. Once you're finished, you turn off the recorder. Everything you did while the program was in "record" mode was captured as a sequence of Word Basic statements that you can edit, which eases the burden of having to learn the language from scratch.
Some time ago, I wrote a well-structured macro that would transliterate Cyrillic characters to Latin ones (e.g., Путин becomes Putin), but it was lost under circumstances that escape me at the moment. A couple of days ago, faced with having to transliterate a ton of Russian names, I reproduced the macro, only this time, instead of a loop, I copied the same few lines of code and made the requisite tweaks for each upper- and lower-case Cyrillic letter.
It's ugly and most certainly not very efficient, but... it works!
Cheers...
Some time later - I think I was still at Borland at the time - Microsoft came out with something called Visual Basic, which was to BASIC what military music is to music (and you can take that any way you like). VB, as it's called, formed the basis for writing macro code in Microsoft Office (or, at least, in Word).
One neat aspect of Word is its ability to "record" a macro, meaning that once you set the recording process in motion, you simply use the mouse and keyboard to accomplish what you want. Once you're finished, you turn off the recorder. Everything you did while the program was in "record" mode was captured as a sequence of Word Basic statements that you can edit, which eases the burden of having to learn the language from scratch.
Some time ago, I wrote a well-structured macro that would transliterate Cyrillic characters to Latin ones (e.g., Путин becomes Putin), but it was lost under circumstances that escape me at the moment. A couple of days ago, faced with having to transliterate a ton of Russian names, I reproduced the macro, only this time, instead of a loop, I copied the same few lines of code and made the requisite tweaks for each upper- and lower-case Cyrillic letter.
It's ugly and most certainly not very efficient, but... it works!
Cheers...