[XP] Code Complete: Things were Scary Back Then
David Brady
daves_spam_dodging_account at yahoo.com
Fri Mar 29 15:42:25 EST 2002
> -----Original Message-----
> From: Peter Hansen [mailto:peter at engcorp.com]
>
> I don't remember any of the BASICs that I used,
> whether Apple II,
> PET, C-64, MS, or other having modules at all. Are
> you sure the Apple II
> had modules? Since it wasn't compiled, I assume
> there was some way
> to load other modules into memory while the program
> was running.
I did this a lot. There was no enforcement of
"modules" in BASIC, but you could still do modular
programming. You only had the one big program to work
with, but you mentally divided it up into sections.
For example, a hotel reservation program I wrote had a
logical layout as follows:
Starting at line 100 was the "bootstrap" code. It
initialized my globals, read in the config files,
etc., then around line 350 or so fell through to line
1000.
Line 1000 was the beginning of the code that displayed
the main menu, let the user navigate the menu and make
a choice. Depending on your choice, the code would
GOSUB to line 2000, 3000, 4000, etc.
Line 2000 was the beginning of the code that let you
enter a new reservation. Line 3000 let you delete
reservations. Line 4000 let you search for a
reservation. You get the idea. Each section was only
10-50 lines long, and there was a lot of space between
the end of a section and the beginning line of the
next section, but you knew when you were browsing the
code that if you were looking at, say, line 3120, you
were in the "delete a reservation" section.
(Yes, using the RENUM command was a serious pain.)
That was in 1986. Ironically, I never properly
learned the concept of "modular programming" as a
separate concept until 1996 or so, after programming C
for 4 years. In BASIC, we called it "Structured
Programming", but I didn't really understand "tight
cohesion, loose coupling" until I read McConnell's
book a decade later.
*shrug* IIRC, Kent Beck says he started learning the
principles of XP programming in assembly. You can
*do* it, but sometimes a lot of your organization is
external to the program or language itself, and lives
only in the habits you practice while developing.
Cheers,
-dB
=====
David Brady
daves_spam_dodging_account at yahoo.com
I'm feeling very surreal today... or *AM* I?
__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/
More information about the Python-list
mailing list