4 ms·
> People who stress over code style, linting rules, or other minutia are insane weirdos Does anyone really stress over these? Everywhere I’ve used them it’s al
by jasongi 4y ago
> People who stress over code style, linting rules, or other minutia are insane weirdos
Does anyone really stress over these? Everywhere I’ve used them it’s always been use black/flake8/eslint/prettier with mostly out of the box settings in order to get some low hanging fruit standardisation of the code to avoid people stressing/arguing over them.
- oxff 4y agoI guess it used to be more of a problem before languages started shipping their own linters and code styles (like Rust does), or agreed to use a single tool. Kind of a legacy artifact.
- retrocryptid 4y agoNot sure I agree. As my eyesight degrades over time, I really like the idea of putting a space between a paren and a parameter in function calls / definitions. // I prefer to look at this: function example( whatever ) { : } // Instead of this: function example(whatever) { : } And I don't think it's appropriate to force everyone who uses your language to adhere to the same style. If you want to enforce a style, just encode that style in the syntax of the language. Also... my dyslexic coders tend to hate long lines of code, so we sometimes do lispy things like this: const foo = whatever( "this is a big long parameter", ( 2 + bar ) * 90, i, process.env.HOME || `/mnt/${process.env.USER}` ); instead of this: const foo = whatever( "this is a big long parameter", ( 2 + bar ) * 90, i, process.env.HOME || `/mnt/${process.env.USER`); And there's nobody's style that allows the former.
- kutenai 4y agoNot quite true. Python PEP 8, kind of a core in Python style, states that lines should be no longer than 79 characters. I personally, and I believe many current Python developers use a more realistic 120 character line length.. But, in Python, long lines are frowned upon, and your multi-line function call is the preferred approach.
- retrocryptid 4y agoI did not know that. I've sort of always appreciated the python community, even though python leaves me cold.
- alanwreath 4y agoI stress about these if they are not already automated. It’s sooooo simple for a coworker relationship to sour over style.
- lumost 4y agoI've come to the conclusion that if the code style check is not automated, then it doesn't exist. It's fine to suggest naming changes etc. but manual review of simple stuff like multi-line style or comment style is a waste. If a code style check is worthwhile then it should be PR-able into one of the mainstream automated code linters, style checkers, or formatters.
- belval 4y agoI have worked with people that did, and while rare it is very painful. In one case the person had seniority over me and kept "refactoring" our codebase in a team of 8. You'd write a function that worked one day and come back the next and it was broken because "I changed the name of that function because it did sound right". Some people are weirdos and nothing short of their manager telling them to STFU and do their job will stop them.
- retrocryptid 4y agoIn the early 90s at Convex, we had a tool that would reformat code for your personal style after it was checked out of the repo and then reformmated back to our corporate style before checking it back in. It turns out it cost less to develop this tool than to absorb the daily productivity hit which came from people spending their day arguing code style instead of working.
- icedchai 4y agoYou'd be surprised. I worked at a place that forked a couple of those tools and used the "in-house" versions since they did not match the desired code style.