DEV Community

Discussion on: Will PHP save your startup?

Collapse
 
peteraba profile image
Peter Aba • Edited

Sorry I just realized that I didn't really give you an answer on the over-engineered point. Reality is, it's a complicated issue, at least in my opinion, but in short: No, I think company culture is the least of the problem. Not that it can't be, but it won't be a defining factor when I judge a language. You can write shitty code in any Turing-complete language, that's guaranteed.

Community culture may be a bigger problem with a whole range of issues from terrible and outdated examples out there, through terrible but successful legacy applications like Wordpress or Joomla to overengineered ones like Magento, a fair amount of elitism and feature-envy, etc.

Still, I think the biggest problem is the language itself as it just gives you (and promotes) things I personally consider harmful. Among them many things that many others swear by but I just don't have time or space to explain my reasons in detail here. Anyway, here's a quick list: inheritance, exceptions, implicit type conversions, falsy-truthy madness, typeless variables, ternary operators (arguable, but definitely often abused), inconsistent standard library, terrible track record retiring deprecated extensions, configurable error levels, errors vs exceptions, etc.

But if all of these were somehow fixed by the language or your coding standard, I'd still know that I broke my API within a second or so with Go while you'd have to wait for minutes for the CI server and hope that your test suite will catch it. That feedback loop is invaluable to me and I do believe it leads to better code. Even if it doesn't, at the very least there's less "self-defense" in the code base...

Finally, PHP is just full of flaws and compromises. I won't go as far to say that PHP is a fractal of bad design, but it's definitely not great.

Collapse
 
perttisoomann profile image
Pert Soomann

There should be a drinking game for referencing that blog post in any articles that are trying to prove PHP is less than X technology.

Thread Thread
 
peteraba profile image
Peter Aba

I wrote thousands of words and all you have a problem with is that I dared linking something that I even stated I don't completely agree with?

I'm sure you're aware that most people on dev.to never read that article, it just triggers you that it's still around, doesn't it?

Also the post didn't mention it, the only thing it mentioned is that classic OOP is in my opinion evil, which I will stand by, but I'm aware that's still not the popular opinion.

Thread Thread
 
perttisoomann profile image
Pert Soomann

Not so much as triggered, but finding it amusing that that blog posts works it's way into comments of any PHP pros v cons related article sooner or later. I assumed referencing a drinking game would make it seem clearly more light-hearted comment, my bad.

I actually was going to write a longer and more meaningful reply, but decided I should take my time with it and left it for when I get home.

I liked that you came to a conclusion that PHP on it's own is not necessarily going to kill any startup. It's pretty uncommon actually, because articles usually end with very strong statements like - technology X, only morons use it OR technology X, only morons would use anything else - so what it's worth, I found the overall tone pretty neutral, which is a good thing.

Collapse
 
marufalom profile image
Maruf Alom

You can write very good code with all of you 'design patterns' stuffs with PHP 7 :)

Stop referencing that blog from 2012.

Thread Thread
 
peteraba profile image
Peter Aba

If I referenced it in the blog post you'd be right. I'll stop referencing it in a comment about why PHP is not a great design, when it really becomes obsolete. That post contains many things which are unfair or very subjective and few which have been fixed, but the overall number of actual issues remaining is huge. You've learned to live with them and so have I, but it doesn't make the design any better.

Also stop telling me what to reference and what not to.