Disclaimer: This collection was published a few years ago on my blog, it was met with heavy criticism about featuring micro-optimiziations which have little to no effect at all compared to other things you can do which was then and is still today very true ![]()
As this was copied & published on a few hundred blogs in the aftermath here again the original list exactly as I published it many years ago.
I will follow up shortly with an article on more effective methods. Until then …
This is something I prefer to call my “programming list of shame”. Although having a formal university education with courses on software engineering, enterprise software architecture & database design I have been guilty of every single one of those things at one time or another. This is completely subjective & Eclipse oriented.
You are a lousy PHP programmer if you
- don’t comment your code properly with something like phpDoc2. don’t see the need and/or benefits of a good programming IDE like Zend Studio or Eclipse PDT3. have never used some form of version control like Subclipse4. don’t adopt some coding & naming standards and general conventions and stick to to them at least throughout the project5. don’t use a consistent methodology6. don’t escape and/or validate properly input or sql queries7. don’t plan your application thoroughly before starting to code8. don’t use test-driven development9. don’t program & test with error reporting on10. don’t see the benefits of a debugger11. don’t refactor your code12. don’t keep the different layers seperated using something like MVC13. don’t know what these stand for: KISS, DRY, MVC, OOP, REST14. don’t return content but echo or print it from your functions or classes15. have never seen the advantage of unit tests or testing in general16. return HTML, not data, strings, or objects.17. hard code messages and configuration parameters18. don’t optimize your sql queries19. don’t use __autoload20. don’t allow intelligent error handling21. use $_GET instead of $_POST for any destructive actions22. don’t know how to use regular expressions23. you’ve never heard of sql injection or cross-site scripting24. don’t allow simple configuration, can be parameters passed to a class’s constructor, set/get methods called later, or constants defined at a runtime.25. don’t understand the benefits and limitations of Object Oriented Programming26. misuse OOP / everything you write , no matter how small is OOP27. you think reusable software equals/requires your code to be OOP28. don’t choose intelligent defaults29. don’t have one single configuration file30. don’t want the file contents to be seen, but give it a .inc extension instead of .php31. don’t use a database abstraction layer32. don’t keep it DRY, Don’t repeat yourself. If you have to copy and paste or duplicate something your design may be off.33. don’t make a function/class/method do just one thing and don’t make them interact.34. don’t try to take advantage of OOP specific features like abstract/interface classes, inheritage polymorphism & access modifiers.35. don’t optimize your application design with established design patterns36. don’t allow your user to define a base directory if you have multiple files and/or directories37. pollute the global namespace, one option is to prefix the functions in your library with a common string38. don’t allow a table prefix when using database tables39. use a separate template engine40. don’t take a look at established php frameworks for inspiration, most of them have advanced web dev concepts and good code.
Post From:
http://reinholdweber.com/2012/04/13/40-signs-you-really-are-a-lousy-php-programmer/
test