Magento Development webinar
Thursday, 11 February 2010Last night (February 10th in our Dutch timezone) there was a webinar on Magento development, organized by Varien. The meeting was led by Koby Oz, but Anton Makarenko (Magento team) and Roy Ganor (Zend) took the technical presentations on them. Thanks you guys for these great talks. Here's a short reaction on the webinar.
Magento compliance
There are over 1700 extensions on the MagentoConnect website and without a doubt there is some ugly programming code to be found in some of these extensions. The webinar discussed the details of coding standards and in particular the Zend Framework coding standard. A coding standard guarantees that all the programmers write their code in the same dialect, which makes it easier to transfer the code from one programmer to another.
While the principle of open source itself prevents vendor-locking, the programming code itself can still be written in such a way that only the original programmer understands it. There for, open source itself is not the holy grail, but it is part of a strategy which also includes a proper coding standard.
Zend Framework and Zend Studio
The Magento coding standard is largely based on the Zend Framework coding standard. Magento as an application includes various Zend Framework classes, and its MVC-architecture is based on the Zend Framework architecture. The coding standards describes various things, like how many spaces should be used when creating an indent (yes, four) but also how third party classes should be named.
The webinar used the Zend Studio development environment to demonstrate the purpose (and practical use) of the Zend Framework standards. Using an IDE (like Zend Studio) is a matter of choice. Our lead developer uses the UNIX editor vi for most of the programming. Still, an IDE gives added value when a lot of code needs to be written. For instance, Zend Studio as well as the free Eclipse PDT includes a lot of short-cut functions to perform daily tasks: Generating a new PHP-class, adding phpDoc tags automatically, jumping up-and-down the code, looking up a specific class-name.
The Yireo coding standard
At Yireo we develop various extensions for both Joomla! and Magento, and this development on two different platforms poses up the simple problem which coding standard we have to follow. In general we answer this with: The coding standard that applies at that moment. Under Joomla! we apply the Joomla! coding standard and under Magento the Magento coding standard. Luckily these standards are very similar (unlike for instance the Drupal coding standard).
Apart from using the right coding standard (4-space-tabs, placing of curly braces, class-naming) we also comment a lot. Besides phpDoc tags for files, classes and methods, we also place extra comments within the code to make certain parts easier to read. This not only counts for our free extensions, but also for our commercial extensions: What we actually sell is open-source software, with which the customer gets full access to the source code. The principle would be worthless if the code is not readable anyway.
