This is a translation of the article by blogger Brian McKenna. Permission to transfer received .Opinions are gathering in the DynamoDB community right now. Should you write code on the 45th line or not. I firmly believe that the 45th line should be left blank. And that's why.
')
45th line below screen edge
The default terminal height is 24 lines. If you write code on the 45th line, programmers will not immediately notice it. If you leave the 45th line empty, the programmer will not miss anything. The code is more readable than written, so make sure that it is visible.
Row 45 is impractical
Many times I tried to learn the 45th line, and each time it was not easy. There are many different lessons on the net trying to teach you how to write code on the 45th line, and they are full of abstract details. I just want to write code. With the strings that I use, it's much easier.
I turned to IRC, and someone told me that I was watching the wrong lessons, and they wrote some replacement exercises. I'm sorry, but you can’t expect lowly programmers from another industry to spend time doing the
exercises . When you discover a bug in production, you cannot waste time on exercises with the 45th line, especially when you were called at 3 am.
45th row is redundant
As far as I know, there is no programming language that really requires placing any code on the 45th line. And since this is not a necessity, this should be avoided. I think everyone agrees that the absence of a code on the 45th line is simpler than its presence.
Everything should be made as simple as possible, but not simpler.
No need to delete the line, just leave it empty.
Lines 1, 39 and 60 are better
I understand that this is subjective, but the syntax does matter. Anyone who has trained the junior knows that lines 39 and 60 are more intuitive. Using them takes a little longer than writing code on the 1st line, but now everyone is very familiar with using them. We should not impose existing code idioms on line 45, while schools generally teach us to use the first line.
Conclusion
Some of us have written code without the 45th line of the decade. We have created dozens of applications serving millions of users. This is a reliable and clear programming method. Attempting to be smart, using the 45th line, does not help your users, but simply consoles your vanity. Be kind to poor admins who have to raise your site in the middle of the night and jump on line 45 in their debuggers.
We do not need the 45th row.
Update
Zverik explained in the comments what this article is about:
I understand that satire, but that is not very good, because I don’t follow ruby-communities. Went to reddit :
- The first argument is based on the false assumption that all terminals are 24 lines high.
- "Since it is difficult for me, it must be avoided."
- “Since this is not required, let's not do it” - if something can be done not, this does not mean that we should not do it.
- About the arguments from “anyone who trained a beginner” and lines 1, 39: the argument from the authority, “if you do not know this, you are nobody”.
- This article demonstrates the subjective arguments that are presented as true, and shows how far we have gone from the science with which programming was once related.
On the site lobste.rs noticed that this is the answer to the article using the “more” sign in programs . Which shows that the level of discussion about conventions in programming is lower and lower.
This translation is dedicated to the user Habrahabr divan0 . Thank you for the articles (and especially for your comments on them) about the Go language.KDPV taken here .