Guide to Programming with MagentoToday, I’ll be reviewing php|architect’s Guide to Programming Magento by Mark Kimsal. Magento is a relatively new open-source e-commerce application written in PHP with a MySQL back. All in all, the Magento package is an impressive application with great administrative features and a flashy user interface. But under the hood, Magento is a complicated piece of machinery. At the very least, it’s definitely not for the faint of heart. So in order to navigate this maze of XML layout files, multiple template and style directories and the EAV database schema, we purchased Mark Kimsal’s Magento programming book. Find out what we thought of it, after the jump.

At first glance of the index, I got warm fuzzies all over. File hierarchy layout, EAV schema and custom module development…who wouldn’t feel a little happy? However, I’m not really the type of person to give accolades unless something is absolutely stellar. As such, this post will primarily be about the shortcomings of the book.

As developers, one of the most important things we’re interested in with a new software package is how we can modify, hack and expand it to suit our needs. Let me be the first to tell you, the Magento devs did not have this in mind when building their code base. While Kimsal devotes four chapters to module development, at the end of it all, I still didn’t feel like I had the foundation necessary to construct a robust expansion module from scratch. Kimsal does go into detail about the files and contents you’ll need to fit within the Magento/Zend model, but his examples seem to only expand or override functionality already present in the Magento core modules, rather than creating something completely from scratch. About the closest he comes to a completely custom module is the “Points and Rewards Module” chapter. However, the construction of a completely custom module seems so complex that Kimsal either does not include all the finer nuances or simply cannot coherently describe its creation—a sign that does not particularly bode well.

Reading the book also gave me the distinct impression that an actual editor was somehow left out of the loop as the book was rife with grammar and spelling errors. Another annoying attribute is that code continually runs from page to page with no clear delineation or separation. Code and list segments span multiple page breaks, something that of course sometimes cannot be helped, but when you have 11 lines of code on one page with the remaining “</div>” as the only line of code on the next…it gets a little annoying (page 126-127 if you’re interested).

Now, I understand that Magento is very new (as of this post, I think Mr. Kimsal’s book is the only one available [and we have the pre-order PDF of the book, still waiting on the actual book to arrive—Ed.]), but I think that the first book in any series should try to include some sort of reference for at least the most important classes, methods and in the case of Magento, obscure XML tags and attributes. For instance, in the chapter about templating and layouts, Kimsal gives brief descriptions about what the tag names are but lacks any meaningful detail about how to use them and how they interact with other tags (see my previous blog about examples in documentation).

Technical books typically strive to factually explain the topics they cover. Something I found a little interesting was that Kimsal gave negative conjecture at random places in regard to how Magento does certain tasks. I personally find it amusing but some people may not. However, if you’re going to rag on how the subject of your book does things, consider suggesting a better alternative or publish some code to correct the problem. Just a thought.

Finally, you know you might be in trouble when the very last question in the book’s final chapter “Quick Answers to Common Questions,” states, “I give up! Magento is too confusing.” And what pray tell, be Kimsal’s response? ”I hear you…”

A bit half-baked but that could be a condition of what happens when you work to be first-to-market with resource material and it doesn’t help that Magento is no small, simple beast itself. We’ll take a look at any other books that come along and let you know how they stack up.

Posted in: Development, Reviews