Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

A Test To See If You Write Sloppy Software
Naming Standards, Commenting and Formatting Your Code
It's valuable to have a naming standard for the functions you write in PHP. If you aren't using OO-style PHP programming, you can quickly run into name-space problems. I generally start my function names with the name of the sub-section I'm in. For instance, if I'm in the "bug tracker", all my files are in the "/bug/" directory and the functions start with "bug_". Bug-tracker-specific tables in the database would also start with "bug_" for clarity. Give yourself 1 point if you have a rational naming standard.
PHPDoc, which is based on JavaDoc, has been adopted as the standard for commenting and documenting functions in PHP. I use PHPDoc on more elaborate projects, but I generally just use short comments for tight-budget client work. Give yourself 2 points if you use PHPDoc or 1 point if you use standard comments.
I also encourage you to take pride in formatting your code. I always use plenty of braces ("{" or "}") in my code and parentheses wherever it makes sense. Braces are not strictly required all of the time, however the idea is to make your code absolutely clear and obvious to anyone who takes on its maintenance after you part ways with it. I also use appropriate vertical and horizontal (tabs) white space to make things clear. Here is an example:

<?php

if ($test) {

    
//do something

} else {

    if (
$foo == 123) {

        
//operation here

    
} else {

        
//other operation

    
}

}

?>
Notice the extra returns and generous use of tabs to space things out for clarity. Few people will struggle with understanding instantly what you are doing here. Give yourself 1 point if you are generous and consistent with your braces and white space.
[ Next Page ]

[Page 1]  [Page 2]  


