It's becoming kind of an Enterprise language [1]. Don't get me wrong I think PHP is getting cooler, hopefully everybody catches up and the fact that You can have a shared hosting for pennies run Your PHP code really puts it at an advantage compared to others. [1]: https://github.com/joaomilho/Enterprise
> It's becoming kind of an Enterprise language It tried for decades to be one with Doctrine, Symonfy and co, trying to copy the worst of Java EE with every single possible design pattern implemented in these frameworks, XML configuration files and co... The problem is no generics, no private packages makes PHP OO a horrible mess compared to Java (or C#).
PHP 8: Before and After
101–110 of 346 posts
Re: PHP 8: Before and After
#102Earlier quoted context omitted.
Lots of languages work and let you get things done. You don't have to choose PHP.
Yeah, It's because certain devs instead of adopting a defensive position in favor of PHP. They don't think in the fact that there are many alternatives of programming languages even superior than PHP for different use cases and exigencies. E.g Lua, Julia, Erlang, Python, even the slow Ruby just to name few of them.
For most CRUD web development, using Lua/Julia/Erlang has a heavy cost upfront of learning, finding developers and many other issues like hosting etc. PHP works out of the box on most servers and has a mature ecosytem. So this is why I cannot just get into Lua or Julia because it is much better than PHP. It is all about cost vs benefit analysis. Sure, if I am building something like whatsapp, I should probably learn Erlang over PHP but if I am building yet another CRUD App (which most web apps are even in 2020), I am totally ok with PHP since that gives me the quickest and most mature way to get started.
People who care too much about languages remind me of the "If you have a hammer, everything looks like a nail" situation. Not every application has to be built in Julia/Lua/Rust whatever.
Re: PHP 8: Before and After
#103I'm not up to date on php code, but can't the first example be done using reflection? For example a SubscriberBase class which: lists all of its "on*" methods, checks if there's only one parameter, gets its type via https://www.php.net/manual/en/reflectionparameter.gettype.ph... and registers the method to receive events of that type. From the docs it looks like it's possible in php7 and doesn't need explicit text ma…
Re: PHP 8: Before and After
#104Re: PHP 8: Before and After
#105Earlier quoted context omitted.
> It's becoming kind of an Enterprise language It tried for decades to be one with Doctrine, Symonfy and co, trying to copy the worst of Java EE with every single possible design pattern implemented in these frameworks, XML configuration files and co... The problem is no generics, no private packages makes PHP OO a horrible mess compared to Java (or C#).
I agree with you. Symfony and composer in general has just turned our code base into some kind of fugly java like monstrosity. When I used composer the first time I really enjoyed it, that project also used Silex a minimalistic symfony2, which I also really liked. But what I found out is that in general it is really terrible to be dependent on others, as Silex was dropped by Potencier and my project is left in limbo,…
Re: PHP 8: Before and After
#106Earlier quoted context omitted.
Why didnt they use the term singleton or object?
What would they use it for? The first 'static' means the method is a part of the class rather than the instances of that class. The second and third 'static' indicate late static binding, meaning they refer to the class being called, rather than the class defining this method.
> The second and third 'static' indicate late static binding, meaning they refer to the class being called, rather than the class defining this method.
Wait, so they're using "static" to mean the binding is happening later? Isn't that essentially less static than binding against the class being defined?
Re: PHP 8: Before and After
#107Earlier quoted context omitted.
Finding talented developers that want to work on your codebase is a factor in your example. More and more developers are realising they don't want to work with PHP. How much revenue will you get without developers? Go ahead, keep using PHP for your existing multi million dollar product. But using PHP for new projects is not wise.
Recruiting emails from companies that use PHP go straight to trash. Wouldn't even consider it, and I know I'm not alone. PHP shops won't attract from the same pool of talent. It's not that there aren't good PHP developers, it's that there are so many brilliant engineers that are never going to consider such work. Languages matter.
Re: PHP 8: Before and After
#108Can a fellow geek knowledgeable in PHP gives me a few pointers? I have inherited a 12 year old PHP app written by 2 interns. The code was written with Notepad++ (no IDE), no comments except when they copy pasted something from the internet, most variables are single letter and it's the biggest spaghetti bowl I have ever seen. To add insult to injury I have no experience with PHP (apart from peeking at this code to fi…
It gives examples and goes bit by bit through the process of organizing code.
I'm using its suggestions along with a static checker called Phan, which I chose because it attempts to "prove incorrectness rather than correctness."
Re: PHP 8: Before and After
#109Earlier quoted context omitted.
Syntax is very far down the list of problems with PHP
> list of problems with PHP (Here we go again.) Such us?
If not, you're just proving my original point. It's hard to see the problems of a language if you are only productive in that language. I can start pointing out flaws in PHP, and you can claim that those flaws don't matter. Until you increase the number of languages in your repertoire, our discussion about the flaws of PHP won't be constructive.
Re: PHP 8: Before and After
#110Earlier quoted context omitted.
Recruiting emails from companies that use PHP go straight to trash. Wouldn't even consider it, and I know I'm not alone. PHP shops won't attract from the same pool of talent. It's not that there aren't good PHP developers, it's that there are so many brilliant engineers that are never going to consider such work. Languages matter.
Good for you but I don't hire language developers for my company. I hire developers who care about solving problems, no disrespect meant to you. Today it's PHP, tomorrow we could do Golang etc etc. Who cares. When I interview a developer, I pay attention to the fact if they are too obsessed with a certain language instead of real problem solving. My 2 cents.