News for hackers. Stuff that matters.
Re:Python with Braces by _the_inflator on Monday July 08, 2024 @01:36AM (#40902861)
I agree. To me ESlint in the JavaScript domain is an unsung hero.

Code is so incredibly hard to mentally grasp and every mental overload should be omitted to reflect on the logic.

There is a reason why there is one code basis and this should always be curated by a linter to uniformly enforce a standard.

There is still plenty of room for style and code organization.

I witnessed first hand many trench wars around seemingly small things like curly brackets in IF statements dealing with the question of one white space or none, because it appealed to personal preferences and before ESlint people would go to great length reformatting hundreds of LoCs just to get their right feeling of code syntax.

Weird. And git -diff was massive, as well as the code reviews.

(Un)Happy times. :D

Re:Python with Braces by hgomersall on Monday July 08, 2024 @02:19AM (#40902991)
I finding reading other people's rust generally delightful because everyone is the same machine controlled style guide (cargo fmt + clippy). It's definitely reduces the mental burden of reading code.
Re:Python with Braces by MrJohz on Monday July 08, 2024 @08:08AM (#40904644)
I recommend Prettier over ESLint - Prettier tends to produce more consistent results and is a lot faster (because it's doing less work). Moreover, ESLint are deprecating the styling rules at the moment (although they'll be made available in a different package).

You can configure ESLint to use prettier, but in my experience it's usually easier to just run ESLint separately to prettier.