Who is here? 1 guest(s)
 Print Thread
PHP - Best Practises
NetriX
Excellent post on This interests me: A collection of useful best practices in modern PHP development, like

  1. Redirecting the user via header() after a form submit (to prevent resubmitting POST data)
  2. Getting rid of the outdated mysql_* functions
  3. PSR-styles, like not closing PHP tags
  4. Anti-XSS
  5. DRY coding
  6. separating application logic and output
  7. using prepared statements instead of old-school mySQL queries
  8. using try/catch instead of die() and exit()
  9. working with git
  10. caching
  11. design patterns
  12. utf-8
  13. learning to love and use frameworks
  14. security
  15. application testing
  16. documentation
  17. server-side validation
  18. error reporting

and much more ? This post will lift your development level dramatically. There?s a lot of stuff that could be added (like writing code that perfectly fits the PSR-guidelines, or Composer, or Vagrant), but in general the information given is extremely useful. Bookmark!
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Sun-Wed. Send me a PM if urgent.
 
PeaceLaced
Thank you for this. I will be going through it today.
 
JoiNNN
Good read, sad that we don't follow many of the guidelines described in Fusion development.
 
skpacman
Those are very good practices but several of them I don't follow because I don't know how they work. I'm a self-taught PHP coder with very little experience or formal training. I learned by hacking apart other's code and learning how to do the things I wanted by myself.

If I had formal training or any kind of schooling, I'm sure I could follow those. I'm doing good to get done what I can with the (limited) skills I have.

There are 10 kinds of people in this world.
Those who understand binary,
and those who don't...
 
Jump to Forum: