Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I think my main superficial turn-off was indeed the non-traditional loops and I was a fan of python whitespace indentation

I've always been perplexed that this, a very small thing that barely ever comes up since 99% of the time you are doing a for each loop anyway, is the main turn-off for people learning Ruby, when Python has those crazy weird if statements and indentation-sensitivity



What do you mean crazy weird if statements? You can do one liners, or if you don't your indentation is similar to what you'd see in C++.

if condition: return expression if condition: foo = value

or

if condition: body statements elif condition: body statements else: body statements


Indent by

  two spaces
to get your line breaks to show up.


Yes, I do this, and this would be great if Python officially recommended spaces, but they recommend tabs, poisoning the well further.


?

• I was talking about Hacker News markup.

• Python officially recommends spaces: https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces


The colon has always struck me as crazy weird, like we're righting C gotos or something




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: