This is one of the most educational and entertaining reads on the internet, if you are into that kind of thing:
The birth of JS
Submitted 1 year ago by alphacyberranger@lemmy.world to programmer_humor@programming.dev
https://lemmy.world/pictrs/image/b6ade8d5-0290-4a68-951f-f3277bd1074b.jpeg
Comments
devious@lemmy.world 1 year ago
rikudou@lemmings.world 1 year ago
Has anyone actually read through that? Reading the first few examples and it’s just not understanding how languages work half of the time:
!!"false" == !!"true"; // -> true !!"false" === !!"true"; // -> true
Wow, no shit, non-empty string coerces to true, who would’ve guessed! Did you know that
!!“bullshit” === !!“true”
as well? Mind=blown.NaN === NaN; // -> false
Again, no shit, that’s in the NaN specification and the page even mentions it, so why even include it?
noli@programming.dev 1 year ago
Which is why I’m of the opinion that dynamically typed languages are evil. !!“false” should either be caught at compile time or raise an exception.
I’m thoroughly convinced that the only use of dynamically typed languages is to introduce bugs
darcy@sh.itjust.works 1 year ago
NaN===NaN
is the fault of the floating point standard tho i believe.icesentry@programming.dev 1 year ago
Also, a huge proportion of the list is just not understanding IEEE floats behaviour and blaming the language for it. Exactly like this post is doing. All those weird number things js does is because it only uses floats for everything and every language that uses floats will behave the exact same way.
MonkderZweite@feddit.ch 1 year ago
So, uh, first example, the developer decided instead of comparing based on type, he rather converts the values? Why?!
nxfsi@lemmy.world 1 year ago
The tech equivalent of inventing leaded gasoline.
MentalEdge@sopuli.xyz 1 year ago
Ah. The shork did the math. This explains a lot.
DanielCF@discuss.tchncs.de 1 year ago
You just have to look at the problem from a different angle.
Cocoa6790@kbin.social 1 year ago
Not enough alcohol involved.
MonkderZweite@feddit.ch 1 year ago
What is this image from?
FehrIsFair@lemmy.world 1 year ago
This image is fan art of Gawr Gura from Hololive EN’s 1st Gen VTuber group HoloMyth.
She is their most subscribed talent and is known for being computationally challenged.
MonkderZweite@feddit.ch 1 year ago
Thanks!
tun@lemm.ee 1 year ago
Approach the problem from different angle!
AbsolutelyNotCats@lemdro.id 1 year ago
Just a reminder that JavaScript was developed in 10 days, the same amount of time i spend fixing bugs when i miss a “,”
SnipingNinja@slrpnk.net 1 year ago
The world was made in 7 days, so it should have been 3 days left up develop js
AbsolutelyNotCats@lemdro.id 1 year ago
This sounds more credible than the big bang theory. I no longer believe in science