All of IT in one image
-
besides NaN actually being a number, this could completely and easily be avoided with typescript.
Naaah. Good programmers know how to use
as any as any
to make this work in typescript as well. -
Wait until Null opens the door
segmentation fault
-
"a"+"b" -> "ab" "a"-"b" -> NaN
Yeah:
parseInt("a") -> NoT a NuMbEr
-
This isn't the languages fault, it's the developers.
I'm assuming by this you mean the developers of JS /s
-
Yeah:
parseInt("a") -> NoT a NuMbEr
Sure, but the main issue here is that JS doesn't only auto cast to more generic but in both directions.
Maybe a better example is this:
"a" + 1 -> "a1" "a" - 1 -> NaN
With + it casts to the more generic string type and then executes the overloaded + as a string concatenation.
But with - it doesn't throw an exception (e.g. something like "Method not implemented"), but instead casts to the more specific number type, and "a" becomes a NaN, and NaN - 1 becomes NaN as well.
There's no situation where
"a" - "b"
makes any sense or could be regarded as intentional, so it should just throw an error. String minus number also only makes sense in very specific cases (specifically, the string being a number), so also here I'd expect an error.If the programmer really wants to subtract one number from another and one or both of them are of type string, then the programmer should convert to number manually, e.g. using
parseInt("1") - parseInt("2")
. -
This isn't the languages fault, it's the developers.
Albeit true, I want to note that some languages encourage such practices way more than others do. Also, when you've got a hammer everything looks like a
stringnail. -
This isn't the languages fault, it's the developers.
It's both.
-
You wouldn't want your code throw an exception
[object Object]
-
As someone who mostly avoids JavaScript, I don't see the IT in this image, I just see a bad language I avoid!
I promise you, people make mistakes in every language lol.
-
This post did not contain any content.
I freaking love naan! Bring it!
-
I freaking love naan! Bring it!
NaN naan Jeremy that's insane
-
I got one of those too. I called the customer service to get another path home because of disturbances, and they just have robot answering. The robot started halfway through the call just reading pure json at me, and then said "to get this information as a message press 1" or something. This is what I got:
Here is your journey from undefined to undefined:
BUSS 506 towards Karolinska sjukhuset
09:36 from undefined
10:18 arrived at undefined.
Link to your journey.If you want those on separate lines you need to add two spaces on the end of each line!
-
What's wrong with skateboards
I really don't care people using skate boards, even doing it around a workplace isn't necessarily taboo in my mind, but they were in the office right outside someone's door. Do it in the parking lot or something.
-
Wait until Null opens the door
Knock knock
-
Must be from the NPM delivery service. The recipient is lucky the driver didn’t give them thousands of dependencies too.
You don't get dependencies in real life like that.
You work 10 years in an industry and try to get a promotion? That may be a dependency issue.
-
Albeit true, I want to note that some languages encourage such practices way more than others do. Also, when you've got a hammer everything looks like a
stringnail.In my mind a simple unit test should have caught this. Mock out the call to the service that sends the message and verify that it's been called with the correct message, and cover the possible failure scenarios. That said I hate loosely typed languages lol.
-
"I got a package from Jason"
"I also got a lock"
-
I actually wish skateboards made a come back. Much more preferable over the escooters I see around a lot.
What about kick scooters?
-
This post did not contain any content.
-
I'm an old fuck and I started to code in the late 80s.
Fast forward 30 years, I once had to work at a WeWork. One day, directly outside of my small office space, I swear to god, a fucking hipster kid with a Macbook under his arm practiced skateboard moves. That was the exact moment I started hating working in IT. It's also what I think every Javascript coder looks and acts like.I had a weird image of the hipster using the Macbook to do the kick flip....