I did not have time for a real post this week on Magento 2, so I thought I would replace it with a community question. I am personally interested in Magento community opinions as a litmus test to work out trends of Magento versus more general PHP community.
Reading http://www.matthias-zeis.com/archiv/magento-neuigkeiten-32 there was a comment that type hinting in PHP just missed the vote, so the current proposal was rejected. I was reflecting upon the importance of getting type hinting right in PHP for Magento.
If I was trolling I would ask a question like “Do you think Magento in the long term is a good fit for a programming language without good type hinting?” Personally, I do not. But I can never see Magento moving off PHP. So that is not the question I want to ask.
Magento (especially Magento 2) uses type hints in all around the place already using comments for the IDE to pick up. It makes autocompletion easier in the IDE and provides a form of structured documentation – it tells you what is expected and what to return.
So what is my real question then?
How important do you think it is for Magento to get type hinting into PHP?
Personally I think it would be a huge benefit. Not one that Magento could make use of for a few years (we need to support older versions of PHP for a while), but I am am definitely hoping it makes it into PHP 7.
I am not an expert on the PHP debates over type hinting, but I found http://marktrapp.com/blog/2015/02/08/php-type-hinting-rfc/ which talks a bit about potential problems with the current proposal. That is, it’s not type hinting that is bad, but there are problems with the proposed approach.
So what do you think? Do you think the type hinting proposals are important to get right for Magento?
Disclaimer: THIS POST IS COMPLETELY MY OPINIONS AND NOT THAT OF MY EMPLOYER. THERE ARE NO PLANS TO MOVE MAGENTO OFF PHP. THERE ARE NO PLANS TO FORK PHP TO ADD TYPE HINTING TO MAGENTO’S VERSION OF PHP. THERE ARE NO PLANS FOR OTHER CRAZY IDEAS. Internal focus is on getting Magento 2 shipped. Hopefully that is enough of a disclaimer to stop tweets such as “Alan thinks we should port Magento to Scala to get Scala type hinting into Magento”. (Hey, now there is an interesting idea…. 🙂