Jump to content


Detinguishing profesional source codes for PHP?


  • Please log in to reply
6 replies to this topic

#1 Guest_askjames01_*

Guest_askjames01_*
  • Guests

Posted 25 April 2006 - 02:59 PM

Just curious to know if the source codes was written by an expert programmers or not?

How do you distinguish codes written by professional programmers?

Or what should a programmer do, to make his codes look more professional?








#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 25 April 2006 - 03:05 PM

Comments, spacing, indents, and readable code. Variables should be descriptive and defined if they're meaning is not readily apparent. Classes should be well documented and snippets should explain complex loops and calls.

Info: PHP Manual


#3 Guest_askjames01_*

Guest_askjames01_*
  • Guests

Posted 25 April 2006 - 03:15 PM

what do you mean by readable codes ober?
is this mean simple logic codes and not complicated one?



#4 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 25 April 2006 - 03:21 PM

No, I mean proper spacing, good variable names, using switches instead of multiple nested ifs.... you can tell when someone doesn't know the language because they use very long methods to accomplish something.

Info: PHP Manual


#5 Guest_askjames01_*

Guest_askjames01_*
  • Guests

Posted 25 April 2006 - 03:35 PM

ah, i see.

how about VERY LARGE PROJECT codes...

any good suggestions?

#6 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 25 April 2006 - 03:41 PM

I'm not sure what you mean. The same practices should be true for small and large projects. The only thing I would suggest for bigger projects (and something I should be doing at work) is to create an external document that describes your application.

Info: PHP Manual


#7 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 25 April 2006 - 05:13 PM

[!--quoteo(post=368478:date=Apr 25 2006, 04:05 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Apr 25 2006, 04:05 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Comments, spacing, indents, and readable code. Variables should be descriptive and defined if they're meaning is not readily apparent. Classes should be well documented and snippets should explain complex loops and calls.
[/quote]
I'd pretty much agree with that - It really does annoy me when people don't follow those very simple concepts, especially the indents, without them it makes code a lot more difficult to read!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users