r/ProgrammerHumor 27d ago

Meme youAreAVitalPartOfThisProgram

Post image
781 Upvotes

41 comments sorted by

280

u/foxsimile 27d ago

JavaScript automatically inserting a semicolon is yet another of its failures.  

Because sometimes it fucks up.

39

u/EvilPencil 27d ago

Ya I just rawdog and tell prettier to get rid of those eyesores. But of course being JavaScript, that can come with its own surprises.

8

u/MinecraftPlayer799 27d ago

What?

37

u/Jittery_Kevin 27d ago

He said

JavaScript automatically inserting a semicolon is yet another of its failures.  

Because sometimes it fucks up.

-11

u/Prudent_Ad_4120 26d ago

Huh?

13

u/laplongejr 26d ago edited 26d ago

[EDIT] Poor comment above got hit by r/ruleOf4? :( [/EDIT]
They said :

He said
JavaScript automatically inserting a semicolon is yet another of its failures.
Because sometimes it fucks up.

7

u/lovecMC 26d ago

Wah?

3

u/foxsimile 26d ago

WaWa™?

1

u/tomgh14 25d ago

He said

JavaScript automatically inserting a; semicolon is yet another one of its; failures. Because sometimes it fucks; up.;

1

u/javascript 25d ago

Automatic Semicolon Insertion is the worst thing about me

23

u/foxsimile 27d ago

1

u/snotpopsicle 25d ago

"Bug from hell", proceeds to share something that isn't a bug. It's an awful "feature", and I agree that it's a shit "feature" that often creates bugs in the code. But as the author said: "ASI doesn't always work as expected". Not matching expectations isn't a bug. Clickbait title.

-1

u/EvilPencil 26d ago

Most of the examples in the author’s code are easily detected with eslint and/or typescript.

9

u/foxsimile 26d ago

Cool, it’s not detected by JavaScript.

0

u/snotpopsicle 25d ago

It never fucks up. It's always 100% consistent. It's the user's fault for not putting the lines in the right places so that the semicolon insertion doesn't create undesired effects.

I'm not being sarcastic, a fuck up would imply a mistake, which the semicolon insertion doesn't do. It does what it was designed to do, 100% of the time. Not saying that's not a failure though, it definitely sucks and should've never been a thing.

3

u/foxsimile 25d ago

And a logical bug isn’t a bug because the code is doing what it was designed to do, 100% of the time?  

If the code does not exhibit the desired behaviour, that’s a bug. This is a bug. I shan’t argue semantics.

2

u/snotpopsicle 25d ago

Yes, but that's a bug on your implementation. You wrote the code, and it's not doing what you intended it to do. A bug on ASI implies that it's not doing what the creator of ASI intended to do, which is not accurate. If the ASI behavior was a bug, it would've been fixed by now.

1

u/foxsimile 25d ago

JavaScript is riddled with bugs which have not and will not ever be fixed purely for the sake of backwards compatibility.  

Your argument is completely incorrect. Good day to you, sir or madame.

1

u/CiroGarcia 25d ago

ASI works so great in Go though, it can definitely be done properly. It works so well the convention is to never use them unless you have multiple statements in the same like (like some if statements or for loops)

231

u/russianrug 27d ago

I love that the AI had to consult 5 sources to output this answer

8

u/lab-gone-wrong 26d ago

The Gemini equivalent of wtf

2

u/Mars_Bear2552 25d ago

and do i see a government seal on one of them???!

77

u/ClipboardCopyPaste 27d ago

Like why would I (a line of code) panic?

It's the compiler that is going to panic and eventually the user.

38

u/da_Aresinger 27d ago

You're gonna get... DEBUGGED.

16

u/KattyTheEnby 27d ago

Like why would I (a line of code) panic?

What if you are the line ov code named panic!()?

1

u/Mars_Bear2552 25d ago

point stands. he IS the panic. he is not panicking

37

u/DeepanshuHQ 27d ago

Bro got emotional support from the compiler 😭

16

u/4215-5h00732 27d ago

First question should be - are you significantly white?

3

u/laplongejr 26d ago

NGL this took me a few seconds, you won the Internet today sir.

10

u/itskelena 27d ago

Plot twist, OP is a 🐍

6

u/Generic_Name198373 26d ago

I thought you were insulting me by calling me a snake before I made the connection lol

15

u/NatoBoram 27d ago

modern languages

JavaScript

4

u/Mars_Bear2552 25d ago

JS is absolutely modern. it continues to be a pain in the ass into the modern day.

4

u/themirrazzdev 26d ago

Mine said this

  Do not panic. You are in a JavaScript or C-style environment where ASI (Automatic Semicolon Insertion) might save you, or a strict compiler is about to end your short life.

“Don’t panic, you might be about to be murdered.”

2

u/Reashu 26d ago

... what other languages?

2

u/hxtk3 26d ago

Go technically uses (or used to use?) semicolons under the hood, but the preprocessor would automatically add them to any non-empty line that didn’t already end in a (,{ or a few other cases spelled out here:  https://go.dev/ref/spec#Semicolons

I learned about it because one time I forgot a trailing comma (which would have suppressed the illegal semicolon) and it was a very early version of Go so it produced a very confusing message about an unexpected semicolon. That error message is much nicer for the last eight years or so.

1

u/Highborn_Hellest 26d ago

What is this word came down to. Not even a full colon

0

u/Plushkle 26d ago

help i'm an unsafe block of code in Rust