[thelist] [softwaredesign] was [Design] Link Color Dilemna

Warden, Matt mwarden at odyssey-design.com
Fri Nov 17 16:04:08 CST 2000


> Well, I've got my head around basic php scripting / hacking, and I'm
> getting there with MySQL -- but -- what I'm looking for is some more
> abstract readers on 'how to design software well'. I've found many
> fantastic places where you can get information on what function does
> what, and can troubleshoot problems (not least of all 'the list'). But
> I'm having trouble working out how to make these scripts behave like
> programs, not hacks.

Let me get this straight, you *don't* want hacks? ;-)

Check out:
http://joel.editthispage.com/

> For example: http://www.thepander.co.nz -- it works (just), but it's one
> insanely long if -- elseif -- elseif -- elseif -- [...] -- else
> conditional. That will do the job for this site, because it's not much
> more than andrew's playground, but I'd hesitate to write a program that
> shonky for a commercial client.

In what language? A long elseif series isn't necessarily bad, as long as it's
readable. In other words:

if this then
    doThat();
elseif that then
    doThis();
elseif Dexter.isSleepingOnTheJob() then
    Warden.wakeUp(Dexter);
elseif iSac.isPlayingEverQuest() then
    ...
end if


rather than:


if this then
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
elseif that then
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
elseif Dexter.isSleepingOnTheJob() then
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
elseif iSac.isPlayingEverQuest() then
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
    code code code...;
end if


And, two words: Modular-ization. Once you stop thinking of script(or)program =
web page and rather thinking of scripts or programs as groups of
functionality, it's much easier to see where similar functionality lies and
can be thrown into an include file.

I'm kind of a psycho when it comes to modularization and clean if/then and
loop blocks. I'm not satisfied until my loops look like this:

do until DanCody.hasStoppedTweakingThelistSoftware()
    action1();
    action2();
    action3(Evolt.numberOfSubscribers);
loop


> Any advice would be great (and please, go to town on thepander's
> programming :-)

Looks like a cool idea. Where the hell did you come up with that?!?!

--
mattwarden
mattwarden.com





More information about the thelist mailing list