News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Vinícius Krolow:
Some tips to improve your codes readability
January 25, 2013 @ 09:53:55

In this new post to his site Vinícius Krolow shares some tips he thinks will help to make your PHP code more readable in the long run.

What about code readability, from my point of view is one of the most important thing in the code. Who writes code that is easy to read, writes good code. Probably reading code is where you spent most part of your time, and not only your code, probably code of your team mates, or maybe code from the open source community, so write code that is simple and is easy to understand it's really important.

His tips (seven of them) are:

  • Comment before write your code (DocBlock)
  • Return frequently, Return early
  • Break, Continue
  • Code Standard / Name conventions
  • Throw Exception
  • Comment often, but not write stupid comments
  • Methods can be always smaller than they are

It's a little difficult to read as the English isn't the speaker's native tongue, but it gets the point across. He also recommends reading this if you'd like more information about writing better OOP code that's easier to read.

0 comments voice your opinion now!
code readability recommendations structure comments conventions


blog comments powered by Disqus

Similar Posts

ClearCode: Symfony - Project Tamed

Felix Geisendorfer's Blog: Test Driven Development in Real World Apps

Shawn Stratton's Blog: Code Readability, Part 1

Codeacy Blog: Your Greatest Code Quality Threats and How to Solve Them

Kevin van Zonneveld's Blog: Convert anything to Tree Structures in PHP


Community Events

Don't see your event here?
Let us know!


voicesoftheelephpant opinion library interview symfony2 api laravel performance framework version example xdebug community conference introduction php7 podcast series release extension

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework