develooper Front page | perl.beginners | Postings from January 2002

Re: Good CS Literature

Thread Previous | Thread Next
From:
Jenda Krynicky
Date:
January 4, 2002 15:10
Subject:
Re: Good CS Literature
Message ID:
3C364478.12687.15275937@localhost
"Michael R. Wolf" <MichaelRunningWolf@att.net> wrote
> Luke <xluther_list@gmx.net> 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

=========== Jenda@Krynicky.cz == 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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About