3 ms·
May I suggest more line breaks, and fewer inline if statements. The two would make your code more readable.
by MatthewPhillips 14y ago
May I suggest more line breaks, and fewer inline if statements. The two would make your code more readable.
- ianstormtaylor 14y agoMaybe. I've actually adopted the style from Backbone itself. https://github.com/documentcloud/backbone/blob/master/backbone.js https://github.com/documentcloud/backbone/blob/master/backbo... I've found that while it make individual methods harder to read, maybe, it helps with readability of the file in general. If your methods stay small and are well named, you don't need to read their internals as often, but scanning the file quickly, it's much easier to get a big picture. I used to be very liberal with line breaks, but then seeing methods as their own blocks gets harder. It's just a trade-off. Those example methods could probably use a single line break each, I'll give ya that :p