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

Please just don’t make the opinionated formatted use two space indentation. That is one of the craziest recent trends in the JS ecosystem.



Can you say what you’d prefer and why? I often use very large fonts, well large compared to my peers, when coding and really prefer tabs as I can define their width myself.


Not OP, but I also tabs. Usually I set tab to 4 spaces as 2 space is too little to clearly see the indentation, but in frontend projects usually I'd need to set it to 2 as otherwise the JSX layout would easily overflow horizontally. JS also prefer callback-style code that requires another indentation, which might not always be possible to replace with await.


Tabs, four spaces, hell even three spaces. I care very little about formatting as long as I can understand quickly what I’m looking at. So basically anything greater than two spaces.


Spaces in indentation feel like an artifact of bygone era when we didn't have proper tooling and had to do everything manually, one keystroke at a time. Personally I just hit TAB and commit whatever is in default config of autoformatter utility.


Same here. It encourages deep indentation and at the same time makes the indents harder to quickly parse.

Also single bloody quotes. Why?


> Also single bloody quotes. Why?

Because double quotes requires two keystrokes. Single quotes requires one. The only defense of double quotes is an appeal to history.


Not everyone uses the same keyboard you do. With a German layout it's much easier for me to type double quotes.

That's not to say everyone should use them, but reality is more nuanced than you make it seem.


I can see why people may take issue with tabs VS spaces, that's as old a debate as programming languages themselves. But taking issue with single quotes is just on another level of bike shedding! WTF is wrong with single quotes???


Single quotes are quite a common English punctuation character. Particularly in the strings I tend to hardcode in programs, it is way more likely that I need to write a single quote than I do a double quote.

When that happens, I have to escape the quote (if the language even allows escapes in single quoted strings) or change the whole string to double quotes.

Because typing a single quote will break parsing, it's also hard for tooling to assist. If I put a single quote unescaped, the auto formatter will probably barf.


I prefer backtick.


The truly patrician choice.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: