Skip to content

Practices

For best practices in PHP, please refer to:

PHP The Right Way

PHP Best Practices - though it is not using PHP 7

PHP Fig

And here are some highlights:

RTFM

Read the ******* Manual

We are blessed with a very well documented language

But don't read the comments! - the comments are user contributed, often very old or out of date and perhaps incorrect.

Use the most recent PHP version possible. It is always better, faster and more secure

PHP7 is great, use it everywhere possible. Don't be afraid of writing backwards incompatible PHP7 code

Use the best IDE possible

We use PHPstorm with some choice extensions

Always develop on Linux

Developing on a windows filesystem will cause you pain. Linux is freely available and much better

By all means buy a mac if you are into that kind of thing, but because Edmonds Commerce uses LXC which, like many great things, is Linux only - then that is what you should learn if you want to work with us.

Code must be readable and understandable which makes it maintainable

Clever obtuse code is never a good thing

Don't recreate built in functionality.

Don't make you own 30 line function that could have been replaced with str_pad. Learn the PHP Functions, especially array and string functions.

Learn about and use the Standard PHP Library (SPL)