Earlier quoted context omitted.
"he answered that 100-200 request per second is more than enough for most use cases" Exactly this. If you already know PHP and can produce results (mostly CRUD apps) and it doesn't need millions of rps, why do we need to use another language because they are so much better ? So much better at what ? It is like saying "I have a hammer, so everything looks like a nail to me". Not every web app has to be written in Lua/…
Reminds me of "PHP Hammer" I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there. You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes. You pull out the hammer, but to your dismay, it has the claw part on both sides. Sti…
PHP 8: Before and After
151–160 of 346 posts
Re: PHP 8: Before and After
#152Earlier quoted context omitted.
Most of the bugs or spaghetti code I have to fix this days are not caused by the language, the issue is most of the time the requirements that changed or the developer was not experienced with that certain problem so he created a monster.
its like saying most of the seg fault caused is not due to use of C. Common langauge pattern / design choices made php to have bugs/ spaghetti code. At the end developer control many thing but that doesn't mean language don't have any fault.
My advice is use the best tool for the job when possible, if you don't have a choice then learn to accept that most of us work with less cool languages/frameworks/projects ... the skill we bring is to find solutions for our customers and implement this solutions as best we can with the tools we have, most of the time a developer should be spending reading stuff(documentation,articles, code), thinking and the least time should be spent on typing code or tooling.
Re: PHP 8: Before and After
#153It made sense to use PHP EXACLTLY in the good bad old days because it was just leaner to bang out applications in PHP than with other languages.
Nowadays, I feel that PHP cake has been largely eaten by Python and Ruby.
Why using PHP with such a level of verbosity?
Re: PHP 8: Before and After
#154I don't really understand why in 2020 there's still this kind of blind hatred against this language. It often comes from horrible bad memories from previous versions or old frameworks. Objectively, compared to other languages i've been working with it is more than OK. Despite it's lack of "style" it is easy to understand, host, tests, diagnose and it is powerfull for web applications. I've been working on a SaaS API…
People keep saying “PHP in ${current_year} is actually great, it only sucked in ${current_year-5}!” - I feel like it still sucks[1] today, but it’ll take 5 more years for the fans to realise it, when they have the PHP from ${current_year+5} to compare against :P [1] Being slightly hyperbolic - I won’t deny that you can do good things with PHP, as you can do good things with any tool; and AFAIK it’s still unmatched wh…
Now it seems like the basic type system is in place, great. This new stuff in the article I'll probably start using it when 8.4 drops.
5 years is an exaggeration, but staying a version or two behind really helps you stay sane.
By the way I found Hack/HHVM thoroughly disappointing. Tried running some fairly complex apps on it and it felt like they reimagined the legacy baggage. Seems like PHP itself borrowed a lot of ideas from it though.
Re: PHP 8: Before and After
#155I don't understand as of 2020 the use case for PHP. It's verbose as Java without its speed. Seriously, can anybody help here? It made sense to use PHP EXACLTLY in the good bad old days because it was just leaner to bang out applications in PHP than with other languages. Nowadays, I feel that PHP cake has been largely eaten by Python and Ruby. Why using PHP with such a level of verbosity?
Re: PHP 8: Before and After
#156Few months ago I was debating with a friend working since 15 years on PHP, my point was php is slow and max throughput is 200-500 rps, which is quite low compared to Go, node.js, C# and others, he answered that 100-200 request per second is more than enough for most use cases. I'm working on systems with 25K RPS at peaks, but for simple projects and small companies he is right ... But why should anyone start a new pr…
I don't believe the constraint would be the language itself, not with accellerators, opcode caches, JIT compilers, etc. I've always been told that PHP's performance is more down to the database than anything else.
Re: PHP 8: Before and After
#157Few months ago I was debating with a friend working since 15 years on PHP, my point was php is slow and max throughput is 200-500 rps, which is quite low compared to Go, node.js, C# and others, he answered that 100-200 request per second is more than enough for most use cases. I'm working on systems with 25K RPS at peaks, but for simple projects and small companies he is right ... But why should anyone start a new pr…
Absolutely not, you could already go to 5k rps 10 years ago and PHP has massively improved since.
Re: PHP 8: Before and After
#158Earlier quoted context omitted.
That's what baffles me with PHP. Instead of building on PHP's unique capabilities, they try to become more like Java. When PHP was and is quite successful as server-side language for HTML templating, rooted in embedded PHP triggered from SGMLish processing instructions in otherwise static HTML. It's only that they made such a hack job without context-dependent, HTML-aware escaping, making it a primary vector for inje…
It would be impossible to maintain backward compatibility if they made the language HTML context aware. It would make it more difficult to output any non-HTML content type from a PHP script. It would require many new syntaxes (e.g. for outputting variable data in the attribute values of elements, selectively outputting elements or attributes, looping through them, etc). It would also mean the language is tied to spec…
bla
whatever"?>
&x
where x is bound to markup checked against permissible elements in the first context (eg rejecting ) and escaped into <p>whatever<p> in the second. Rejecting script elements in user or other dynamic content as well as escaping comes for free with regular SGML parsing.Re: PHP 8: Before and After
#159I don't understand as of 2020 the use case for PHP. It's verbose as Java without its speed. Seriously, can anybody help here? It made sense to use PHP EXACLTLY in the good bad old days because it was just leaner to bang out applications in PHP than with other languages. Nowadays, I feel that PHP cake has been largely eaten by Python and Ruby. Why using PHP with such a level of verbosity?
Re: PHP 8: Before and After
#160Few months ago I was debating with a friend working since 15 years on PHP, my point was php is slow and max throughput is 200-500 rps, which is quite low compared to Go, node.js, C# and others, he answered that 100-200 request per second is more than enough for most use cases. I'm working on systems with 25K RPS at peaks, but for simple projects and small companies he is right ... But why should anyone start a new pr…
There will always be something negative regardless of what you pick, problem is to decide what your core values are when writing different types of software. If you don't, you are just comparing apples to oranges.
When it comes to PHP, core values are usually things that has to do with tooling, server architecture & deployment, not much the language (syntax, expressions, lambdas, classes etc) it self, except maybe it is easy to learn & use.
This means that developers who comes from a background of that the language itself is the most important part of a project will most of the time just get confused what PHP is about.