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

> Similarly I prefer Pythons indent to {}’s. Which can technically make your code harder to read

I started out having a similar opinion to you, and have completely flipped.

1. There's very little advantage to the whitespace option apart from aesthetics. Depending on your coding style, you gain 0-2 vertical lines.

2. Meaningful whitespace makes it more difficult to write code that writes code. Is it possible to manage the indents properly? Yes. Is it more difficult? Yes.

3. IMO, meaningful whitespace is what gimped lambda in Python (as compared to Ruby, where it's extremely powerful and used frequently). I'd rather have lambda + map/filter/reduce than comprehensions. Comprehensions are nicer when the code is simple and worse when it's complex.

I'm curious why you prefer Python's meaningful whitespace over explicit delimiters?



I don’t mind the {}s too much, maybe the primary reason I dislike them is actually more to do with the fact that I’m Danish and I’ll need to press option+shift+7 to make a { on my Mac… or similarly annoying combinations depending on the machine/OS. I think I once had a windows laptop where I needed to press FN + something.

Anyway, when your language adds extra letters to the keyboard ÆØÅ in my case then they have to take the space from other things and since {}’s are rarely used they were one of the “obvious” choices.

On the flip side I don’t think the curley brackets add much to the readability.


I'm European, I lived in Denmark for pretty long, and I found it a great quality-of-life improvement to switch to ANSI keyboards, or at least to an ANSI layout.

By defining a compose key, you can type á, é, å, ø, ß, §, plus many other symbols, with relative ease, while still having all keys in the right place to program.

For instance, using Emacs with any ISO layout is much harder.




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

Search: