About two months ago Alexander Katrompas wrote a post on medium titled Java will kill your startup. PHP will save it.. I already posted a short res...
For further actions, you may consider blocking this person and/or reporting abuse
github.com/laravel/framework/blob/...
github.com/symfony/symfony/blob/4....
TO doesn't want for some reason type-hints in the Laravel.
Have you spent same time with Go / Rust projects professionally (being paid for)? I think the over-engineered point is not fault of programmers but the company culture as a whole... feature this feature that, change request
$this
and you get the over-engineering, I think it's language agnostic.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.
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.
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.
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.
You can write very good code with all of you 'design patterns' stuffs with PHP 7 :)
Stop referencing that blog from 2012.
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.
So they don't support PHP5 anymore. True, I should have checked the very latest version. Still, they don't enforce strict typing. Also if they did, it would make things slightly better, wouldn't be a game changer.
I have been paid to write Go. Rust no, and might never be. I will agree that it's totally possible to write good code using PHP, but I will argue that it's much more of an effort than with Go or Rust.
Laravel last versions use strict types and you can use them in Symfony. It's already used in API platform.
Good to know. Seems like I'm getting a bit rusty. ;)
Facebook is written in php and it seems to be a really decent company. It started up, and has kept php. My point is if you can find an application well written in PHP and a bad application written in Java, then the whole argument falls apart. I think , should be obvious,the programming language is just a tool, the good practices don't depend on language. When it comes to easier or more difficult to the programmer, with so many IDE tools, that is just not a discussion. It seems to me, these discussions are quite similar to football ones when you try to argue a team over another but there is not real substance. Of course a web site written on c would not be optimal, but we are assuming none would think so already. So if the language provides the set of tools to develop the product, the success of the company doesn't depend on it, but in the good usage of it.
I do not think this is an accurate characterization. As popularity rose, they ran into problems, especially performance. So they tried a number of things, including creating their own custom compiler and language clone for PHP. All of that was deemed cheaper than rewriting their code base in another language. You can google for HHVM and Hack for more information. This Quora question has a lot of good insights from FB employees. Including this quote.
But your latter point is quite correct: Like most successful companies, their success has almost nothing to do with their choice of tech stack. And everything to do with creating a product consumers wanted and an effective way to monetize it.
Why? Do you feel I suggested that all PHP projects are inherently worse than all Java projects in existence? Because if so, I probably messed up somewhere really badly. The closest to this is that I said it's probably a safer bet to start a green field project in Java than in PHP, given you really have to choose from these two and there's no deciding factor like building on top of existing app or big dog clients.
I don't see how IDEs can help you better understand or utilise programming language concepts. For example how do they help with understanding implicit interfaces, inheritance, borrowing, union types or generics?
How will these tools help the developer understand whether adding one more level of abstract inheritance is a good idea or not? Or whether that method should really be final or not? Or whether using "==" is okay or not. I could go on, but the point is that languages are different and they do affect the likelihood of your project becoming legacy in no time or not.
Well, you're probably a software engineer and what you're saying probably makes a lot of sense to you, since you're probably aware of your capabilities. I'm not even saying you're wrong. The post however was also not to convince you that you're working with the "wrong" tools but to convince potential entrepreneurs that PHP will not save their startup. For them it's always about investments and risks and I tried to help them get a clearer picture on that.
Fun fact: kore.io/
I saw the "Java will kill ..." article on medium suggestions but I ignored it, and now after reading a part of it I don't regret it.
We can start and end with those "facts", most of them are subjective or false statements. Some of them are just some random irrelevant statistics, like the number of companies that use PHP (most likely most of them have a Wordpress website) instead of comparing number of jobs, company profit, salaries or the number of users of those products, companies with over x number of engineers and so on.
Neither language is going to "save" or "kill" your start-up.
When you take an inherently flawed blog post and then try to make some argument on top of those false premises, what you say only makes sense in the context of these articles.
Your conclusion is fine, but it doesn't mirror reality. Vast majority of startups are going with LAMP or MEAN stacks.
All you have to do is take a look at the statistics on SO.
This debate is a perfect example of premature optimization. We don't know what it is we are building, but let's spend two hours arguing about it.
If this post ever helped a very small minority think a little bit harder about this topic before hiring a LAMP or MEAN team for their next project, I'd consider that a huge success. Chances are, I'll never know.
It would be awesome to revisit this topic once RFCs for stricter types, especially the typed-properties one, are approved. I think that would put PHP at just the right spot compared to Java's type system.
I haven't seen a live PHP + Apache combo since 2012 and unless you have very good reasons to stick with it, you probably shouldn't either.
Please note, I don't want to defend Java really, but keeping a PHP app afloat that is used by tons of people is not a walk in the park and keeping a growing codebase managable and stable is extremely hard.
Could you please explain why you think that PHP is a script language and not an object language in 7.2+ ?
Considering strict_types, typehint etc ?
Ruby is a scripting language and yet it is a purely object-oriented one.
Python is a scripting language that like PHP has gain OOP and FP features lately.
Being a scripting language is not tied to the paradigm it follows.
Please open php.net/ and read the very first sentence:
"PHP is a popular general-purpose scripting language that is especially suited to web development."
Whether it has OO features or not is simply irrelevant.
"What it does affect is first that not all of your code will be loaded into memory when a request is served (good), that all of your errors will be runtime errors (bad) and of course that your code will be interpreted on an as-needed basis instead of having it all compiled to byte code or some intermediate language"
Symfony cache isn't a solution to this one problem ?
To clarify, I don't necessarily think that working with a scripting language is "a problem" in itself. It's just a fact. The only problem in the cited part is the runtime errors, and for that your only compensating tool is testing, testing, more testing, a good CI flow and maintaining a healthy log. Plus some more testing.
Don't believe me, just try a simple Go project and see what happens when you break something. It should be obvious within hours... Btw, Go is not free of runtime errors at all, but they occur much less frequently. (Rust is free of them unless you use stuff marked as unsafe...)
PHP has been on my mind more and more lately. From working at a few marketing companies where PHP was the default then transitioning to a .Net enterprise. However, I have noticed recently that one of my most popular blog articles is PHP. There appears to be a great demand even though I feel like nodejs should be rivaling a lot of what made PHP successful except for some specific reasons why it currently does not. One, I think that university courses put a big focus on PHP+Mysql as the easiest place to start for creating an app and learning about databases. The learning feedback loop is very small compared to a a statically compiled language. Two, most people dipping their toes into their own website may still start with a hoster that offers mysql+php and does maintenance for them vs. starting with a cloud provider. Third a lot of businesses have some kind of PHP laying around somewhere and I wager there is a vacuum of knowledge around PHP where other ecosystems have taken the attention. There seems to be some demand for creating libraries or documentation on how to do some things in PHP that would be easier in some languages.
That's funny and the observation is probably right. :)
I see Rust as a more complex but safer version of Go to some extent and I like both languages. I guess that's the reason.