Best Practices

The 93digital's best practices are the result of constant improvements taken over the years and the collaboration of developers with different skillsets and knowledge.

While everything moves fast and becomes relativly old quickly, we're not chasing the latest features or tools, but also we cannot settle on what we have forever. So for these reasons, some aspect of our BP are a solid foundation and will rarely change over time; others are the result of experiments, discovery and testing.

The aim of our BP is to:

  1. Have consistent coding style and conventions across PHP/JS/CSS
  2. Improve code maintenance, extenstability and interoperability
  3. Reduce the number of bugs
  4. Make code easier to understand

All code in any code-base should look like a single person typed it, no matter how many people contributed. – Principles of Writing Consistent, Idiomatic JavaScript

Philosophy

Our goal is to make the development fun

At 93digital we think development should be fun, this helps us stay motivated and curious about learning and experimenting with new technologies. These best practices outline how we approach our day-to-day development.

1. Analyse and subdivide your problem

Divide et impera (dīvide et imperā)

Usually trying to solve the entire problem in one go is never a good idea as you could miss something essential or entirely misunderstand the problem. In both cases, this could result in wasted time.

So, when facing a problem don't jump straight in but instead spend some time to analyse it, and, if possible, split it (divide) into smaller pieces.

Spend some time on it, read the scope document and ask questions that clear any doubts you have. After subdividing the problem into smaller pieces and finding a solution for each of them, don't lose sight of the bigger picture you're solving.

2. Speak with your colleagues

Coding is not a competition. It's about sharing our experience and improving our knowledge as developers.

When you are facing new problems, having doubts or struggling to find a solution, don't waste time trying to figuring it out, communicate with your colleagues. They have probably already experienced the same problem and they can give you a different, fresh point of view. It could even become more evident to yourself just by discussing it.

Remember: Teamwork is about sharing and supporting each other, so the more you share, the more you learn.

4. Don't reinvent the wheel

Code using the KISS principle.

KISS Principle

Keep it simple, stupid.

Custom code might solve the problem but can be a poor use of time. When possible and viable, consider using 3rd party PHP or JavaScript libraries.