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!
37 replies
120 recasts
636 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

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

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
7 reactions

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

OPi pfp
OPi
@opimedia
When the keyword it taken in this wrong meaning… that makes no sense. Because that makes no senses to put a keyword to continue to the next line. This is the usual execution path. So, even for not experienced (whatever Python or not), it is a big hint that the meaning of this keyword is something else.
0 reply
0 recast
0 reaction

Wai Chung pfp
Wai Chung
@waichung
Believe in Vitalik
0 reply
0 recast
0 reaction

Victor.mit pfp
Victor.mit
@victormit
What is this mean sir?
0 reply
0 recast
0 reaction

no-side666 pfp
no-side666
@no-side666
continue keyword appears in many other major languages. I think anyone who can't look up what it means and figure it out has serious skill issues. The worst thing about python I'd say is the lack of goddamned braces. WTF!!! In trying to be "friendly" they make it confusing as hell.
0 reply
0 recast
0 reaction