Why do you need to create your own Magento developer toolbox?
Essentially, if you work from a standard toolbox and use best practices you can, to a certain degree, expect a persistent level of quality out of each application that you develop. For instance, if you know what the php code smells are, you can ensure better code quality. But what if the problem is not just the code, but how the application is set up?
A good point to consider when onboarding new developers, as knowing each tool required for the job will essentially train everyone on how to be more efficient at troubleshooting and resolving problems. More importantly, this will provide insights enabling them to enhance the applications to prevent these problems from happening.
I know every magento developer has its own toolbox and what they rely on to get the job done. I put extra emphasis to the debugging tools because I’m more of a performance junkie. I like to squeeze every ounce of performance out of the cpu, disk IO and memory from the system. I am also a fanatic of everything of the big 3PRE: preventing coding, preheating content and preloading code. More on this later.
I’m a Linux developer, so most of these tools are Unix based and focused but as you will see not all of them are OS dependent but instead Magento Bound.
Here are my top tools for every that in my opinion every magento developer toolbox should have:
The best way to explain what New Relic does is by simply saying xdebug meets Google Analytics but way better.
New relic should be the #1 tool in every developer’s toolbox although that doesn’t mean we shouldn’t use xdebug as well!!!
Without a doubt the best tool for debugging php code, it has also taught me more about magento and the Zend Framework than any book or tutorial I have read. You should also learn how to use strace and firephp in case xdebug is not available say in a live enviroment but you want to find out what the problem is.
My favorite settings by far in the xdebug configuration are scream and show_exception_trace.
I like my code to talk to me… after all we spent about 80% of our development time reading code. So what if your code could tell you what’s wrong? That’s why I love xdebug scream, because it disables php’s @ (shutup) for errors, warnings and notices, basically saying If something is fishy come tell me about it.
The reason show_exception_trace is one of my favorites is simply because if your application throws an exception which is caught you won’t ever know about it, well xdebug when configured to have this setting on will let you know.
Try running a Magento application with these settings on. You will find out so many issues that could be potentially slowing down your application. As a side note, don’t enable profiling and tracing, just set them as auto trigger and call the required functions to get that functionality.
You should also read about xdebug trace and profile. Trace and profile helped me decide whether to have GeoIP functionality inside Magento or in Nginx. I discovered, because of how the Magento app are organized, you must have the GeoIP functionality directly in the index.php which can really destroy your store performance.
If you are going to use xdebug in your magento developer toolbox, then you must have KCacheGrind or a similar application as it will be impossible for you to use the profiling capabilities.
My favorite part by far is looking at the function call percentage and how magento is spending time in areas where it should not.
It’s one of the best ways to understand what is going on with every page, now just recently Fabrizio Branca realeased an improved version which you can find here: Magento Profiler and let me tell you I tried it already and don’t know how I could have lived without it up to this point.
Like the Magento Profiler but it takes it a step further… because it will let you know pretty much everything that is going on in every page from the loaded collections to the xml driving the page. Commerce bug is extremely useful specially when debugging pages and you don’t know where to start. Let me tell you every beginner should have this tool installed during development.
Any Magento developer toolbox will be empty without vim… hands down the best text editor (sorry emacs) and one of the few you will find installed in most hosting providers. Vim is by far the most customizable editor and one of the most powerful tools overall.
Developing extensions for software that doesn’t allow you to separate your files from core files, and keeping that extension under version control and making it easy to deploy is now much, much easier. Development of this script was inspired by Magento which forces you to mix your extension files all throughout the core code directories. With modman, you can specify in a text file where you want your directories and files to be mapped to, and it will maintain symlinks for you so that your code is easy to hack and deploy.
Vagrant lowers development environment setup time, maximizes dev/prod parity, and makes the “works on my machine” excuse a relic of the past.
Developers no longer need to worry about setting up complicated infrastructure components. Projects with conflicting dependencies can each get their own sandbox — keeping a developer’s workstation free of the hacks needed for multiple versions of software to coexist.
Operations engineers can no longer need to worry about developers having a different local setup from production. They can experiment and test their configuration management changes before going live.
I vote we have a Git and Magento certification.
I will never deny my love/hate relationship with netbeans but all other IDEs are the wrong shape for my toolbox. Netbeans is slow and lacks some simple functionality like quick open files and its Git integration is mediocre at best. It doesn’t integrate with GitHub or Beanstalk either.
However Netbeans is awesome with mysql, phpdepend, mess detector and phpcp not to mention with php unit, zend framework and symphony. It is fantastic to customize and even develop modules for. I should remember that this is a Java IDE with a php addon. Other good options are PhpStorm, kdevelop, eclipse and vim.
Honorable mentions to:
If you don’t have Percona Toolkit in your magento developer toolbox I have to say that you don’t know much about your database server. You should invest some time into it.
I know Magento uses Selenium and it has TAF but try watir and you will know why it is so awesome. Watir made my magento developer toolbox way at the very beginning when I was learning ruby and wanted to do some automated real load testing…
The only security tool in that list is rats… but I like to think that detecting messy code and doing code reviews as security measures, you know keeping good standards and the human eye in the developers logic or you can just simply use Bastian Ike as your security advisor.
Honorable mentions to:
Yup, I consider the first 5 tools and not simply software I can use.
So what are yours?
Part 2 can be found here