Link Details

The more, the merrier! Login and vote now.
Link 51700 thumbnail
User 221460 avatar

By omerida
via tech.forumone.com
Published: Nov 07 2007 / 07:28

Seasoned advice for writing code that is readable and maintainable in the long run.
  • 9
  • 3
  • 1776
  • 726

Comments

Add your comment
User 250139 avatar

matt_yucha@yahoo.com replied ago:

0 votes Vote down Vote up Reply

PHP is certainly a language that lets developers do the wrong thing very easily.

User 221460 avatar

Oscar Merida replied ago:

0 votes Vote down Vote up Reply

Agreed, and there are a lot of bad advice/tutorials out on the web.

User 233461 avatar

antych replied ago:

0 votes Vote down Vote up Reply

Just follow universal tips and common sense. There's nothing language specific about it.

User 221463 avatar

SandyS1 replied ago:

0 votes Vote down Vote up Reply

Well, there are some things that are part of the culture in PHP (and Perl) that aren't part of the culture in other languages (say, Java). But some people who need this type of advice don't read posts about other languages, so it's useful to translate it into PHP, so to speak.
,

User 207069 avatar

hal10001 replied ago:

0 votes Vote down Vote up Reply

Alex Netkachov has received a lot of undo flack for writing "6 PHP coding tips to write less code" on several social bookmarking/voting sites. I find it rather interesting that so many developers can slam his advice, and yet have trouble really identifying anything wrong with the approach. Oscar you made some good points in your post, but I think Alex did a fine job with his post as well. We are all guilty of using shortcuts, and there was nothing "unreadable" about the techniques he outlined.

User 221460 avatar

Oscar Merida replied ago:

0 votes Vote down Vote up Reply

There's nothing unreadable about them when you just see one or two of them. Its the overall code style that it can lead to in inexperienced hands which then reflects poorly on PHP as a language. I have no real problems with 1-3, in face I use them on occasion, but usually encapsulated within a function or class that someone else isn't likely to see or care. Also, I didn't slam Alex's advice, I just pointed out that writing less code does not automatically mean you write "better" code, albeit for my definition of better.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.