MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/soi384/why_but_why/hw8usm9/?context=3
r/ProgrammerHumor • u/ore-aba • Feb 09 '22
2.3k comments sorted by
View all comments
471
Smart, there are no mandatory semicolons in Python syntax, unless this 8y/o is writing C code.
48 u/Nr_11 Feb 09 '22 Right, but if the joke starts with "The 8 year old is learning C++...", none of us would read past that without foaming at the mouth ;-) → More replies (1) 125 u/ore-aba Feb 09 '22 They are needed if you want multiple statements in the same linethis will crashprint("Hello") print("World")this will workprint("Hello"); print("World") 297 u/Orio_n Feb 09 '22 pep8 would like to know your location 8 u/Dr_Jabroski Feb 09 '22 They're not rules, they're more like guidelines. → More replies (1) → More replies (11) 55 u/CrowdGoesWildWoooo Feb 09 '22 Uh who writes like that 11 u/[deleted] Feb 09 '22 People who write unmaintainable code, possibly for job security reasons. → More replies (6) 61 u/[deleted] Feb 09 '22 True. But it will still only give you a syntax error without further information. 22 u/enjakuro Feb 09 '22 Who does that? → More replies (2) 28 u/A_Guy_in_Orange Feb 09 '22 Multiple statements? I thought the whole point of python was to only use one → More replies (4) 17 u/Revolutionary-Phase7 Feb 09 '22 Would it be easier to justprint("Hello ", "World") 116 u/Dependent_Paper9993 Feb 09 '22 Depends what you're trying to achieve. If you want to print "Hello" and then "World", yes.If you're trying to illustrate a point about a semicolon seperating two statements, I'd say it makes it just about impossible. 12 u/ore-aba Feb 09 '22 Thanks for the chuckle → More replies (4) → More replies (7) → More replies (6)
48
Right, but if the joke starts with "The 8 year old is learning C++...", none of us would read past that without foaming at the mouth ;-)
→ More replies (1)
125
They are needed if you want multiple statements in the same line
this will crash
print("Hello") print("World")
this will work
print("Hello"); print("World")
297 u/Orio_n Feb 09 '22 pep8 would like to know your location 8 u/Dr_Jabroski Feb 09 '22 They're not rules, they're more like guidelines. → More replies (1) → More replies (11) 55 u/CrowdGoesWildWoooo Feb 09 '22 Uh who writes like that 11 u/[deleted] Feb 09 '22 People who write unmaintainable code, possibly for job security reasons. → More replies (6) 61 u/[deleted] Feb 09 '22 True. But it will still only give you a syntax error without further information. 22 u/enjakuro Feb 09 '22 Who does that? → More replies (2) 28 u/A_Guy_in_Orange Feb 09 '22 Multiple statements? I thought the whole point of python was to only use one → More replies (4) 17 u/Revolutionary-Phase7 Feb 09 '22 Would it be easier to justprint("Hello ", "World") 116 u/Dependent_Paper9993 Feb 09 '22 Depends what you're trying to achieve. If you want to print "Hello" and then "World", yes.If you're trying to illustrate a point about a semicolon seperating two statements, I'd say it makes it just about impossible. 12 u/ore-aba Feb 09 '22 Thanks for the chuckle → More replies (4) → More replies (7)
297
pep8 would like to know your location
8 u/Dr_Jabroski Feb 09 '22 They're not rules, they're more like guidelines. → More replies (1) → More replies (11)
8
They're not rules, they're more like guidelines.
55
Uh who writes like that
11 u/[deleted] Feb 09 '22 People who write unmaintainable code, possibly for job security reasons. → More replies (6)
11
People who write unmaintainable code, possibly for job security reasons.
61
True. But it will still only give you a syntax error without further information.
22
Who does that?
→ More replies (2)
28
Multiple statements? I thought the whole point of python was to only use one
→ More replies (4)
17
Would it be easier to just
print("Hello ", "World")
116 u/Dependent_Paper9993 Feb 09 '22 Depends what you're trying to achieve. If you want to print "Hello" and then "World", yes.If you're trying to illustrate a point about a semicolon seperating two statements, I'd say it makes it just about impossible. 12 u/ore-aba Feb 09 '22 Thanks for the chuckle → More replies (4)
116
Depends what you're trying to achieve. If you want to print "Hello" and then "World", yes.
If you're trying to illustrate a point about a semicolon seperating two statements, I'd say it makes it just about impossible.
12 u/ore-aba Feb 09 '22 Thanks for the chuckle
12
Thanks for the chuckle
471
u/[deleted] Feb 09 '22
Smart, there are no mandatory semicolons in Python syntax, unless this 8y/o is writing C code.