Quote:
|
Originally Posted by Andy0687
How can styling and readbility be judged?
I dont get the basis for doing that, if the scripts work and are not computer intensive, who cares who can read it, chances are everyone on the server has an idea what is going on, and thats all that is importaint. Right?
|
Styling and readability can easily be judged on whether the script's structure is immediately obvious when you open a script.
For example, a script like this...
PHP Code:
function oncreated()
{if (this.foo==this.bar)
{this.something=somethingelse;
this.otherFunction();}
}
... is much less readable than:
PHP Code:
function onCreated()
{
if (this.foo == this.bar)
{
this.something = this.somethingelse;
}
}
... especially with longer scripts.
If you have to sit and think out the structure of a script, i.e. how many code blocks you've ventured into at a given point and for what conditions, then it's badly structured.