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
-
Holy shit they broke coercion semantics?!?????? hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha
-
I'm no fan of JS or PHP (backend and cloud infrastructure dev here, so I have never used PHP and try to avoid JS), but every time I see posts about weird comparisons enabled by dynamic types, I always have to ask, "But why would you even try that?"
-
... what does it say about me if i can't decide which variant is less nonsensical and my conclusion is "that's what you get for not being strongly typed, morons"?
-
bagfox8724yPHP8 be like: Let’s see who’s code base is crap
PHP Devs: Let’s all migrate to PHP 8, it’s so much better!
Manager: Why is this taking so long? -
Loosely typed languages will all have these kinds of subtle crappy typing issues. Breaking stuff in between versions is pretty awful, but imho the real problem is loose typing itself. I've never seen it done well - it's always a poor compromise.
-
I still don't get why some developers and engineers go "yeah we don't need a typing system just make anything truthy/falsy lmao"
Like who looks at this goes "yeah that sounds good" -
@LotsOfCaffeine Some Devs genuinely get confused with types, and so think the answer to that is to use a loosely typed language that just "handles it for them".
-
@AlmondSauce I believe there are many things a language can handle for us
Like memory management, garbage collection can work wonders for many applications.
Or multitheading. Async-await and parallel for loops are much easier and safer than manually tinkering with threads.
Knowing what kind of data you're actually working with is not one of those things. -
@LotsOfCaffeine I agree. Try telling that to a Dev who's never dealt with a strongly typed language though...
-
ebrithil1644y@AlmondSauce devs that get confused by using a type system shouldnt be calling themselves devs imho
-
@polv
if I remember correctly, it used to be that:
empty string coerces to false.
non-empty string other than "true", "false", "0" and "1" coerces to true,
string containing the aforementioned coerces to the boolean value represented by that string.
--
and it seems they've changed it to "everything except string expressions of those bool values coerces to false".
BUT:
a) I haven't worked with PHP for a very long time, and I wrote this purely from memory.
b) I haven't read about the new way, I'm just making a huge ASSumption. -
@polv
wow, that was probably the fastest reaction of any kind I ever got to any comment anywhere ever.
:-O -
Nice nitpick.
PHP8 is 90% fixed towards a decent OOP language.
There's still quirks, but the speed at which the PHP devs are fixing legacy shit is amazing.
You could have mentioned union types, match expressions, constructor promotion, JIT, but of course we focus again on a quirky relic.
A quirky relic which, in my opinion, is now fixed, or at least improved. Even though weak comparison still sucks.
And to those who yell AAAAH BREAKING CHANGE: Name one language which never had any breaking changes at major versions.
I mean, C++ 17 removed the ability to do true++, and I like to ++ true statements. -
Now that they finally got their beer and spirits together to break out of the breaking-change anxiety loop and do actually fix a major language flaw for good.
People still don't like it. This time the shame isn't on PHP... -
hjk10157314y@kiki
// PHP3
0 === 'foobar' // false
// PHP4
0 === 'foobar' // false
// PHP5
0 === 'foobar' // false
// PHP7
0 === 'foobar' // false
// PHP8
0 === 'foobar' // false
Doing shit that that the language specifically has guards against is just stupid and abusive. This is not a quirk.
You can do shit with C to that results in unspecified behaviour or put in some nice race conditions in yo Python script and complain about how randomly crashy Python is... Yeah I hate JS but think the same about the type coercion flak it gets: it's stupid bullshit there is plenty of valid ways to make fun of the language.
This is so beneath you. -
kiki353264yY’all soooo salty lmao 😂 it’s just a shitty language, there is no need to feel such a strong emotional connection to it
-
kiki353264y@myss what my case has to do with their cases? How exactly me being attached making someone else’s attachment less ridiculous? That’s an Uwe Boll argumentation
-
hjk10157314y@kiki i think @myss sees it more as ironic or hypocrisy. You complain about people that are so into it that they have made up there minds and just don't see it. Yet you have so made up yours you are not objective either.
Haven't seen that conveyed in an Uwe Boll masterpiece yet.
@myss I'm really speaking for you so I could be totally wrong please correct me if I am. -
hjk10157314y@kiki One man's garbage is another man's art.
It's just your opinion and I don't think you are objective to be honest.
To answer your question:
Garbage === worthless or meaningless material or ideas; rubbish.
By your needs to be so vehemently against it you prove it is the opposite of meaningless. By the industry that heavily invests and profits from it we cannot consider it worthless either. That just leaves rubbish and that is what I think of your opinion on this matter but it is also your opinion on PHP and I respect that.
I just have an issue with the same old invalid arguments against it, and as you are one of the more knowledgeable people here I was a bit harsh. Would not call you garbage though 😉. -
@kiki
"there is no need to feel such a strong emotional connection to it"
it's just a mound of shit in your backyard that you need to wade through 70% of the time when you're trying to get to your swimming pool, there is no need to feel such a strong emotional connection to it.
i don't know about you, but I'm a programmer. so I would like my programming and programs, and work to not be shit. so I have emotional REACTION (not connection) to things that contribute to my programming, programs, and work to be shit. -
Fuck PHP.
At least 8 in the example makes more sense.
Major versions are meant to break backwards compatibility anyways.
PHP7
0 == ‘foobar’ // true
PHP8
0 == ‘foobar’ // false
Nuff said. Before you tell me that js also has quirks, just remember that js having quirks doesn’t make php less garbage.
rant