View Single Post
  #18  
Old 02-12-2010, 05:35 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by cbk1994 View Post
For the thread to be stuck pretty much says it is the "correct" way to do things. A few points:
  • Variable declarations serve absolutely no purpose to the engine, and can't possibly have any other effect except slowing it down, even if ever so slightly. Saying that all variables should be declared before being initialized is incorrect and personal preference. It is probably better to just use comments for listing variables.
Most things mentioned in style guides serve no purpose in the engine and are personal preference. The idea is to point out what most people's personal preference is, or should be.

Quote:
  • The indentation of your switch statement is wacky.
That is how pretty much everybody indents switch statements.

Quote:
There are also some things that need further explanation, such as the return statement. The way it's worded now it could be seen that something like:
PHP Code:
return (((2) + (2)) ^ .5); 
is wrong, when it's clearly not.
It clearly says "should", it is not ambiguous.
Reply With Quote