News for hackers. Stuff that matters.
Re:GitHub Super Linter: one linter to rule them all by VectorLock on Thursday June 18, 2020 @05:22PM (#23568187)
Normally I agree with treating code as a means to an end rather than an end to itself but I take a certain enjoyment in crafting in some way aesthetically pleasing code as well. I even find that if the code is "ugly" that there frequently might be a more eloquent and objectively better way of doing things. And a little time hand formatting I think is worth it if you're maximizing understandability and readability.

Not arguing about style is nice, but having to resort to this brutalist architecture style of code formatting doesn't seem great to me. "Its just holding people, who CARES what the building looks like!"

Re:GitHub Super Linter: one linter to rule them all by a_t48 on Thursday June 18, 2020 @05:45PM (#23568420)
Consistent style is more important than each block of code being perfectly pretty. You can still argue aesthetics, but they need to be applied across the entire codebase. Never having to bother someone because their PR doesn't meet the formatting guidelines is well worth it.
Re:GitHub Super Linter: one linter to rule them all by ergothus on Thursday June 18, 2020 @10:06PM (#23570295)
> Consistent style is more important than each block of code being perfectly pretty

"Pretty", yes, but we're literally talking about using language to communicate. Consistency taken to extremes is harmful to communication.

I don't understand the worship that people have for consistency. STUPID inconsistencies are bad, yes, and yes, there are certainly arguments that about subjective matters that are a waste of time. But distilling everything down to the lowest common denominator of grunt-talking is very consistent and terrible communication. (Does that feel like a strawman? I'd love for it to be! Once people stop talking about consistency uber-alles we'll be discussing the things that I consider important.) Right now, the most common reaction is to dismiss any idea of communication through language as irrelevant, subjective, and a waste of time."

Re:GitHub Super Linter: one linter to rule them all by xondono on Friday June 19, 2020 @05:12AM (#23572651)
I’d agree that 100% consistency is harmful to communication, but the primary communication happening in programming is with a computer. Even when it comes to other developers looking at your code, their internal process is “let me simulate what the computer understands”.

Unless you are enforcing weird autoformat choices, everything should look pretty enough.

Re:GitHub Super Linter: one linter to rule them all by davedx on Friday June 19, 2020 @06:34AM (#23573041)
> the primary communication happening in programming is with a computer

Working in a team with 15 people on the same code base I disagree with this. Count the computer as one teammate

Re:GitHub Super Linter: one linter to rule them all by VectorLock on Friday June 19, 2020 @12:48PM (#23576205)
"Style" means things that the human sees. If it changes execution its not style any more. This is what tests are designed to enforce.
Re:GitHub Super Linter: one linter to rule them all by waheoo on Thursday June 18, 2020 @07:22PM (#23569270)
People at work nit: my code all the time. I just straight up ignore them. If they ask me why, I tell them to add an autoformat to our ci or shut the hell up.

Fwiw, i use an auto formatter but its got problems with certain rules so i switch them off.

The reason we dont have it turned on in ci is because these rules break code.

Re:GitHub Super Linter: one linter to rule them all by a_t48 on Thursday June 18, 2020 @08:13PM (#23569618)
Yeah, auto formatter (or at least format validation) is a must.
Re:GitHub Super Linter: one linter to rule them all by forty on Friday June 19, 2020 @08:01AM (#23573480)
There are two kind of painting. You can paint a wall/a building, or you can paint Mona Lisa.

This is the same for programming. Each dev have their own taste in term of code style and code formatting preferences. I was an early employee in a startup, and at some point I was able to tell who wrote a chunk of code just from the code style, it was fun :) but as company grown, and team got bigger, it got more "professional", now we have prettier which erases a big part of our code personality. If you believe like me that coders are artists you might find that a bit sad, but the truth is that most Enterprise software building is wall painting, and art doesn't have its place there. That doesn't prevent us from painting Mona Lisa at home though :)

Re:GitHub Super Linter: one linter to rule them all by javajosh on Friday June 19, 2020 @10:08AM (#23574659)
I like the point in general, but I will say there are times when idiosyncratic formatting can really help understanding "this particular bit of code". Often it has to do with aligning values so that they are easier to read; if a code formatter was smart enough to at least understand the signal the programmer is sending, and maintain (or even improve!) that kind of formatter, it would be the best of all worlds.

One simple example is when you're parsing text and you have a long list of simple one-line if statements. I personally think it's wasteful and harder to read that block of code if you impose curly braces and new lines on that list of conditionals. This kind of formatting convention has been around for at least 40 years, and it makes the code more readable. I have yet to see an auto-formatter that doesn't turn that kind of code section into an unreadable mess.

Re:GitHub Super Linter: one linter to rule them all by dnautics on Friday June 19, 2020 @11:15AM (#23575303)
Or key value lists where the keys have slightly different lengths.
Re:GitHub Super Linter: one linter to rule them all by Lorkki on Saturday June 20, 2020 @04:13AM (#23582575)
It's possible to do both: https://designyoutrust.com/2019/03/in-berlin-there-was-a-gia...

There's also plenty of room for art in the choice of materials and colours as well as the shapes of buildings. Likewise, with code, if you limit yourself to only what one person can do, you'll end up with a very constrained view of what "art" means.

Re:GitHub Super Linter: one linter to rule them all by antaviana on Saturday June 20, 2020 @05:23AM (#23582830)
You will flip out when you discover “git blame” or, even better, GitLens on Visual Studio Code.
Re:GitHub Super Linter: one linter to rule them all by epistasis on Thursday June 18, 2020 @10:36PM (#23570445)
I find that if the auto formatter isn't dealing well with a section of code, it's usually an indication that the code architecture is off. Too clever, too verbose, too much nesting, trying too hard to make one-liners, etc.

There's a beauty that comes from simplicity, and code for matters, at least for me, are good of reminding me of that.