Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Uhh bash pun intended? 😬
Oh and I'm with you 😅 I like PHP 😇
It pays my mortgage, and I love it.
dcode4317yIndeed. PHP is realible as fuck. Never disappoints you.
sure we should use all the tools in our toolbox, rather than a hammer for a screw. But for a general purpose, web focussed language - it's pretty damn good at its job.
tobbeboi7067yLike someone else said, it pays the bills. Working with a nice framework like laravel makes it a lot more fun also. And the amount of examples and issues posted by other people guarantees you always find a solution. This is the biggest let down working with newer languages, you have to solve the issues yourself
skanna3457yIt's getting better and pays the bills, but honestly, how many of you are actually proud of saying "I'm a PHP dev" to other devs?
@skanna I am proud to call myself a PHP Developer and will say it if my life depends on it. language has its weaknesses as well as any other language, be it JS, Python, Java, ASP etc. I don't hate on other languages (maybe except for Java, but that's a personal preference and not just because 'Java sucks').
as said above PHP used correctly is very powerful language, thing is a lot of people consider WordPress, joomla, moodle and drupal the best examples of php and that is crap there are good developers among us...
also the language is moving more and more towards multipurpose usage, not just web. that is why most releases aim towards CPU optimisations it might even slbecome a "competitor" of python.
and let's be honest bithching about "how bad it is" does not help anyone + obligatory
skanna3457y@helloworld @dev-nope @ctrlz I'm currently working at a shop company and, god, you have no idea of how messy the codebase it.
Php short tag everywhere opening and closing, mixed with HTML, the worse thing I've seen ever. Classes used in the wrong way, using globals inside.
We're doing a big big refactoring using Symfony, but still, inconsistencies are in the language. see one of the my previous post to see how php behave with the String "x", casting it to both true and false.
still, check the syntax of the various array functions.
still, why the usort function is "not stable"? Surprise. You will discover this only later on
Now I really get why people don't use PHP for serious stuff (like banking).
I like it, don't take me wrong, but I think that's a quite bad language.
@skanna Symfony is a great way to refactor a horrendous codebase, and I agree there are in consistencies - however generally these are well documented and alternatives offered (via open source contributions) as developers it's our job to spot these and act accordingly
I mean technically in python 2.7 you can overload True and False, and
x = 1
print(x is 1) # return true
y = 1000
print(y is 1000) # returns false
as long as it's documented, I don't think it makes a bad language, nor a scalable language - I think open source languages will always have the occasional quirk and once it's in there, it's a bastard to deprecate, especially when there are other potential bugs and optimisations that need to take president (when the quirk isn't technically broken)
or something. 🤔
jstaiyou7157y@skanna I think there's nothing to be ashamed of. If you like the language and/or it pays your debts, then why not to say it loud and clear?
If you aren't proud of what you're doing, learn other language you actually like.
I believe we all, as developers, should feel like we're doing good to society and the world as our duty is making things work in a way only we can. If you don't feel that way, develop other language or for other company, or don't be a dev. No offense, I'm just saying mental health depends on feeling good with what we do.
dayo30617yPHP is so easy to pick up so it attracts a lot of "learners/newbies" they then produce poor, inefficient and insecure code. This is what people think of when they hear PHP. Other languages have a much steeper learning curve so scare off most "newbies".
When PHP is written well it can be a joy to maintain, but when it is written poorly sometimes you just want to hand in your notice and run.
I personally prefer JS and Node.JS but I still use PHP on a daily basis (after re-coding the whole codebase as it was some of the worst code I've seen).
flag020377ywhy does web languages (like php and js) and network stack for others are the quirkiest of all?
@skanna you should note in my comment when I am referring to the bad developers, the code base you work on or the shop maintains is a consequence of poor development, not of the language itself + short tags are removed AFAIK in PHP7, so some stuff are being worked on and fixed for good. the mixed html and php are the legacy of its 'template language' past...
although can agree on some syntax of array functions, but you just have to get used to it and is fine, as well as with the dirty quirks inside the language, but hey it is improving and the backward compatibility is huge (those array functions ware implemented quite a while back +/- 7-8 years maybe more (am lazy to check the docs))
Lets be realistic. PHP is a badly designed language.
- Native function return inconsistency
strrpos can return any number and false. Then
!strrpos("hello", "hello world") //true
!strrpos("hello", "Big potatoes"); //true
(Solution: use === with false)
- Native functions names inconsistency
- 0 == false == "0" == "" == array() == null (Solution: use ===)
- My favorite
$a = 0;
$b = 'x';
var_dump(false == $a); //true
var_dump($a == $b); //true
var_dump($b == true); //true
lol false equals true then??
(Solution: use === )
devs who are new or come from strict languages always fall to this pitfalls once.
But even with this issues PHP has the best fucking documentation ever. And no one can deny this.
You go to php.net and you got for each function a concise and clear explanation with one or more real examples with comments from the community. Compare that with Python documentation.
iceman9597yHey I know you like PHP but have you tried Node.JS? I heard its better
If you don't know how to use the language it doesn't make it a bad language. It just makes you a bad programmer.
@dotomaz exactly what I said.
And I use ===, and the new php7 strict typed features.
That reduces my tests density by half.
When you see that benefits, you start to question "Why the heck PHP has not removed == operator already? So much rants are generated by this operator"
The good practices and decisions that I take doesnt remove from the map all the people that keep failing on the same pitfalls. So Im not changing my vision about this.
xorith27527yI'm a developer. PHP is one of my tools. I don't blame a tool for failing, I blame the tools misusing it.