![]() |
|
PHP best practice - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: PHP (https://sinister.li/Forum-PHP) +--- Thread: PHP best practice (/Thread-PHP-best-practice) |
PHP best practice - unixbreak - 11-16-2012 Low carb PHP: No spaghetti PHPDoc: comments are your friends Game on: Throwing, catching and handling errors Users are stupid: Parsing input and escaping output Start on the right track and clean up your own mess: Initialising and destroying variables correctly Guess the magic number: Using constants Programmers are stupid: Version control can save your life Code reuse? No thanks, I have plenty of free time PHP Karma: Write code you would like to maintain Securing your job through obscurity: Why to write 3 lines of completely unreadable code when it would be easy to maintain in 5 lines The wheel wasn't good enough: How to waste time by rewriting code Codewithnopunctuationorappropriateuseofwhitespace isreallyhard tocomprehend Coders are from Mars, designers are from Venus: Why structure and presentation should be separated in PHP (you won't see John Gray write that one!) The 7 Habits of successful PHP developers: Test, test, test, test, test, test (get the joke?) RE: PHP best practice - The 7th Sage - 11-24-2012 (11-16-2012, 08:48 PM)unixbreak Wrote: The wheel wasn't good enough: How to waste time by rewriting code Amen. I think thats what keeps PHP or other web languages going. There are so many classes out there but some "wheels" don't suit your needs or just aren't very good for your "vehicle" (web application). Also what do you mean by version control? Quote:Programmers are stupid: Version control can save your life RE: PHP best practice - unixbreak - 11-24-2012 [b]version control > VCS VCS systems will -Keep your code base in a remote place. -Split off code to work on. -Track changes as you make them. -Commit changes as you work. -Merge your modified code back into the base in an orderly manner. example of VCS: Mercurial - I actually use this to keep my entire website in version control on the host. Its quite easy to setup on any webserver that has python. You can also copy and paste your own build. Git - I tried and failed to get this working on Godaddy. However if your just going to be doing it locally its still a respectable option. In the Mercurial VS Git debate, it just depends on what you prefer Subversion - Completely different from the above. I've never tried to keep a website in svn, but it is an option. Really though I would recommend this. |