3 ms·
I don't think indentation is a problem particularly. Once you're familiar with languages that use it, e.g. Python, it gets pretty natural. I did run into proble
by tghw 13y ago
I don't think indentation is a problem particularly. Once you're familiar with languages that use it, e.g. Python, it gets pretty natural. I did run into problems with the 2 space indentation, however, because with certain character combinations, it's difficult without a second look to be sure.
I would argue there are bigger problems with CoffeeScript, such as empty blocks being legal. For example:
if foo
bar()
Is totally legal. But 99% of the time, you really mean:
if foo
bar()
In Python, the former is a syntax error and there is an explicit pass call to demonstrate that the block is empty. But in coffeescript, it's easy to accidentally write that code and it looks right when you're doing a quick read through. Again, I think 4 spaces would help as you would be expecting a larger indentation.
- rmrfrmrf 13y agoThat's not legal in CoffeeScript either. I just tried it on the CS website and got the message "ERROR ON LINE 1: UNEXPECTED POST_IF".
- tghw 13y agoThat might be new. We definitely had a bug in earlier versions of Trello due to that, so it stuck out in my mind as one of the places that Python did it better.