4 ms·
I see the issue as: there are warnings and warnings One thing is for the compiler to warn about something like implicit conversion of one type to another. Ano
by raverbashing 10y ago
I see the issue as: there are warnings and warnings
One thing is for the compiler to warn about something like implicit conversion of one type to another.
Another, very different, if warning for things that are correct but might be in error (like 'for' without brackets, etc)
- Retric 10y agoNon idiomatic code is an error. Not because computers have an issue, but because it wastes fractions of a second every time someone reads the code. PS: It's the same reason you capitalize the first letter in a sentence.
- raverbashing 10y ago1 - 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)