4 Awesome Tips For Magento Developers To Code Beautifully

No wonder! The designers and developers community appear to be obsessed with the lists of tips and tricks on the Internet. For a professional developer, the pure aesthetic of good coding starts by writing something which other people find it easy to read.

If you are an experienced and passionate developer, you will take pride in the source code you’ve produced. Because, creating a clean website which functions properly and is to specification, will be the ultimate goal of your daily routine. But then, writing such clean code requires extra efforts and patience, short cuts may raise your temptation to meet your looming project deadlines and that’s the time when the things may go wrong.

Here, I would like to share some of the best and cool Magento tips for the Magento developers that can help you become a geek. Though these tips are specifically geared for the back-end developers, front end coders can also benefit when they get stuck into back end coding to fulfill the client’s demands.

1.Use Generic Magento Classes

The CSS classes are split into thousands of classes which are defined within the default Magento instillation. With the increasing popularity of Magento extensions and other tons of robust and amazing features relying on these generic CSS classes, it’s always a more dependable option to use generic Magento CSS where possible to ensure lesser or none compatibility issues when it comes to future installs.

2.Do Your Own Documentation

There’s no second thought to it – a good developer will always document his own code and keep a record of it for future references. It is the best practice to do your documentation on your own because you can rely on what you actually own and what you actually know. Developers working for a company will have them automatically backed up. This doesn’t mean you should rely on them, though as you document your own code, it will be useful to look for the improvements in it for future.

3.For overriding core files, Use app/code/local/Mage

It is not recommended to override the core files in App/Code/Local/Mage. Why? Because, it can prove to be problematic to you in the future when you’d want to upgrade the Magento theme or version. You will need to check each and every override and compare them with the new set of core files. This will definitely take a lot of time and it will be an exhausting job if you’ve used a lot of overrides.

4.Logging The Behaviour Of Extensions

If you want to assess the benefits availed from the Magento extensions you’ve installed, you need to log its behaviour. For doing this, you’ll have to log in to the admin > system > configuration > developer > debug and you can use your own log with code. Following this path, you’ll need a small and simple snippet of code to log in.

Mage::log(‘There was a bug’, null, ‘log_filename.log’);

By having a log of the behaviour of Magento extensions, you’ll be able to locate any issues quickly and easily.

Do you have other tips which you’d like to share with the Magento developer community? Please leave your comments below and spread the word!

Leave a Reply