Imagine debugging a few thousand lines of code that looks like this! I’ll digress here, but I once worked with a guy whose code was filled with comments like “Guess what this does.” and “I forgot how this works.”
I try not to use comments very much here but there's one particular routine that was fetching a whole board worth of messages 3 times to display one message; once for the message, once to figure out the "previous" link and once to figure out the "next" link. My comment until I changed it? "You've got to be sh*ttin' me!" <g>
That's really another area of programming altogether. If a system is small, you just write whatever's convenient for the programmer. Once it gets to be pretty large, you have to start tightening things up, sometimes a lot. When it gets huge, you start analyzing every little instruction you're making the machine carry out because a miniscule inefficiency (like the difference between arrays and pointers) can become huge when you're dealing with hundreds of thousands or even millions of iterations through a loop being performed by hundreds or thousands of people at the same time.
That kind of monkey is on my back right now, but getting the new webserver shrank the monkey.
I'd started storing lots of things in session variables because accessing something (like the width of each menu item) from the database on every single page is a lot more expensive than getting it from memory.
I'm going to have to use a different approach, though, because as powerful as our new webserver is, the day will come when we'll have to run multiple servers. And as I've already found, that's a nightmare when you're relying on session variables.
So now I'm going to (eventually) change things so that all the little stuff that has to be available during a user's session will be stored in hidden form fields and passed back and forth from screen to screen.
Hopefully, when that's completed and we're to the point we need multiple machines again, it'll be a lot simpler because it won't matter which machine each of your requests go to. With session variables, each request during a session has to go to the same machine. With hidden form fields, you should be able to bounce back and forth between machines and it won't matter.
I talked to Brad Dryer about it and the way he did it was to store only the user's login info on the user's machine, then use that to fetch everything else from the database on each page view. That won't work here because for each 1 thing he was fetching from the database, I'm probably fetching 10, thanks in large part to the My Interface and My Settings thing.
Example: while(*word) ++*(wordaarray+*word++-‘a’);
That's one of the things I hate about C. Perl, too, although it doesn't seem quite as bad to me. I love BASIC and all its dialects.