PHP Frameworks Suck

It’s kind of funny. After trying to understand Zend 2, I decided that I was happier with Core PHP. I noticed that anyone can pick up any framework and learn it in a few days, or even a few weeks, but to master it, you really need to spend a lot of time with it. I’ve spent 11+ years with PHP at the time of this writing. I know PHP.

Why have any framework? For most do it yourself type projects, just build a website from the ground up. You already have 4 great layers (Apache or server, MySQL or Database, PHP or backend language, and HTML, CSS, JS all in one). This looks like a LAMP stack to me. Why do I like keeping it this simple? Well, you don’t “need” anything else. Really. This is all you need to build anything. And I do mean, ANYTHING! You name your project, and i can build it.

My only caveat is jQuery. I’ve gotten used to it over the years, and in a way I wish I could go back to plain JS. I mean, for the most part, I still use JS, I just use jQuery for selectors / DOM manipulation, events, and the ever so simple to use ajax function. The main reason I use jQuery is because, otherwise, I would just write my own functions to do all these things. jQuery just makes sense to use.

My next task is to convert all my jQuery into JS at some point. Why? Because that’s what the browsers understand. The browsers don’t understand jQuery, or angular, or LESS or SASS on their own. They need pre-processors and libraries to convert all that.

This brings me to my other point. The backend should be no different. PHP is what is already installed on the server. Running PHP code in your files speaks directly to the PHP installation on Apache. You don’t need additional overhead to make things work better. Write PHP, done. You can structure your PHP in logical functions to make it work for you, such as getMeSomeData(), or renderThisHtmlBlock(). But that’s it. At its core, PHP is a great and most opened and powerful framework of all. Why add so many layers of abstraction on top of it?

My next good practice is to write MySQL directly into my php code. Why not? That’s the fastest processing you’re ever going to get without involving overhead. Use propell? Why? Just so you can stack php functions that eventually build out what you meant to say with MySQL anyway? Again, more layers of abstraction? What’s the point? Because it doesn’t “LOOK” like SQL? Is that really a valid excuse? Learn some damn MySQL like a good programmer, and remove all those PHP overhead functions to keep your site optimal.

It’s not what you use, it’s how you use it. Developers have become so lazy over the years, and no one cares about code itself. They treat it like they’re bored of it and just need to add layers of complexity.

The only thing that matters is how the client side performs. All of my projects’ pages load faster than 2 seconds, out of which most load under 1 second. In the end, that’s what matters. And, the turnaround time for most of my development is minutes, not days like most projects dependent on builds.

And I simply don’t want to discuss things like memcached, composer, ruby (for SASS), or any other dependency that’s simply not necessary. Are your websites fast? Then, that’s what matters. I worked at this one company where they would be concerned with micro optimizations such as to use array brackets instead of array_push function. At the same time, they were using propel that would run through dozens of php functions to get data, and their pages were loading in over 4 seconds, with unoptimized images, and over a hundred http requests. I just don’t understand this sort of mentality. These things should matter no matter if you are running an SEO site, or a private LAN intranet. Users will complain when your site loads in over 2 seconds. That’s a rule.

I’ve built many systems over and over and over only to come to the same conclusion. Simplicity just works better. Ask Steve Jobs.

Magento Sucks

Some might think that I want some attention, or have become a grumpy old man. Considering my birthday is tomorrow, turning 36 might be as close to a grumpy old man as I can get.

I want to make some things clear. I have nothing against people using these awesome tools coming out every six months, only to be used for a short period of time. I just want to share my experiences in the 12+ years I’ve been developing. Also considering the fact that I’ve been programming since the age of 11, self taught in basic, I think I understand a few things about writing code.

For the same reason that Apple became the number one company in the world, I like simplicity. Even when it comes to programming. Just because I’m a programmer doesn’t mean that I have to be some rocket scientist that only a few can understand.

Good programmers can write complex code that intertwines on itself in amazing loops and conditionals that will make even the smartest of people look at the code like a dog looks at someone whistling. Great programmers will write code that programmers at any level will easily understand.

This reminds me of the time I picked up Magento. What a convoluted piece of crap! I’m not talking about the basic use of pulling it out of the box and creating a template, but I’m talking about trying to revert from Enterprise back to the Community edition. I mean, holy crap! My head spun around for over 3 months trying to duplicate all of the functionality that already existed in Enterprise. Don’t ask me why business wanted to do that. They’re the ones that think they understand the product and sell it like that to their clients.

I vowed to never touch Magento ever again. Unless, someone needs a simple out of the box solution with a pre-purchased tempalte, there are other programs out there that can do everything much simpler. Presta-shop, wordpress, even weebly has introduced an ecommerce solution for moms and pops.

I like the idea behind Magento and its flexibility, but there’s no way you can build something so flexible to allow for everything you ever wanted. There are workarounds around it, and even then, you still have to revert back to simple PHP in many cases. If it was so flexible that you could do anything, well, then, you’d have PHP. So, why the need of a framework?

From my understanding, Magento was built in two weeks by an offshore Russian or Ukranian who worked nights and weekends to get this magestic piece of crap out to the market… And boy, was it buggy… Many revisions later, it’s still a monster that no normal developer wants to touch. For those that do, best of luck to you. You’re obviously MUCH more intelligent than someone like me.

At one point, the company that I worked for even had a project where the only reason to use Magento was to store user information. Everything was ignored, even the templating system. Everything was bootstrapped to render out custom template files outside of the working template folders. Talk about spreading butter with a chainsaw.

Basically, I’m never happy working in an environment where we start out with a framework, and in months we’re using custom code to run everything. Why not start fresh? Tabula Rasa! Clean slate. So much more control over what you do, and so much you can customize from the beginning.

So much abstraction in the programming world. I left the world of Physics because I wanted less abstraction and more reality based practical involvement and construction. Abstract thinking is just that. Abstract. It has its place in the world of physics and math. Engineering just doesn’t function on abstract ideas. You have to be precise and realistic, otherwise your building collapses.

I guess some programmers just like to be challenged for the sake of being challenged. Not this guy. I like keeping my brain functioning beyond the age of 50.

Let’s keep it real, folks!