"Michael R. Wolf" <[EMAIL PROTECTED]> wrote
> Luke <[EMAIL PROTECTED]> writes:
> 
> > My problem with programming is that i dont know if im
> > doing the right thing... 
> 
> > Yes the program/script works but Im not sure if its
> > effecient or not...
> 
> And, as a training exercise, you can take working software,
> make some changes and see what happens.  If you break it,
> restore it and try something different.  What did you learn?
> If it still works, what did you learn?  The basic idea here
> is to have *working* software to muck around with.  You
> don't learn as well with broken software.  Get it to work
> (dirty, ugly, slow, whatever....), then keep it working as
> your refine it into clean, pretty, fast software, and learn
> lots along the way. 

I'd add ... Look especialy at WHAT did you have to change to 
make it clean,pretty, fast ... WHAT did you have to spend most 
time with, WHAT did force you to make lots of changes when 
someone found a bug by entering some data you did not fully 
expect, etc.

And always expect the worst of your users!
( Thank's god I'm not an admin any more! )

One place where you have to be really very carefull is ... when your 
code generates a code. A piece of SQL to execute, some HTML 
with embeded JavaScript, ... as soon as you insert a variable into a 
text that is to be used as a code stop and THINK. What is the 
variable contains a quote, doublequote, lessthan sign, ampersand, 
percent ... don't be lazy and escape the specials. Otherwise you'll 
spend a very long and unpleasant time trying to find all places 
where did you forget to do that. (If you are unlucky it will be after 
someone deletes the most important data from your database.)

And ... I almost forgot ... use strict ;-)

Jenda

=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
                                        --- me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to