branko ajzele, senior developer / project manager

Posts / Articles

What makes Magento so hard to learn

Most of us in ecommerce application development have already heard of Magento. Some would call it new ecommerce killer app. I myself stand with that statement for many of reasons. However I would like to call it with one more name, developer killer app. This developer killer is what I literally had in mind. Magento is currently one of the most difficult PHP systems out there a developer could learn and master.

So, what exactly makes Magento so hard? Short answer would be the lack of good, and I mean really good IDE studio. You know, like the one .Net guys and girls have, something like Visual Studio. Yea, here I go again giving praises to Visual Studio and monopolistic Microsoft although I make my living using open source PHP. I should really be a shame, right? Well, no!

Let me elaborate further. Magento is true example of PHP object oriented power. It is built on object oriented concepts from ground up. This is what makes him cool, flexible and crappy. Yea, you heard me, I said crappy. Since there is no open source IDE or even commercial one that can loop trough entire Magento directories and grab all those classes and their methods you’re doomed. Irony in all of this is that is not Magento’s fault at all. However, developer is left on the mercy of good old Find All command in his favorite editor to loop trough all Magento files in order to find classes and their methods. What I expect from IDE studio is to write something like

$this->

and to get the list of all the available methods. This way I don’t need to keep track of the objects context, that’s left for my IDE to take care of. This little thing can save you hours and hours of development and debugging.

Try opening, let’s say /app/design/frontend/default/default/template/catalog/product/view.phtml file and writing down something like

$object = new Varien_Object();
var_dump($object);

Whatever IDE you use, none of them won’t give you class list when you get to

$object = new

part. Basically it’s up to you to memorize all the class names you are to use in your development. Creating an instance of Varien_Object class is probably something you won’t do, however I hope you understand what I’m trying to say. Magento is massive, it comes with over 5000 files. There are over 2700 files in /app/code/core/Mage/ folder. Am I to loop trough all of those in order to get to know which class and function lies where? I don’t think so.

Object oriented programming is no holly grail, no rocket science it all about creating object instances, running methods on those instances and getting or setting instance properties. And that’s it! This however is what makes Magento so hard to learn. In small applications with just a few classes thrown around few files, it easy to grab you’re favorite text editor and do some magic. In Magento, this approach is useless. So where does this leave us? The way I see it, developer has two options.

Option number one is to stick with poor Magento Wiki and Magento Forum in hope to find useful information needed to develop or expand some Magento functionality or template. This however always leaves you one step behind competition using the same Magento in providing client services.

Option number two is to master the OOP in Magento, pick up the classes, their public methods and properties. Grab a peace of paper and you’re favorite text editor and search for major classes representing stuff like Product, Catalog, Image and so on. Then you draw some nice diagram giving you’re self some visual representation of entire system. This way you will be able to do that little step further and start writing you’re own classes by extending the existing ones.

This may seem like a tedious and time required task to do but until some ultra smart code completion support does not come out in some of the PHP IDE you’re basically left on you’re own.

I consider my self good at understanding and coding with OOP in PHP. I’m just having problems connecting those dots in Magento system cause it’s all so scattered around and my IDE has no clue about it. Don’t know about you guys and girls, but this fact drives me crazy.

