3 ms·
1 - That's the job of a linter 2 - automatically generated code has no obligation to be idiomatic 3 - If I had a cent for every time "idiomatic" code got in t
by raverbashing 10y ago
1 - That's the job of a linter
2 - automatically generated code has no obligation to be idiomatic
3 - If I had a cent for every time "idiomatic" code got in the way of readability I'd be a millionaire right now
- Retric 10y agoIf writing idiomatic code is causing readability problems your doing it wrong. Successful code is read far more than it's written and even machine generated code needs to be well written to locate bugs etc. iF YoR CodE LoOks lIKe tHIs, yOu FaIl.
- raverbashing 10y ago> If writing idiomatic code is causing readability problems your doing it wrong. Sure, because breaking a 82 char line in python in 2 lines (because pep8) is much more readable than leaving it at 82 chars.
- Retric 10y agoA 65+ character line is already ugly. 80 is an arbitrary but sensible cutoff.
- raverbashing 10y agoSpeak for yourself a = "a long message with 70 chars..." vs a = ("a long message..." " with 70 chars...")
- Retric 10y agoYou should not be using long messages in code, for one thing you can't localize them across multiple languages. You can do: A = \ "A really long string" But, the odds are really good you are making a mistake.
- raverbashing 10y agoReadability is still bad in your example, and not all projects require localization (not to mention usage of \ is not encouraged)