Hacker News new | ask | show | jobs
by alfiopuglisi 628 days ago
The day your wish is fullfilled is the day I stop working with Python. I can't stand all those useless braces everywhere, why are they there at all since good practice mandates proper indentation anyway?

I am at the point where I prefer single quotes for strings, instead of double quotes, just because they feel cleaner. And unfortunately pep8 sometimes mandates double quotes for reasons unknown.

2 comments

Single quotes are also easier to type on the default layout, no Shift
No need for braces. Just add "end" for marking block ending to match the already block starting keyword ":".
A while ago, when thinking about syntax design for a new language, I considered this combination (`:` and `end`, as opposed to `do` and `end` as used by Lua etc).

Are there any languages that use it, or is Python unique in using `:` to begin a block?

Nim uses it too.

IIRC, Python's predecessor (ABC) didn't have the trailing colon but they did some experiments and found it increased readability.