Hacker News new | ask | show | jobs
by alok-g 4094 days ago
>> But conventions are are a choice made; most times it's easier to adopt them and move on.

Which brings me to a related question. Just like color-schemes are preferences in editors and IDEs, why isn't such spacing too. Then it would not be a "choice made" a priori for all individuals.

2 comments

Because colors can be altered in any end-reader's IDE/text editor. Indentation and spacing, however, can not. At least, not safely yet.

I suppose you could run all the code you receive and have to read through a code-formatter such as YAPF. That way, no matter what "way" someone writes their code, when you read it, it'll be in your comfortable/preferred format.

Colour schemes aren't part of the text itself. However, if your IDE could automatically display your code formatted as you like while keeping the underlying text file aligned with some convention, and make that not a nightmare while editing...well, I think you're onto something there.