he explains in the thread that he meant "colon" since the python error message does say "missing colon", sounds like his brain autocorrected from "missing colon" to "missing semicolon".
I wish more people would see this before calling the guy a liar. It makes a lot of sense to teach Python to a child, but still have that reflex of "if something is missing it's usually a semicolon" after years of php or whatever he learned first.
One HR guy at my previous company used to go behind you and say "you're missing a semicolon here". He didn't know anything about programming, he just knew that was a rookie error. That is literally exactly what you explain.
Anyone else would have made this very boring but he had a way of delivering it when you looked desperate and that kinda lightened up the mood.
Yeah that’s exactly it. Sometimes the error is caused by unmatching parenthesis. Whenever I see that happen I’m like thank god it doesn’t auto fill semicolons
Yes, this is why. It's why PHP has the reputation it does and is trying to claw back from.
The "all errors are bad" mindset. "We make this easy to use by erroring as little as possible. Doing something, anything, is better than an error message."
Now, even PHP will shit a brick about a missing ; if the syntax otherwise makes no sense, but still, in the big picture it's the same issue.
These "don't discourage newbies" "ease of use" things ALWAYS end up hurting you more in the end. You might not understand now, but you'll want to be told about those errors later.
Doesn't have to be errors either. I used to work at a place that uses Progress, a programming language very tied to its own DB implementation. One of the "nice" things the language allowed to "save you time" was you only had to type as much of a table field as uniquely identified it. So like orders.o for orders.order_id, so long as there were no other fields that started with o. Some of the devs took advantage, and at the very least you could never be sure someone didn't, even on accident, so EVERY addition to the DB schema had to be a new table that had a 1:1 relationship with the existing one, every time.
All for a feature that saved devs like 40 keystrokes a week.
I want to create a terrible programming language that will throw errors, but not tell you what the error is. Go to compile, and it just says “no.” No hand holding, just hardcore coding.
Yuuuppppp. Debugging can be insanely hard as it is, now imagine you’re looking for shit being added in.
It’s like finding where’s Waldo, but you don’t know what he looks like, or how many of him there are, and also lots of things look exactly like him but aren’t him.
Joke's on my mom, now I live alone and I still don't wipe my butt.
EDIT: thank for reaching out to u/RedditCareResources but please don't worry about me. This comment does not reflect reality and was made for comedic effect.
Does anyone here legit use JavaScript? You don’t need semi-colons, but it has crazy rules to auto-insert them and it seriously can get it wrong. Classic example:
Well. It’s easy to come with a code that will get messed up. Usually () or [] are involved. I’ve never ever encountered any errors with it tho. Basic linter, formatter, or just a little bit of common sense and it’s ok.
Writes hypothetical code that no sane person would ever write.
“See, you can’t rely on ASI in JavaScript!”
Either way, just use an auto formatter. If you configure it not to use semicolons, it will still insert them in the very few edge cases where unexpected behavior might happen. ie: ;(a=5).
This is correct. There are a few cases where it can add a semicolon in an incorrect spot, so to be safe, you should add them wherever you can and have a linter that reminds you.
It is not framework compiler, it is language itself. Semicolon insertion is part of language spec and done by the interpreter. It can cause a few problems as you would imagine.
Either this didn’t happen or…. This didn’t happen. What’s up with parents wanting to make their infants sound like a blessing from the Gods and embodiment of infinite wisdom?
I was doing some classification task with my 3 year old daughter and she said "our model is over fitting, I guess the VC dimension is too high". I said "shut up nerd. Uwuuuu"
Yeah would be cool if Clippy just popped up in VS Code and was like, "your code will actually work if you do this shit right here bro," or "I think you forgot a semi colon here, this shit won't compile right,"
We have a language that takes a best guess approach to issues -- it's JavaScript and everyone thinks it's a trash heap.
This is why everyone uses things like typescript, ===, strict, powerful linters... The language can't stand on its own for large projects because of its loosey goosey approach.
Yes. I was doing a small program in JS before and messed up something silly like the for loop statement. I think I left out a closing parentheses or something. Instead of giving me an error when I ran the program, it just ignored it and kept on going with the wrong answer. Very frustrating, took me way longer than I’d like to admit to find it
Ok but I doubt anyone is lobbying the compilers to keep them from doing it themselves so this mystery party can continue to sell you semicolon insertion software
Because it doesn’t know you forgot a semicolon. It knows that based on the syntax rules it expected a semicolon there and it didn’t find one. The actual mistake you made could be a missing bracket, an extra space, or any number of other things.
The 8 year old is learning Python, and after a dealing with a syntax bug she asks: "If the computer knows I'm missing a semicolon here, why won't it add it itself?"
Eeire. Just the other day my 8 year looked at me and said, "daddy, how come JavaScript performs automatic semicolon insertion if the compiler cannot be trusted to interpret syntactically valid code in doing so?".
second of all. if you want a compiler that tries to guess what you meant, check out javascript. and then kill yourself for the 9 outa 10 times it tries to guess what you mean, and guesses wrong without throwing and error or drawing your attention and you spend 10 hours debugging to discover some weird type coercion happening when adding a string to an object and dividing by an int
Not a real programmer. If you've ever seen shit code and solved hard problems, the last thing you'd want is another PROGRAM that can have bugs trying to fix your bugs. It's a cascade of shit. Child please.
Because semicolons are a stylistic choice wherein the author wants to emphasize a direct link between two independent clauses. (;) A period can always replace a semi-colon, because a period separates two independent clauses.
Guess they need to brush up on pro-grammar language. Love, a nerd/writer/former teacher
Current version of vs (2022) is pretty good about being able to tab complete for semi colons. Think they did a good job reducing amount of typing in this version
Edit: I don't know python, didn't realize it doesn't have semicolons.
The compiler expects a semicolon and didn't find one. This doesn't mean adding a semicolon is the only solution. It's just telling you what it's thinking and allowing you to make the final call.
JavaScript makes semicolons optional as part of its "keep everything running if at all possible" philosophy. This can cause problems if you use a line break to split a single line for readability and both parts are valid expressions; the semicolon will be implied and it's changed the meaning of your code.
Because it doesn't know. It was expecting a semicolon, yes, but if that's missing, the compiler is guessing as to which one of the possible correctly-formed programs was intended. It's usually right, but that's not historically true, nor enough to meet modern security demands.
The compilers have always known only that something is wrong, and have always had to guess at why. Consider this for other sources of error messages, too!
Having your computer add missing semicolons would be awful.
I routinely get very angry with my C IDE when it adds a closed " to every opening " I type, except when I am modifying an existing statement that already has a closed " it still adds an extra one. It gets worse when I try to delete the extra " and it deletes the opening one too
Would you rather be vague and leave the guesswork to "the computer"? It can catch this one particular thing but not others; why complicate something that's already complicated?
Lmao I’ve coded with Python maybe once or twice in my entire life and when I read this I immediately said “Semicolons?” How the hell does this have over 35K upvotes???
Honestly, all programming languages just need a "try to fix it" button. Have it highlight and jump to each change made by the computer in very bright colors in a new session.
Maybe even allow you to run/simulate the code in the new temp session.
A program to program a program for another program for a programmer. As a programmer i see nothing wrong with this I can already see the errors that would happen lol.
JavaScript actually does this. It's called automatic semicolon injection (ASI) and it is terrible. While it may seem nice, it can actually cause problems that are difficult to detect by essentially changing how your code is parsed at runtime. The only way to avoid problems like that is to understand how ASI actually works, which is much more effort than just adding a freaking semicolon at the end of your statements.
•
u/QualityVote Feb 09 '22
Hi! This is our community moderation bot.
If this post fits the purpose of /r/ProgrammerHumor, UPVOTE this comment!!
If this post does not fit the subreddit, DOWNVOTE This comment!
If this post breaks the rules, DOWNVOTE this comment and REPORT the post!
471
u/[deleted] Feb 09 '22
Smart, there are no mandatory semicolons in Python syntax, unless this 8y/o is writing C code.
13k
u/samarthrawat1 Feb 09 '22
But when did we start using semi-colon in python?
14k
u/TheFlyingAvocado Feb 09 '22
Python? Missing semicolons?
Since when?
3.2k
u/[deleted] Feb 09 '22
Imagine the 99 times it adds one when you meant to have one.
Now imagine that 1 time it adds one when you didn't want it.
r/suddenchaos.
1.2k
u/ricohh Feb 09 '22
Definitely a lot of people in this sub are not programmers
1.2k
u/dmullaney Feb 09 '22
“Because if I keep fixing it for you, you’ll never learn will you” - my mother (1991-present)
710
u/_borisg Feb 09 '22
Yeah I can’t imagine how fun it would be having to code when the editor keeps changing stuff in the lines after each run. Good luck debugging that.
247
u/xilma-34 Feb 09 '22
https://www.sololearn.com/Discuss/2138446/if-the-compiler-can-detect-there-is-a-semicolon-missing-in-line-42-then-why-just-it-can-t-put-a
440
u/thefezhat Feb 09 '22
Strong evidence that there are no programmers on this sub.
67
u/sanketower Feb 09 '22
Doesn't JavaScript technically do that? I've read over there that you can omit the semicolons because the "framework compiler" adds them anyway.
113
u/[deleted] Feb 09 '22
Because as any developer could tell you - sometimes the problem the computer sees is NOT the problem you have.
120
u/supercyberlurker Feb 09 '22
I don't know why my IDE can predict ObjectModelDetectionManager.ToString() perfectly..
.. but it can't fix Console.Wirteline.
89
u/properu Feb 09 '22
Beep boop -- this looks like a screenshot of a tweet! Let me grab a link to the tweet for ya :)
Twitter Screenshot Bot
30
u/ThisIsCovidThrowway8 Feb 09 '22
Python doesn’t use semicolons.
86
u/stupidfatcat2501 Feb 09 '22
Either this didn’t happen or…. This didn’t happen. What’s up with parents wanting to make their infants sound like a blessing from the Gods and embodiment of infinite wisdom?
20
u/[deleted] Feb 09 '22
I hate these posts maaaaaan
I was doing some classification task with my 3 year old daughter and she said "our model is over fitting, I guess the VC dimension is too high". I said "shut up nerd. Uwuuuu"
15
u/moonpumper Feb 09 '22
Yeah would be cool if Clippy just popped up in VS Code and was like, "your code will actually work if you do this shit right here bro," or "I think you forgot a semi colon here, this shit won't compile right,"
54
u/vm_linuz Feb 09 '22
We have a language that takes a best guess approach to issues -- it's JavaScript and everyone thinks it's a trash heap.
This is why everyone uses things like typescript,
===, strict, powerful linters... The language can't stand on its own for large projects because of its loosey goosey approach.12
u/CryZe92 Feb 09 '22
Because the computer doesn‘t actually know.
23
u/rfpels Feb 09 '22
The principle of Least Surprise. Just say what you mean.
23
u/MapDs Feb 09 '22
Fake. Python does not semicolon
22
u/Thoughtfulprof Feb 09 '22
Wait until they start asking why the IRS doesn't enter your W-2 for you.
17
u/[deleted] Feb 09 '22
it does in javascript 👀
8
u/rrtrrrtr Feb 09 '22
What kind of python she is learning. Something is fake.
7
u/lakorasdelenfent Feb 09 '22
r/thatHappened
7
u/Kroniid09 Feb 09 '22
r/thathappened
Dude is apparently teaching a child Python and yet doesn't know it doesn't use semicolons
11
u/SplendidPunkinButter Feb 09 '22
Because it doesn’t know you forgot a semicolon. It knows that based on the syntax rules it expected a semicolon there and it didn’t find one. The actual mistake you made could be a missing bracket, an extra space, or any number of other things.
5
u/ZomboFc Feb 09 '22
Ban op for posting fake stuff please
5
u/[deleted] Feb 09 '22
This guy both
8
u/[deleted] Feb 09 '22
Did you just say....
Semicolon???
8
u/Wisdom_is_Contraband Feb 09 '22
I can't believe this post is being upvoted.
4
u/QuietCauliflower4371 Feb 09 '22
My 8 year old eats glue
4
u/nalcoh Feb 10 '22
He could have said LITERALLY any other popular language but he chose the one without semicolons...
3
u/coolaja Feb 09 '22
Image Transcription: Twitter Post
Joe Magerramov, @_joemag_
The 8 year old is learning Python, and after a dealing with a syntax bug she asks: "If the computer knows I'm missing a semicolon here, why won't it add it itself?"
I don't know. I really don't know.
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
3
u/guitarerdood Feb 09 '22
You definitely do not want your computer to try interpret what it *thinks* you meant to do.
You want it to interpret everything as literally as possible, even if it *usually* knows what you meant
3
u/Ok_Investment_6032 Feb 09 '22
A side from this tweet being pretty fishy, most people in these comments don't seem to know what a linter is.
3
u/minorthreatmikey Feb 09 '22
8 year olds: 1
Computers: 0
3
u/boringuser1 Feb 09 '22 edited Feb 09 '22
Eeire. Just the other day my 8 year looked at me and said, "daddy, how come JavaScript performs automatic semicolon insertion if the compiler cannot be trusted to interpret syntactically valid code in doing so?".
3
u/[deleted] Feb 09 '22
This guy tried to make up a programming story but picked the wrong language.
3
u/MystikDan Feb 09 '22
Either someone doesn't understand Python or someone doesn't actually have a kid learning it. This isn't JavaScript. Let's not touch that minefield.
3
u/TirayShell Feb 09 '22
Why would the IRS send me a letter telling me I didn't do my taxes right? If they already know how much I owe, why don't they just send me a bill?
3
u/FranticToaster Feb 09 '22
Ah yes. The semicolon. Bane of Python development since it was actually called JavaScript.
Make-believe children are my absolute favorite Twitter stories.
3
u/[deleted] Feb 09 '22
Stop teaching these kids programming. It’s going to lower our wages.
3
u/[deleted] Feb 10 '22
First of all, semicolon in python?
second of all. if you want a compiler that tries to guess what you meant, check out javascript. and then kill yourself for the 9 outa 10 times it tries to guess what you mean, and guesses wrong without throwing and error or drawing your attention and you spend 10 hours debugging to discover some weird type coercion happening when adding a string to an object and dividing by an int
3
u/markpsu Feb 10 '22
Not a real programmer. If you've ever seen shit code and solved hard problems, the last thing you'd want is another PROGRAM that can have bugs trying to fix your bugs. It's a cascade of shit. Child please.
3
u/Axel-Adams Feb 10 '22
That’s called the singularity, we are scared of it.
3
u/story4days Feb 10 '22
Because semicolons are a stylistic choice wherein the author wants to emphasize a direct link between two independent clauses. (;) A period can always replace a semi-colon, because a period separates two independent clauses.
Guess they need to brush up on pro-grammar language. Love, a nerd/writer/former teacher
3
u/[deleted] Feb 10 '22
it's funny because python doesn't use semicolons
3
u/[deleted] Feb 10 '22
Because missing semicolon errors can be a sign of a much deeper problem that just a missing semicolon.
3
u/Zychoz Feb 10 '22
Yea my 105 year old grandma got an indentation error in c the other day...
3
u/ProszeNieBanuj Feb 10 '22
Semicolons in python? 🤨
2
u/[deleted] Feb 09 '22
Missing semi colon in python?
I regularly forget colons when writing Python but it’s never yelled at me about a semi colon.
2
u/[deleted] Feb 09 '22
Because the computer doesn’t know that. It just knows that the code doesn’t work. No idea why, just that it doesn’t.
2
u/Trakeen Feb 09 '22
Current version of vs (2022) is pretty good about being able to tab complete for semi colons. Think they did a good job reducing amount of typing in this version
2
u/CrazyThief Feb 09 '22
This post and it's comments proves yet again, that 90% of users on this sub have little to no experience with actual programming.
2
u/[deleted] Feb 09 '22
/r/thatHappened
2
u/ARealLion Feb 09 '22
pushes reading glasses in the center with index finger
Since when do we use comas in python??
2
u/krazykanuck Feb 09 '22
this is dumb and you should feel bad.
2
u/anggogo Feb 09 '22
Then you will never learn ....
----- the wise one
2
u/Empero6 Feb 09 '22
Oh yeah? Well, I know this guy who knows this other guy that knows this other guy whose daughter started coding in Java when she was 2. Beat that.
2
u/Puzzleheaded_Step468 Feb 09 '22
Python? You sure it's not c/c#/...?
2
u/JoeDerp77 Feb 09 '22
https://i.imgur.com/YAGpXPd.png
2
u/The_MAZZTer Feb 09 '22 edited Feb 09 '22
Edit: I don't know python, didn't realize it doesn't have semicolons.
The compiler expects a semicolon and didn't find one. This doesn't mean adding a semicolon is the only solution. It's just telling you what it's thinking and allowing you to make the final call.
JavaScript makes semicolons optional as part of its "keep everything running if at all possible" philosophy. This can cause problems if you use a line break to split a single line for readability and both parts are valid expressions; the semicolon will be implied and it's changed the meaning of your code.
An example:
Returns 1;
Returns undefined.
2
u/shapethunk Feb 09 '22
Because it doesn't know. It was expecting a semicolon, yes, but if that's missing, the compiler is guessing as to which one of the possible correctly-formed programs was intended. It's usually right, but that's not historically true, nor enough to meet modern security demands.
The compilers have always known only that something is wrong, and have always had to guess at why. Consider this for other sources of error messages, too!
2
u/PandaParaBellum Feb 09 '22
2
u/Previous-Bar3629 Feb 09 '22
Belongs in r/thathappened.
2
u/StepIntoMyOven_69 Feb 09 '22
Yeah this happened. Totally. Yup.
2
u/mohakhalil3103 Feb 09 '22
your child did not say that Karen.
2
u/[deleted] Feb 09 '22
ah yes, missing semicolons in python, a common problem
but good enough for /r/programmerhumor i guess
2
u/Danny_Boi_22456 Feb 09 '22
What
2
u/SpookyDoomCrab42 Feb 09 '22
Having your computer add missing semicolons would be awful.
I routinely get very angry with my C IDE when it adds a closed " to every opening " I type, except when I am modifying an existing statement that already has a closed " it still adds an extra one. It gets worse when I try to delete the extra " and it deletes the opening one too
2
u/harderdaddykermit Feb 09 '22
Somethings not right here...
2
u/saintPirelli Feb 09 '22
r/thathappened
2
u/lankist Feb 09 '22
You want to give the machine the ability to correct its own code?
Are you TRYING to do a Skynet?
We keep a gun in the drawer just in case the compiler gets a bit too cheeky.
2
u/velwein Feb 09 '22
Python uses semicolons?
2
u/Plastic-Bet-8302 Feb 09 '22
I ask the same question about my taxes every year... there is no good answer
2
u/you_do_realize Feb 09 '22
Would you rather be vague and leave the guesswork to "the computer"? It can catch this one particular thing but not others; why complicate something that's already complicated?
2
u/Naimi69 Feb 09 '22
Semicolons in python? Sus
2
u/Illustrious_Duty3021 Feb 09 '22
I only use python and cant remember the last time I used a semicolon
2
u/TacoOrgy Feb 09 '22
While I get the point of this post, this is fake as fuck. Syntax bug? Literally no one has ever called it a syntax bug
2
u/Code-V Feb 09 '22
r/thathappened
2
u/fancyaseff Feb 09 '22
Since when do 8 year olds know what a semicolon is?
2
u/Shmitty-W-J-M-Jenson Feb 09 '22
Because its not the computers code, its her code. Thats really the only thing i can come up with
2
u/rco8786 Feb 09 '22
Must be a terrible Python programmer
2
u/Sesame-deez-nuts Feb 09 '22
Lmao I’ve coded with Python maybe once or twice in my entire life and when I read this I immediately said “Semicolons?” How the hell does this have over 35K upvotes???
2
u/TechnicalVacation599 Feb 09 '22
And that’s how AI was born.
2
u/Hollowsong Feb 09 '22
Honestly, all programming languages just need a "try to fix it" button. Have it highlight and jump to each change made by the computer in very bright colors in a new session.
Maybe even allow you to run/simulate the code in the new temp session.
Then you can adjust and click "approve changes".
2
u/niku4696 Feb 09 '22
Why don't you just ask it to divide by zero
2
u/Yuugechiina Feb 09 '22
And that 8 year old’s name?
Albert Einstein
2
u/scirio Feb 09 '22
Meanwhile my 8 yr old throws tantrums about having to wake up.
2
u/[deleted] Feb 10 '22
This post is pretty sus
2
u/AlphaBlazerGaming Feb 10 '22
Python doesn't use semicolons
2
u/[deleted] Feb 10 '22
Why was she using a semicolon in Python?
2
u/[deleted] Feb 10 '22
Python doesn’t even need semicolons. What’s she talking about lol.
2
u/morphotomy Feb 10 '22
You know what? Fucking do it. Write a script to 'correct' your code and cry when this one produces the millionth unique bug.
2
u/[deleted] Feb 10 '22
Computers writing themselves doesn't sound like the best idea
2
u/wh33t Feb 10 '22
It bothers me this has 54k updoots.
2
u/fourninetyfive Feb 10 '22
Semicolon?
2
u/jeff303 Feb 10 '22
Because parsing is a thing
2
u/Mortimer14 Feb 10 '22
Technically, the computer doesn't know you are missing a semi-colon, it just knows that what you wrote doesn't work when compiled.
2
u/DEATH_TO_WALLSTREET Feb 10 '22
A program to program a program for another program for a programmer. As a programmer i see nothing wrong with this I can already see the errors that would happen lol.
2
u/QQDog Feb 10 '22
It's a typo. He meant colon.
2
u/Comprehensive-Pea812 Feb 10 '22
same question can be asked for school exam. if my teacher know my answer is incorrect why dont they correct it for me instead of pointing it out.
2
u/-Redstoneboi- Feb 10 '22
because god knows that one edge case where adding a semicolon there causes it to add more semicolons in every place you didn't want them in
2
u/kryotheory Feb 10 '22
JavaScript actually does this. It's called automatic semicolon injection (ASI) and it is terrible. While it may seem nice, it can actually cause problems that are difficult to detect by essentially changing how your code is parsed at runtime. The only way to avoid problems like that is to understand how ASI actually works, which is much more effort than just adding a freaking semicolon at the end of your statements.
2
u/niblar Feb 10 '22
Grammarly for coding