Hacker News new | past | comments | ask | show | jobs | submit login

I don't understand why significant indentation is a bad thing. It's easier to read indentation than it is to try and match brackets in your head.

The only times it bites me is when I accidentally mix spaces and tabs in the same block, which could use a warning.




I'm more into Ruby than in JavaScript even if I have 10 years of Ruby vs 20 of JS on my shoulders. In my experience Python is always easier to read than JS. It's easier than Ruby for the part that spares me from a silly looking sequence of end end end at the end of some nested block (but that : before a new indentation level looks silly too.)

The syntax of both Ruby and Python beat squarely any C-like language, even if Python looks strange to me. Perhaps is the mix of objects and functions that makes it look a little C-ish, or the many __name__ one has to write in same cases. Anyway...

I would do without JavaScript's {} () and ; or Ruby's end (which bugged me a lot 10 years ago) but unfortunately that easier syntax is offset by the too many times it came biting me with nasty bugs after I cut and pasted code around during refactoring. Or having to take really care of how many spaces I'm deleting to match the indentation level I must reach. The editor can't autoindent all the file for me. It's bad enough when I'm working in YAML files (the format of Rails's i18n db, another ironic choice) and I don't want to deal with it in all my codebase.

So in my experience significant indentation is evil because as a matter of fact is making me less productive. Lot's of people share the same feeling, lots of people are happy with that. No problem, there are so many choices that we can always pick what's best for us.

PS: I just thought that maybe an editor could autohide Ruby's end (or color it almost away) and still be able to autoindent code. Maybe I'll try to tell emacs to color end in dark blue (black background) and see what happens to code readability.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: