Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@catgirldev what amazes me to this day is that PHP ignores lower/uppercase, i.e.
foo() and
FOO()
are the same thing, and some retards even defend it. -
We have a similar problem, but we use VSCode and the Intelephense extension let's you set PHP compatibility level per project.
-
during the process of updating to a higher language version, you have to test your code with both versions or be prepared to do a reversible atomic switch. Always test on the version, the code will be run on in production.
-
hjk10156962y@EdoPhoenix it's not ideal but I've been programming in PHP for a decade and that was never a problem.
So in anything PHP 5.3 and greater one should use namespaces anyway. That even further abolishing the chances of conflict. -
@EdoPhoenix I love PHP. Makes sense, works all the time, good documentation. The worst thing anyone ever seems to say about PHP is that it's easy to use, which apparently is bad?
-
Feibrix932y@spongegeoff it's not easy to use, its easy to write bad code with it.
Check the vulnerabilities in php projects.
And fucking die() to debug is still the easiest way to debug what's going on, while if you had a sane programming language you would just debug your code.
In 2022 using php to do anything on production is just wrong.
I maintain a php site I inherited, and I am looking forward to kill it with fire. -
@Feibrix Couldn't agree less. Use XDebug, for a start. I can never see the appeal of having to write five times as much code to achieve the same thing, or that having a bunch of excuses for failing was useful. Just check out something really basic, like adding something to an array? Downright convoluted in VBA, Python not much better. PHP just works.
-
@Feibrix personally I can't stand PHP anymore, but correctly configured Xdebug with a matching IDE extension (and a good language server like Intelisense) makes PHP not much worse than any modern pre-compiled language.
Just have to make sure you're running on 7.2+ and have the discipline to use parameter and return type declarations correctly. -
It's certainly much easier to write bad PHP if you're lazy than other languages, but the same can be said of Javascript or any other dynamically typed language.
-
Feibrix932y@kwilliams yes, thats why in serious environments you use typescript. Js wasn't designed to be used as we use it today, and it shouldn't. And this applies to php too, not designed to do production stuff, it shouldn't be used.
Then, I know people still using vb6 because it rocks, so you can certainly choose your torture device. -
@Feibrix
"And this applies to php too, not designed to do production stuff"
And yet it does so much production stuff, on a worldwide basis, each day and every day. Perfectly well, as a huge part of the global economy. I'd use javascript if the clients wanted 30 second page loads with the content jumping around, but they don't.
VBA - when your boss asks you to sort out some legacy VBA, you sort out the legacy VBA. Even if - news just in - there are other languages on the planet. -
hjk10156962y@Feibrix I read a lot of baseless and stupid opinions presented as absolutes and facts.
Just think about on how many people that have been working on this highly successful language for decades you take a dump on.
Are you that you are such an amazing scientist? -
Feibrix932y@hjk101 highly successful language doesn't mean it is a good language. You can't use this argument against my points because, well, it's not a fact too. Javascript is used EVERYWHERE and it is a bad language. This is a fact and a proof that you can be successful and still wrong.
Not recognising that this "widely used language" offers more problems than solutions shows how poorly PHP defenders understand their tools.
You don't need to be an amazing scientist to see this, you just need to know more than a single programming language. -
@Feibrix
"You just need to know more than one language"
We do. If other languages were great in comparison to php and js, for the purposes that those languages are intended for, they'd be used more. They aren't, because they're not. -
@Feibrix
"shows how poorly PHP defenders understand their tools."
This from someone who debugs with die() .
!competent , but opinionated anyway... -
Feibrix932y@spongegeoff What do you mean? Writing on the internet that every language that is not PHP is not used doesn't make it true. :/
Js is different: you can run only js on a lot of platforms. Devs are forced to use it, and to make it less painful, they tried to change it. From coffeescript to typescript. This is the community screaming IT SUCKS, and you cannot just ignore it.
Other languages are just languages, and they all have goods and bads, but they all have something in common: they are better than php.
Do you want an example? == / ===. Or json_decode to be used with json_last_error to see if NULL was a valid result or an invalid result.
PHP was designed for non programmers, not to build complex software, and doesn't matter how many patches, versions, or active projects it has, it is still a bad programming language. -
Feibrix932y@spongegeoff I haven't found a better way to debug a live wordpress with an autoupdated extension that crashed everything because the PHP version was not the correct one.
PHP is an unjustified pain, and creating more php software means only adding more technical debt to people that will need to maintain it.
And I said, you do what you want, you can even like it, but you cannot say that it is a great programming language. It just can't be. -
@Feibrix
"I haven't found a better way to debug a live wordpress"
... but those better ways do exist. Sounds as if you're not even across basic error messaging, php extensions, local working and very much else. I'm hesitant to say anything, but you should start with getting the right version of php, ensuring you have the required PHP extensions, enabling error reporting, working and debugging on a local copy. It doesn't sound as if the issues require a deeper analysis - presumably, the WP extension works for other people if PHP is configured correctly - but if you ever needed to, e.g. you were developing new code, you'd be able to see all your variables, set up interrupt points and analyse line by line with xDebug and phpStorm.
Related Rants
Our dev server runs php 7.4
Our production servers run php 7.2
rant
php
why