Jan17
PHP Needs an (Official) Style Guide
- posted by: Ryan
- no comments
- post a comment
Python’s strong tradition of pretty, easy-to-look at code is cemented in documents such as PEP 8 and other “Python Enhancement Proposals”, written and by members of the Python community. Other languages such as VB and C# tend to have an inherent cleanliness to them, and their user bases (and Microsoft) have created common opinions on what good code looks like.
But PHP isn’t so pretty – quite the opposite actually. Because of its structure, syntax, and other “features” beyond the scope of this blog post, it is all too easy to create spaghetti code in PHP. This is why the PHP community needs an *Official* style guide.
This can be incredibly important for PHP. Style guides do exist for the language – for example, various Open Source projects define their own style guides – but none are universal, to my knowledge at least.
Having an official style guide would help point the PHP community to a more central standard of what clean PHP code would look like, or at least help the beginner to intermediate PHP programmer write cleaner code that looks like other PHP code out there. It would also be easier to share code among the various code bases out there, too, and use publicly available code that already exists for your own or other projects. Everything would “fit” better.
Having an official standard would create an “ideal” code format, and help all PHP developers read and share code. Which for any language, is a good thing.

Leave a comment