View Single Post
Old 01-30-2016, 08:28 PM   #27085
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
Quote:
Originally Posted by Katsunami View Post
Good observation It is indeed circular. It doesn't run from top to bottom, but in a circle, and everything runs all the time. The code itself is rarely complex. It actually is very easy most of the time. The circular part and having everything run all at once is what makes it difficult.
The joys of event-driven programming...

Quote:
One of my earliest real programs from 1990 or 1991 was a front-end for pkzip/unzip. It basically had one (1) useful line of code: the one that executed the command-line to actually zip or unzip something. The rest of the program was the front-end, and error handling. I used it for years, until I switched to OS/2 and later Windows NT, and it worked well.
I began in computers in the days when the original IBM PC , with a 4.77mhz 8088 CPU, up to 64kKB of RAM, and dual 360KK floppy drives was just starting to take over corporate desktops.

Archivers were wild and wooly back then, with everybody and their dog trying their hand at writing one. Zip was just the tip of the iceberg, and I needed to deal with ARC, ARJ, LZH, RAR and ZOO files among others in addition to ZIP, and needed to keep an assortment of archivers about to do so.

One of my early adoptions in the MSDOS world was 4DOS, a shareware replacement for the COMMAND.COM program the user talked to on a DOS PC, and what you got at a C:\> prompt. 4DOS vastly improved on COMMAND.COM, including a greatly enhanced batch language that made it possible to create useful small applications in batch. (4DOS batch, among other things, built in the ability to get input from the user in a batch file and do something based on it.)

Another happy addition was Gordon Haff's Directory Freedom, a freeware file handling utility based on code originally published in PC Magazine. Run DF, and it put up a menu of files in the directory you ran it in and let you perform operations on them. You could program just what actions DF would take. I wanted to be able to select an archive in DF and view the content or extract it without caring what the format was. The solution was a 4DOS batch file attached to a key that parsed the archive file name, and called the appropriate archive utility based on the archive's extension to handle the job. The guts of it were the filename parsing routine, using primitives built into 4DOS, and a lengthy switch statement that called the appropriate archiver depending upon the extension. Worked a treat, and was carefully not spaghetti code. I was already firmly in the "Write for maintainability" camp.

(There's a hilarious comparison of programming languages based on how you shoot yourself in the foot. In perl, for example, you shoot yourself in the foot, but no one else can figure out how you did it. Six week later, neither can you... )
______
Dennis
DMcCunney is offline   Reply With Quote