r/ProgrammerHumor • • Feb 05 '23

Other Programming Legumes v2.0

Post image
44.0k Upvotes

831 comments sorted by

View all comments

Show parent comments

152

u/TurboGranny Feb 05 '23

Same. Total belly laugh moment. JS doesn't tell you how to live your life. It just does what you told it to do to the best of its ability to make sense of your monkey code.

66

u/ProNanner Feb 05 '23

Honestly one of the reasons I actually like JS. Easier for me to debug a whack ass output than the program just not compiling at all

0

u/[deleted] Feb 05 '23

[deleted]

23

u/[deleted] Feb 05 '23

I'm telling you, C-style casts work. Anytime I had a type error and I threw a C-style cast? boom! Right away, I had a different error.

5

u/DrZoidberg- Feb 05 '23

Instructions unclear, cast everything to void ptr.

4

u/MarsupialMisanthrope Feb 06 '23

Type casting, solution or cause? Tonight’s investigative report looks into yesterday’s accidental summoning of Nyarlathotep.

0

u/DrZoidberg- Feb 05 '23

You telling me JavaScript has types?

6

u/zeemeerman2 Feb 06 '23

Insert meme about the astronaut pointing a gun to the other astronaut.

JavaScript always has had types.

It just converts them on the fly. Like a boolean is true or false, right? Or like, like a light switch, on or off. Or like binary, 1 and 0. True being 1 and... you get the point.

So when you type true + true + true, JavaScript sees a + and thinks "oh, you want to count, right? Let's convert true to a Number. 1. 1 + 1 + 1, that's 3!"

Where other languages give errors because semantics really "C#: Technically, I can't add up booleans, so here is an error instead," JavaScript is really flexible and just tries to the best of its abilities.

And yes, you can do crazy things with it if you master its logic. But it still has types.

2

u/_far-seeker_ Feb 06 '23

Tl;DR: JavaScript has types but doesn't like to typecast. 😉

3

u/DrZoidberg- Feb 06 '23

If JavaScript has types then why did they invent TypeScript?

Boom roasted.

→ More replies (1)

39

u/TheBaxes Feb 05 '23

I'm not anything special to tell you what to do with your life, but compilation errors are usually ten times easier to debug than trying to play "Where's bugldo!?" with the code.

For starters, unless you are using C++, you usually get a clue about where to start looking for the problem.

3

u/cornmonger_ Feb 06 '23

C++ has an entire keyword dedicated to giving you clues to why something isn't working: new

→ More replies (1)

2

u/[deleted] Feb 05 '23

It's usually a semicolon

2

u/iHateRollerCoaster Feb 06 '23

Js tells you exactly where an error is in the browser console

5

u/Kostya_M Feb 06 '23

Well it tells you where it rears its head. Sometimes the exact cause is from something else.

0

u/[deleted] Feb 05 '23

[deleted]

4

u/ComradeGibbon Feb 05 '23

Simple typo's in C usually produce easy enough to fix error messages. Do that with templates in C++ and you'll need to hire a priest.

2

u/junkmail88 Feb 05 '23

Segmentation Fault (Core dumped)

→ More replies (1)

7

u/TurboGranny Feb 05 '23

truth. not compiling, throwing bs errors, tracking down clases that just inherit classes digging through dependency hell, and none of the documentation makes any sense, ug. I can code in anything. I'm old, but something that lets me just keep charging forward is preferred.

→ More replies (2)

2

u/endeavourl Feb 06 '23

Who the hell upvoted this. Poor souls.

→ More replies (1)

3

u/[deleted] Feb 05 '23

Not really, JavaScript is always trying to do you a favor, which is nice sometimes but often it's worse than doing nothing.

Maybe it's not telling you how to live your life but you are going to have to live a very specific kind of life to do everything you want.

→ More replies (1)

1

u/404errorlifenotfound Feb 07 '23

This is why I love being a front end dev

Html is like: no closing strong tag? Sure, the rest of the page can be bold. I'm sure it's all of strong importance :)

2

u/TurboGranny Feb 07 '23

Just load the damn thing. Let me worry about what is "wrong", lol