3 ms·
Wild that the people who made the language that forces me to type if err != nil { return nil, err } after every second statement are advising agains
by alexvitkov 2y ago
Wild that the people who made the language that forces me to type
if err != nil {
return nil, err
}
after every second statement are advising against code repetition.
- kiitos 2y agoWild that you don't distinguish between error handling and name repetition.
- alexvitkov 2y agoThe issue is about "repetition" - a concept that exists on the syntactic level, and is unavoidable in Go. To put it in a way you may understand, it's when you have to press keys in the same order a lot of times and you get sad.
- kiitos 2y agoRepetition at the syntactic level, as you describe here, is, statistically, zero percent of the time spent in any meaningful software project. It, quite literally, doesn't matter. Time spent by authors typing source code characters into their editor is almost entirely irrelevant. The only thing that matters is the time spent by readers parsing and understanding the source code in the VCS.