We have been doing some new pair work processes to expand group capabilities (and to train up some juniors) so I am happy to report that I got to share this with two whole people.
That's part of why it took so long. Every day I thought I was done a new person would be added to the review and they would identify a security and/or use case edge case.
😅 Mine ended up being only like 50 lines or so total. Complex, pervasive, data coupling with security concerns and my own ignorance were the primary drivers for the time taken on this one.
One of my favorites is the fast inverse square solution.
It's like Fermat's Little theorem: meh, this is easy fuck you.
The rest of the world: what in the ever loving fuck is going on here? How in the... Jesus Christ... How did you?!? What is this black magic??!? What part of your soul did you sell for this?
If I am writing library code my why is you have an end use and I don't care why you use it and you don't care why I wrote it. You only care about what my code does so you can achieve your why.
If we are working on the same code we have different whys but the same what. Then your comment as to why isn't the same as mine which makes the comment incorrect.
We are looking at a piece of code and you want to know how it works, because the stated what is wrong (bugs). This might be the "why" you are looking for, but I call this a "how". This is the case where self documenting code is most important. Code should tell a second programmer how the code achieves the what without needing an additional set of verbose comments. The great thing about code is that it is literally the instructions on the how. The problem is conveying the how to other programmers.
There are three kinds of how: self evident, complex how's requiring multiple levels of abstraction and lots of code and complex short how's that are not apparent.
The third is where most people get into trouble. Almost all of these cases of complexity can be solved with only a single layer of abstraction and achieve easily readable self documenting code. The problem for many cases is that they start as a one off and people are lousy at putting in the work on a one-off solution. Sometimes the added work of abstraction, and building a performant abstraction, makes a small task a large one. In these cases comments can make sense.
Sometimes these short, complex how's require specialists. Database queries, performant perl/functional queries, algorithmic operations, complex compile time optimized templates (or other language specific optimizations) and the like are some of the most common examples of these. This category of problem benefits most from a well defined interface with examples for use (which might be comments). The "how" of these are not as valuable for the average developer and often require specialist knowledge regardless of comments for understanding how they work. In these cases what they do is far more valuable than how or why.
See, I think length limits and readability are sometimes at odds. To say that you 100% believe in length limits means that you would prefer the length limit over a readable line of code in those situations.
I agree that shorter lines are often more readable. I also think artificial limits on length are crazy. Guidelines, fine. Verbosity for the sake of verbosity isn't valuable... But to say never is a huge stretch. There are always those weird edge cases that everyone hates.
I think it's more correct to say that we don't know how to travel in the other direction on the time axis. It could also simply be our perception of time only works unidirectionally.
From a mathematics point of view, nothing is preventing going backwards in time... We simply don't perceive time that way.
The most important thing is comprehension. If something is too long and the length makes it less readable then it is too long.
But if having 3-4 files open at the same time makes it harder for you to comprehend a single file because you can't get the full picture, that's on you.
I understand the concern, but readability and comprehension are way more important than line length. If the length impairs readability, it's too long. Explicitly limits are terrible. Guidelines, fine.
Ultimately, you do you. I still think your crazy and I think your argument is poor.
Interesting. I wonder how much you used? I can imagine that a 1/4 tsp of the salt has enough magnesium carbonate to be effective... But I don't know how much is in it (otherwise it should be on the label since magnesium does have an rda)
I, too, remember the days before ultra high definition ultra wide monitors.
I thought this argument was bogus in the 90s on a 21" CRT and the argument has gotten even less valid since then. There are so many solutions to these problems that increase productivity for paltry sums of money it's insane to me that companies don't immediately purchase these for all developers.
I used to be this way about c++ too... But c++17/22 are not the same language as it was 10 years ago.. And it definitely isn't the language most firmware guys get to use it as.
There is some truly wild shit in the templating system.
Hey, I marked only one jira with "Works as intended" for only one of the big reports related to it, thank you very much.