Comments:
PLEASE HELP ME!!!!!Mitch0702/10/05 04:41
Ä«/µå/µ¹·Á¸·±â·Î/¸Á°¡Áö½ÅºÐ/²À º¸¼¼¿ä!ÀÌÇýÁø12/07/04 03:05
¡á¡á572¸í°ú S.E.X ½Å±â·ÏÀ» ¼¼¿î ¿©.ÀÚ °ø°³¡á¡á ½Å±â·Ï12/07/04 00:54
¡á¡á È­»ó äÆÃÁß XX¸¦ ´Ù º¸¿© Áֳ׿ä.¡á¡á ±èÀº°æ12/06/04 09:32
¹«·á¼ºÀÎ,¿µÈ­,¸¸È­,À¯¸Ó,¿î¼¼ º¸·¯¿À¼¼¿ä¹«·á¸Ç12/05/04 21:04
½Å.¿ë.ºÒ.·®.ÀÚ/´çÀÏ500/´ë.Ãâ.ºñ.¹ýÀÌÈñÁø12/05/04 06:39
¡á¡áÀý.´ë ¼º.ÀÎ.¸¸ Ŭ¸¯Çϼ¼¿ä.¡á¡á ÀÌÀºÈñ12/04/04 20:31
´ë'Ãâ'°Å'Àý'½Ã'100%µÇ'°Ô'ÇÏ'´Â'¹æ'¹ýÇѰæ¿í12/04/04 11:31
¡á¡á¡á Çö±ÝÀ» ÁÖ´Â °í½ºÅé Æ÷Ä¿ »çÀÌÆ®¡á¡á¡á °ÔÀÓ12/04/04 00:32
¡á¡á¡á¸ÅÀÏ Çö±ÝÀ» ÁÖ´Â °í½ºÅé Æ÷Ä¿ »çÀÌÆ®¡á¡á¡á ÀÓ°æÀº12/03/04 08:50
### °í½ºÅé Æ÷Ä¿ °ÔÀÓ Çϸé Çö±ÝÀ» µå·Á¿ä ### ÀÌÀº°æ12/02/04 01:16
¢Î¢Ï¢Î¾ß.µ¿.Àá.½Ã.ÈÄ.¿¡ ©.¸³.´Ï´Ù.¢Ï¢Î¢ÏÀÌÀº°æ12/01/04 20:06
¢Î¢Ï¢Î¼º.ÀÎ.¸¸ Ŭ.¸¯ ÇÏ.¼¼¿ä.¢Ï¢Î¢ÏÀÌÀº¹Ì11/30/04 15:48
½Å.¿ë.ºÒ.·®.ÀÚ/´çÀÏ500/´ë.Ãâ.ºñ.¹ýÀÌÈñÁø11/27/04 07:11
##°í½ºÅé Æ÷Ä¿ °ÔÀÓ ÇÏ½Ã¸é ¸ÅÀÏ Çö±ÝÀ» µå¸³´Ï´Ù..##À̼±Èñ11/26/04 12:56
@@¸ÅÀÏ Çö±ÝÀ» ÁÖ´Â °í½ºÅé Æ÷Ä¿ °ÔÀÓ Çϼ¼¿ä.@@¼­ºñ½º11/25/04 18:20
½Å.¿ë.ºÒ.·®.ÀÚ/´çÀÏ500/´ë.Ãâ.ºñ.¹ýÀÌÈñÁø11/24/04 07:07
½Å.¿ë.ºÒ.·®/Ä«.µå.¿¬.ü/´ë.Ãâ/È¥ÀÚ/ÇØ.°áÇÏ´Â/¹æ.¹ý±èÇö¼­11/24/04 01:24
¡Ú¡Ú´ëÇѹα¹ ¿©°í»ý 60%°¡ ÀÚÀ§¸¦ ÇѴٴٳ׿ä¡Ú¡ÚÃæ°Ý11/23/04 11:12
´ë'Ãâ'°Å'Àý'½Ã'100%µÇ'°Ô'ÇÏ'´Â'¹æ'¹ýÇѰæ¹Î11/23/04 07:02
¡Ú¡Ú¹«.·á.¾ß.µ¿¡Ú¡ÚÀÌÀº°æ11/22/04 18:32
½Å.¿ëºÒ.·®ÀÚ°¡ ¾Ë¾Æ¾ßÇÒ Á¤.º¸ ´ë.°ø.°³ ÀÌ´ÙÁø11/21/04 22:05
¡Ú¡Ú¹«.·á.¾ß.µ¿..Àá½ÃÈÄ¿¡ ©¸³´Ï´Ù..¡Ú¡Ú°øÂ¥11/21/04 20:37
¡Ú¡Ú¡ÚºÎ.ºÎ ½º.¿Í.ÇÎ µ¿.¿µ.»ó °ø.°³¡Ú¡Ú¡ÚÇöÀå°ø°³11/21/04 06:21
¡Ú¡Ú¡ÚºÎ.ºÎ ½º.¿Í.ÇÎ µ¿.¿µ.»ó °ø.°³¡Ú¡Ú¡ÚÇöÀå°ø°³11/20/04 05:57
¡Ú¡Ú¡Ú½ÇÁ¦»ðÀÔ Çѱ¹ ºüX¸® µ¿¿µ»ó!!¡Ú¡Ú¡Ú¼îÅ·11/18/04 12:54
Ä«/µå/µ¹·Á¸·±â·Î/¸Á°¡Áö½ÅºÐ/²À º¸¼¼¿ä!ÀÌÁ¤¿¬11/18/04 10:12
$$$ °í½ºÅé Æ÷Ä¿ »çÀÌÆ®¿¡¼­ ¸ÅÀÏ Çö±Ý Áö±Þ $$$À̹̰æ11/17/04 17:07
$$$ ¸ÅÀÏ Çö±ÝÀ» ÁÖ´Â °í½ºÅé Æ÷Ä¿..$$$´ë¹Ú°ÔÀÓ11/16/04 13:30
$$$ °ÔÀÓ Çϸé Çö±ÝÀ» Áֳ׿ä..$$$´ë¹Ú°ÔÀÓ11/15/04 13:22
<¼ºÀÎ ±¤°í>¹«·á Æ÷¸£³ë ½ÎÀÌÆ®±¤°í¸Ç11/15/04 03:13
Ä«.µå °ª.¿ø.±Ý.¸¸.°±.´Â.¹æ.¹ý(°­.Ãß)Áö¿µÈñ11/14/04 20:30
$$$°í½ºÅé Æ÷Ä¿ °ÔÀÓ Çϸé Çö±ÝÀ» Áֳ׿ä..$$$´ë¹Ú°ÔÀÓ11/14/04 01:44
+++++ Çѱ¹ Æ÷¸£³ë ¸ôÄ« ´Ù¿î·Îµå+++++¼­Àαâ11/13/04 02:01
RE: Using an ini-filerobert01/19/04 20:00
½Å¿ëºÒ·®/Ä«µå¿¬Ã¼/È¥ÀÚ ÇØ°áÇÏ´Â ¹æ¹ý!!(Çʵ¶)ÀÌÁö¿µ12/26/03 23:51
Directory = GoodnessMarcleo12/11/03 18:07
¢Ï ³ë·¡¹æ ¾ÆÁܸ¶~ ¢Ï»ç»çŰ11/28/03 22:56
Why create lots of dirsfinley_it11/23/03 20:42
Meaningful names of variablesfelix zaslavskiy11/18/03 14:16
No one indents?!?[N]11/03/03 00:05
RE: Formatting of braces in subsectionsHexed10/15/03 11:29
** °æ°í⠽ʸ¸¹ø ¶ç¿ì±â **¼Ò½º¸¶´ç09/24/03 13:29
½Å¿ëºÒ·®/Ä«µå¿¬Ã¼/È¥ÀÚÇØ°áÇÏ´Â ¹æ¹ý!!(Çʵ¶) µµ¿ì¹Ì09/23/03 14:12
Sloppy CodeJason Renaud09/02/03 08:01
Using an ini-fileIntel400408/25/03 14:40
RE: An even better way to write codeJeremiah07/15/03 16:09
Yes! (RE: An even better way to write code)Dinger06/18/03 12:00
RE: A handy tip (probably!)Alam Ben05/20/03 09:48
RE: Normalized codeAlam Ben05/20/03 09:45
What About Templates?John Cleary05/08/03 06:23
RE: Sloppy SoftwareMarjolein Katsma05/08/03 04:53
FormattingBrett05/07/03 13:03
Yes! (RE: An even better way to write code)Graham Bevins05/07/03 08:05
Tips for newbies6ix4our04/24/03 20:09
Cool quiz, if only ...negora04/24/03 08:24
RE: more pre.php examplesBinary Star04/21/03 22:58
Yes! (RE: An even better way to write code)Guess Who04/11/03 04:49
Yes! (RE: An even better way to write code)Michael Kristopeit04/09/03 19:51
A handy tip (probably!)dotbob04/09/03 12:37
Brace yourself for white space!Cakkafracle04/04/03 20:13
Yes! (RE: An even better way to write code)Jason04/04/03 09:40
Formatting of braces in subsectionsMichael Blankenship04/03/03 11:46
more pre.php examplesMartin Kudia04/03/03 02:48
Yes! (RE: An even better way to write code)Mike Mitterer04/01/03 02:53
Yes! (RE: An even better way to write code)Eugene Wee03/31/03 05:02
Yes! (RE: An even better way to write code)Benjamin Smith03/27/03 17:26
An even better way to write codeJosh Petrovich03/23/03 20:26
RE: Sloppy SoftwareDasher03/20/03 03:44
PHPDoc?Kris03/18/03 13:42
so cool...alman03/15/03 07:04
Normalized codeSam Barnum03/13/03 15:53
RE: Sloppy SoftwareJakL03/13/03 00:14
RE: Sloppy SoftwareBergen03/12/03 16:33
just commentsRob03/12/03 08:19
Sloppy SoftwareMikael Holmqvist03/12/03 08:10
Sloppy Softwaresrobertson03/11/03 22:55
RE: Sloppy SoftwareChristophe Banal03/11/03 19:58
RE: Sloppy SoftwareMatt03/11/03 19:47
RE: Sloppy SoftwareAnonymoose03/11/03 18:49
Use OOPCSN203/11/03 15:33
More on error handlingJeremy Lounds03/11/03 14:26
config vs. class functionRothchild03/11/03 10:09
oop vs config fileRothchild03/11/03 10:01
Good thesisSurjit03/11/03 01:29
Sloppy SoftwaretAz03/10/03 18:17
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.