Magento: Best development practices

Magento: Best development practices

At Hussey Coding (we develop and run Developer Connection in case you didn't know) we've had a wide range of clients come to us from all kinds of different places, including a good number who needed their store 'fixing'.  Invariably we've found that their store had been worked on by an inexperienced, lowest price developer found on other services.  Sounds great on paper doesn't it - the same work, but for a considerably lower cost?  Any store owner is going to be tempted by that, the problem is it ends up costing you more because ultimately you need to have that bad code fixed, or even built again the right way from scratch.  Ignoring it risks buggy functionality and difficulty upgrading to newer versions of Magento.

So why does lowest cost development work regularly end up giving you this end result of higher cost?  It's because the developer is very likely to not actually have the skills and experience required to properly work with Magento.  This means they won't be following best development practices and will end up getting the job done in whatever way they're able to find.  This often means following development advice from equally inexperienced devs on some online source in a blind leading the blind fashion.

The reality is that there is a lot involved in becoming a top Magento developer, and the potential for developing Magento badly if you don't follow best practices is very real.  The Magento framework is a hugely capable, fully-fledged tool which allows you to add any feature you want to your store.  But it also takes time and real-world hands-on experience to develop well.  It's such a capable framework there really is no limit to having your store look and function exactly as you need it to, in whatever form that takes.  When looking for a Magento developer for your store you should be looking for someone with the skills and experience to do the job well, and those are exactly the kind of developers you're going to find here on Developer Connection.  Finding a quality, experienced UK developer for your store at Developer Connection is always going to get your project off to a great start as they will have worked on many different stores over the course of years, will have dealt with huge numbers of different development scenarios and store builds, and will have the capacity to quickly understand your project requirements.  Finding the right developer is the start of building a strong, productive, long-lasting working relationship and that is key to the smooth running of the entire project.

What following best practices looks like

So what does it actually mean to follow best development practices as a Magento developer?  When the Magento framework was created, Magento themselves built in a lot of really effective means by which to safely alter and extend out of the box functionality.  In doing this they allow you to customise existing and add entirely new functionality in ways which ensure the best ongoing performance and upgradability of your store.  These methods also drastically reduce the possibility of things like the functionality of one extension conflicting with the functionality of another extension and therefore ensuring bug-free running for the lifetime of the store, even if it's being constantly developed.

However, the developer can of course choose to follow, or disregard these best practices.  If they choose to disregard them, even though everything can look fine on the surface, the issues that can be introduced can range from severe (like totally breaking the upgrade path for the store) to still significant but more subtle to detect.  The Magento framework is highly abstracted meaning there are many layers of functionality on top of each other to a great depth.  Understanding and being able to navigate this abstraction is certainly not an issue for any experienced Magento developer, but can be extremely confusing for someone new and inexperienced with the framework.  Developers like this often end up landing on a solution to a problem dealing only with one of the surface layers where actually the solution should have been implemented in one of the abstracted layers where the actual functionality used by the surface later resides.  So I would never expect a developer who worked on any Magento store to have malicious intent, they will be working to the best of their ability with good intentions, but the resulting bad practices are instead borne out of a lack of understanding that comes with insufficient experience developing Magento.  That's why you should be using the more experienced developers you can find at Developer Connection.

Here's an example of a severe issue that could be introduced by bad development practices.  Magento has an order of precedence in how it loads PHP files, and the best development practice methods Magento supply feed into this. Using the best practices allows you to alter default Magento functionality in an effective, yet upgrade friendly way.  There is however a wrong way in which you can achieve the same result as this by putting the PHP file you want to change into a particular folder instead - the lib/internal/ folder.  By doing this you will happily be able to customise built-in behaviour as extensively as you need and everything will function fine.  The problem however with this is that you have just broken the store upgrade path.  On upgrading Magento, regularly large numbers of PHP files change, but by having moved certain Magento files into the lib/internal/ folder before, you will still be running the old version of the file.  If something has changed in that file in the upgraded Magento version there is a very real possibility that functionality is now broken.

This is an example of a more subtle issue introduced by bad development practices. Magento uses a particular method to load page styling.  Historically this was done with multiple individual styling files which were loaded separately with each page.  While this works absolutely fine and the site will look correct, doing it this way does affect performance.  Magento works differently as it allows you to work with a different type of file to add styling to the store.  There can be as many of these files as you need, and they all get combined into one styling file which is loaded by the browser.  This makes for fewer required files on page load and therefore improves performance.  It is however still possible to do it the 'old' way so the less experienced dev may miss the new improved way and by doing it the old way introduce a performance issue.


There are countless other examples I could give and these are just a couple, but hopefully they demonstrate how a store can be developed badly despite everything appearing to be fine.  The difficult thing here for the store owner is that issues like this which are introduced by not developing to best practices are not obvious or really identifiable by a non-developer until something breaks later down the line.  This is an example of the kind of situation where the store owner ends up with a badly developed store which they later then have to go to an experienced developer to fix.  This ends up costing more overall as the experienced developer then has to undo the bad changes in order to recreate them correctly, and this is why Magento development work needs to be done right the first time.

The unfortunate reality is that Magento developers found on other services often fall short when it comes to following best practices purely through lack of skills and experience in Magento development.

Getting your store developed using best practices should be a top priority for every store owner and Developer Connection is an indispensable option to allow you to do that.  So create your project with us today to find a great Magento developer, or if you're an experienced Magento developer yourself subscribe now to offer your services.