This year Manchester’s Comedy Store hosted the first ever Magento Titans conference. The event saw the most talented developers from Manchester – and indeed around the wider world – gather to share some knowledge about the world’s best ecommerce platform.
This was billed as the best line-up of speakers ever seen at a Magento event – and it didn’t disappoint.
This is the first in a series of posts where I will break down what each speaker talked about. Up first was Vinai Kopp speaking about the “Beautiful Magento Module”:
According to Vinai, every Magento module should adhere to the following principles:
- Provides Business Value
- Magento can be upgraded without breaking the module
- It’s easy to understand and modify
- It has good test coverage
- Is free of bugs
He goes on to speak about “design patterns”, which are very useful things for developers to learn. Using design patterns results in code that is flexible to changes and is easily maintainable. Design patterns also encourage encapsulation which in turn isolates different concerns making modules easier to work with.
Another great point mentioned in this session was about adhering to coding standards. Not everyone is a big fan of writing code the Magento way, but it is important we all follow the standard. This will make it easier for the next developer and indeed yourself to know where to find what you are looking for in your module. It also makes debugging issues and identifying conflicts a much easier process. I have also seen bad practice being used often in the front end, with developers not following Magento’s template structure.
Vinai also spoke about writing readable code. If your code isn’t readable and self-describing, future developers will struggle to understand what’s going on. Here at PushON we meticulously review every module’s code before we use it. If it’s not easily readable and we don’t fully understand what the code is doing, we never use it.
For me personally the most important point of the session was using Observers instead of rewriting core classes. It’s good practice to make use of Magento’s event-driven architecture. As developers we need to be aware that other resources may need to make use of that same class we are rewriting. Rewriting classes with little thought usually leads to conflicts.
That’s it for the first topic in this series. A big thank you goes to Vinai for sharing all this with us. Follow him on Twitter for more Magento expertise. Please do leave a comment and look out for the next article.
I’m already looking forward to next year’s conference.