OK, Lately I GET why “real” developers don’t like PHP

In December I started work on a client site that was a “custom theme”. In fact, it was just a hacked premium theme where all of the identification had been obscured. Worse for me, my staging site copy of the site failed on my server. Why? Ugh, all of the custom PHP was coded with <? and <?= instead of <?php. I had to enable shortcodes in my php.ini in order for the site to work.

Yesterday, I worked on an account where the client had signed up an eLance, now Upwork to build his site. Again the bofo “developer” had simply hacked a commercial theme he had bought. Yep, that is OK because after all, by license, all WordPress Themes are Open Source, even if you have to buy a copy to begin with hehe 😉 . Ah what an ugly beast it was:

hacked wordpress theme website

 

And then today, I’m reviewing a PHP CRUD tutorial and I find this in the code:

<?= $_SOMECONSTANT ?>

Yeah, I know that it is theoretically OK according to the PHP manual to use short code for <?php echo $_SOMECONSTANT ?>. But really is that best practice in a tutorial?

question best php practice shortcode

NOT IMHO 🙂