View Comments

  1. Lee Saferite /

    Ok, so I call baloney. I use Eclipse/PDT every day for PHP development and lately every day has been Magento development. I can easily go into any hph source file, be it .php or .phtml, and type ‘$object = new ‘ then hit Ctrl-Space and bang, every class that is in my project is listed. Every one. AND. If I’m on a something (variable, method, etc) that Eclipse knows what it is and I hit F3, it takes me to the relevent code. So, if I’m in an class definition and I put my cursor on the exteds class name and hit F3, suddenly Eclipse takes me to the relevent class file.

    Now, Magento development being hard is a whole other ball of wax. They have no (useful) documentation, they use so much voodoo you can never be sure exactly what is going on, and they don’t really provide much programming help on the forums. Personally, I hate how hard it is. But, it is providing a huge head start for our code, so I live with it.

  2. we will see that kind of IDE when one company see that as an opportunity and use the Magento concept when working with OOP and EAV.

    also, the most fatal problem for developer who learn Magento is lack of documentation.. the company didn’t provide the technical answer because they just use Magento as marketing tools for their service. So the future for open source ‘Magento’ developers is depends on us to update and share the knowledge using Magento Wiki.

  3. I totally agree with you on the lack of documentation part. I would just like to see independent Magento Wiki, HOWTO, tutorials, vidocasts… site :)

  4. indie kid /

    Magento rocks…it’s just that you guys are noobs and don’t realize the full potential of it

  5. Two things…

    First, this is first and last comment hiding behind alias name I’ll approve on my site.

    Second, I have never said that Magento is bad or that it does not “rock”. This article has nothing to do with being newbie or expert (and I’m no newbie, thank you), it’s about applying something in business. Magento sucks when it comes to documentation. Learning curve is terrible. And that’s it.

    There is nothing cool and expert in spending hours going trough functions figuring out which one does what. Development should not be focused on hacking the existing underlying system. PHP community needs to learn the importance of documenting their work.

    Magento is more than great software. It’s true proof of OOP in PHP, but it still sucks when it comes to documentation. Try looking ad Microsoft SDK, or jQuery online documentation, maybe you’ll understand what I’m talking about.

    Don’t know about you, but I sure would like to have some CHM file with all the classes, methods and their parameters listed with example or two.

  6. You’re the Man Branko. Thanks for all your information, This is a great blog!

  7. Dinesh /

    Hello

    Is there any free PHP programming guide for Magento.

  8. Yes there is :)

    And here it is http://framework.zend.com. Magento utilizes full power of PHP’s object oriented programing and it’s built on top of Zend Framework. To fully grasp the power Magento you need to master the usage of Zend framework. Since Zend is long time on the market, it’s community is large and they have a lot of tutorials and videocasts. It helped me :)

  9. Pointlessjon /

    word. On a side note, I’ve never even attempted utilizing an IDE so I’m used to these terrible learning curves and poor documentation. However, I think it’s time to start. Netbeans pretty rad?

  10. Not sure if you meant Rapid Application Development or just Radical by “rad” :)

    Anyway, I’m using it on daily basis now, the 6.5 version (nightly builds). Sometimes it gives me such a headaches because of the interface “speed” and bugs, but you get use to it. Beats the notepad editor :)

  11. Branko, good post. I hear your frustration, particularly with documentation.

    If you can’t get your IDE to work as it should a suitable alternative IMO is to load Magento files into *NIX environment to which you have shell access and can grep (it’s how I started). This kind of manual, low-level exposure to files can actually benefit one’s understanding of how Magento works.

  12. Hi,
    Regarding IDE: http://ondemand.yoxos.com/geteclipse/start
    customize and build your own eclipse IDE.

    Magento Background:
    1 finished store (retail), preparing launch of a second (retail+wholesale), also working on a 3rd(corp/retail/retail/wholesale).

    Data:
    Item database ranges from 300 – 18,000 products.
    Documentation: Sparse,
    Community Forums, docs.magentocommerce.com and good old figuring it out is whats key here.

    Recommendation:
    Installing and creating your own module will help you gain a considerable amount of knowledge regarding the system.

    Starting Point:
    app/frontend/interface/theme/layout/*.xml and understand the contents of those control files and how they control/load/reference the information you seek. The Block location tells you exactly what model you are using. The template shows you exactly the template for view.
    Keep in mind.
    skin/* contains the mirroring images/css/js.

    The rest is time, understanding what you are trying to do, and knowing what is available.

  13. Hi Josh… I appreciate the comment, however it’s been a while since I wrote this post :)

    I’d like to believe I’ve made some progress concerning Magento :) Since I’m actively working on Magento developemnt for the last 2 months every day :)

    As a starting point I would suggest one thing: Zend Framework. Until one manages to put some simple app in Zend, then there is no point in going with Magento module development.

    Cheers…

  14. Regarding IDE… there is NO IDE on that can track all of the object context across Magento, or Zend or any other framework in PHP. I found NetBeans6.5 far more better than eclipse due to excelent XHTML features and PHP… The thing I like the most at eclipse is the Zip archive download, just place it on USB stick and your portable.

  15. Great Blog, I am glad I read through this, I was just about ready to try Magento, I think it would be way over my skills. Anyone have a alternative suggestion on other website building software, but ease to use, for a new guy.

  16. Hi Branko,
    Indeed its been some time. I started back in February.
    The only two carts I am playing with are Prestashop/Magento.
    Allen,
    I would argue from a “user end” that Prestashop is a bit more intuitive to users from a management point of view.
    The overhead in configuring Magento is rather high. If you need multiple shop processing and some relatively advanced shopping rules, Magento is the way to go.

  17. I agree on the Visual Studio thing, Microsoft has this killer app that everyone tries to match up with, but Visual Studio still leads the way!

    On Magento, well, I would say that, Magento is a BADLY DESIGNED software. At first sight, it looks sweet, but the reality is that Magento is built so badly that experienced developers have a hard time making modifications.

    The heart of such a complex system is a good documentation. They do not have any such documentation – the screencasts are lately becoming outdated and they only covered some basic aspects of magento anyway.

    I hope they can come up with a documentation like MSDN – detailing every class and each of it’s methods and properties with example!

    For me, Magento sucks! because I am in hell these days thanks to a Magento based project I am working on right now!

  18. I strongly believe that the “lack” of documentation is on purpose… or shall I say planned. They seem to be building their business on providing support which they charge pretty well. I really have nothing against this model. They gave a world an excellent product it’s up to us developers now to… learn :)

    Something like.. ok, we’ll make our money on customer service while the community learns and builds documentation… one day… which by the way… will not be overnight. Since it really takes dedication, experience, and hard work to get the best out of Magento as developer. To be honest, I still freak out on each special request customer may have. Luckily, they manage to cover a lot of functionality in base installation.

  19. Unirgy /

    Branko: If you could get hold of ZendStudio IDE 5.5 (before they went Eclipse) – it handled pretty well the class structure of Magento.

  20. Kaleem Mohammed /

    Hi Branko,

    Reading your post made be think that you are actually posting my views on Magento.

    It has been just couple weeks working with Magento and all I was trying to do is setup a development environment using a good IDE so that I could better understand its architecture. Although screencasts from Magento site did help me in tweaking presentation layer, there wasn’t any help in getting to the core API structure.

    After attempting to collect information from Magento forums all I found is that there are so many others like us seeking for some help in setting up development environment. The only response from Magento team was that they use ZendStudio.

    It would be nice to know if any of you have succeeded in setting up a proper development environment. It would be a great help to learn from your success story in overcoming these frustrations.

    Happy Coding!

  21. “Object oriented programming is no holly grail, no rocket science it all about creating object instances, running methods on those instances and getting or setting instance properties. And that’s it!”

    Yeah all those guys like Grady Booch didn’t know what they were talking about

  22. Josh, I appreciate the comment but I don’t appreciate when some people take some things out of the concept and present them like something else. Like you did by quoting me in the comment above. Let me repeat it one more time…

    “Object oriented programming is no holly grail, no rocket science…”. The way i see it, biggest problem with OOP is the application design (architecture), because whatever you do, you are never quite there yet… Understanding OOP principles (at least those of languages like PHP) is simply matter of time and will and average sanity.

    That said, this post is written few months ago, when I was starting out with Magento. If you take a massiveness of Magento application and PHP’s loose typing characteristics of a language, then explain it to me how easy can be memorizing tens or hundreds of classes and methods to get you around since even the best IDE solutions cant cope with connecting the dots to do a decent code completion. Not to mention complete nonexistence of decent debugging solutions.

    Once again, I appreciate the comment, but plese think before you trash someone.

    Wish you all the best… Cheers.

  23. Lee Saferite /

    Ok, so I call baloney. I use Eclipse/PDT every day for PHP development and lately every day has been Magento development. I can easily go into any hph source file, be it .php or .phtml, and type '$object = new ' then hit Ctrl-Space and bang, every class that is in my project is listed. Every one. AND. If I'm on a something (variable, method, etc) that Eclipse knows what it is and I hit F3, it takes me to the relevent code. So, if I'm in an class definition and I put my cursor on the exteds class name and hit F3, suddenly Eclipse takes me to the relevent class file.

    Now, Magento development being hard is a whole other ball of wax. They have no (useful) documentation, they use so much voodoo you can never be sure exactly what is going on, and they don't really provide much programming help on the forums. Personally, I hate how hard it is. But, it is providing a huge head start for our code, so I live with it.

Trackbacks/Pingbacks

  1. Magento Crashing Apache on WinXP XAMPP with PDO Enabled « Mike Smullin - [...] been using it for years. Something bigger is definitely going on here, because my Eclipse PDT 3.2 IDE was ...
blog comments powered by Disqus