|
Posted by Kimmo Laine on 05/27/05 10:20
"Michael" <mids1999@ptd.net> wrote in message
news:S1ydnd6gyMjJXwvfUSdV9g@ptd.net...
> Can this code be improoved? If so how?
> I am new to php. This is one of my first scripts.
> Thank you
Don't get offended, but... It's the single most ugly and discusting code
I've ever seen and I'm sure there are ways improve it. For example an if
statement with over 20 conditions is quite anal and clearly something one
would do with an array.
It lacks comments. I have no idea what it is supposed to do. Adding comments
and explanation would greatly improve it. Re-thinking the structure would
help
$STDSHIPWD = 'true'; ??? What the fuck is this? don't make it a string, just
simply
$STDSHIPWD = true;// or false
Then later when you compare
$STDSHIPWD == 'true' && $IS_SHP_HOLIDAY == 'false'
all you need is
$STDSHIPWD && !$IS_SHP_HOLIDAY etc...
Those were just few things I could think right now. As once said in Beavis
and Butt-head: "This thing sucks more than anything that has ever sucked
before."
(Yes, I understund that it is one of your first codes, and you should think
about getting a book where they teach you the basic ideas of programming -
such as using functions and arrays. The way your doing is like they used to
do it in the 70's and 80's with assembly code. Things have advanced since
those days.)
--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com
Navigation:
[Reply to this message]
|