Vitalik Buterin pfp
Vitalik Buterin
@vitalik.eth
"continue" might be the worst-named keyword in python. Like, consider this code: for i in range(100): if i % 5 == 0: continue print(i) It prints out numbers that are not multiples of 5. But if you give it to someone who is not experienced in python, they might think the exact opposite!
48 replies
126 recasts
578 reactions

Mark V. pfp
Mark V.
@mikroskeem
If Python has it wrong, then other languages have it too - that being said, it's great that Python does not diverge too much with keywords from most commonly used languages.
1 reply
0 recast
3 reactions

Nico pfp
Nico
@nicom
Well just revert the condition then, why make things complicated? for i in range(100): if i % 5 != 0: print(i)
2 replies
0 recast
8 reactions

links 🏴 pfp
links 🏴
@links
Honestly never thought about it like that. It’s a common keyword in a ton of languages: C/C++, Java, JS, PHP, etc. Does python handle it differently than other languages? Seems like they all treat it the same.
0 reply
0 recast
7 reactions

karmacoma pfp
karmacoma
@karma
feels pretty natural when you come from C/Java/other imperative language
0 reply
0 recast
1 reaction

Suhail Kakar pfp
Suhail Kakar
@suhailkakar
also, `except` try: some_function() except SomeError as err: some_handle(err) why isn't it called catch like literally everywhere else in humanity?
0 reply
0 recast
1 reaction

Garrett pfp
Garrett
@garrett
moose
0 reply
0 recast
1 reaction

Koolkheart pfp
Koolkheart
@koolkheart.eth
I’ve seen so many beginner devs get tripped up by this exact keyword. It feels intuitive only after you've learned what it really means
0 reply
0 recast
0 reaction

joshisdead.eth pfp
joshisdead.eth
@joshisdead.eth
$moose might chew this
0 reply
0 recast
4 reactions

Mirko 🔵🟡 .⌐◨-◨ pfp
Mirko 🔵🟡 .⌐◨-◨
@netnose
I think break, continue and goto are the biggest code smell ever. I always ask to remove them if possible during reviews!
1 reply
0 recast
3 reactions

Tempe Techie pfp
Tempe Techie
@tempetechie.eth
What would be better? "skip", "ignore", "next"?
1 reply
0 recast
2 reactions

⋆♱ 9̷0̷†մղ ♱⋆  pfp
⋆♱ 9̷0̷†մղ ♱⋆
@90tun
what then should be used, skip?
2 replies
0 recast
2 reactions

bendr 🔵🎩 pfp
bendr 🔵🎩
@bendr.eth
I think this makes sense. Continue as in continue the loop
0 reply
0 recast
2 reactions

Fots pfp
Fots
@fots
i believe it is natural, because it intuitively means to continue the loop - just skipping the rest of the current iteration. once you understand that the loop itself keeps running, the keyword makes perfect sense
0 reply
0 recast
1 reaction

Patrick Atwater pfp
Patrick Atwater
@patwater
Hard disagree This is actually pretty plain language from the perspective of formal logic The standard isn't lay person English or any lay language Python is amazing at being intuitive for the mathematically inclined That's the one trained in pencil and paper math this makes total sense And it's something that makes sense with a simple addition of tabbing
0 reply
0 recast
0 reaction

Rafi pfp
Rafi
@0xrafi
Can devs do something
0 reply
0 recast
0 reaction

abranti pfp
abranti
@abranti
what would you name it?
0 reply
0 recast
0 reaction

Bochen pfp
Bochen
@doper
Seriuus q: where you feel the most someone’s breath on your neck?
0 reply
0 recast
0 reaction

Asbam pfp
Asbam
@mitrander
Good
0 reply
0 recast
0 reaction

Mrnv pfp
Mrnv
@mrnv
The word "continue" can be really confusing, especially for beginners. It seems logical to expect that when continue is triggered, the code will continue executing the remaining instructions inside the loop, rather than jumping over them.
0 reply
0 recast
0 reaction