Do not write code on line 45

KDPV

This is a translation of the article by blogger Brian McKenna. Permission to transfer received .

Opinions are gathering right now in the DynamoDB community. 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 the edge of the screen


The default terminal height is 24 lines. If you write code on the 45th line, then programmers will not immediately notice it. If you leave the 45th line empty, then the programmer will not miss anything. Code is more readable than written, so make sure it is visible.

45th row is impractical


I tried many times to master the 45th line, and each time it was not easy. There are many different lessons online that try to teach you how to write code on line 45, and they are full of abstract details. I just want to write code. With the strings I use, this is much simpler.

I turned to the IRC and someone told me that I was looking at the wrong lessons and they wrote some replacement exercises. I'm sorry, but you cannot expect lowly programmers from another industry to spend time doing exercises . When you find a bug in production, you cannot waste time doing exercises with the 45th line, especially when you were called at 3 o’clock in the morning.

45th line 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 necessary, this should be avoided. I think everyone agrees that the lack of code on the 45th line is simpler than its presence.

Everything should be done as simple as possible, but not simpler.

No need to delete a line, just leave it blank.

Lines 1, 39, and 60 are better


I understand that this is subjective, but the syntax really matters. Anyone who has trained a junior knows that lines 39 and 60 are more intuitive. Their use takes a little longer than writing code on the 1st line, but now everyone is familiar with their use. We should not impose existing idioms of writing code on the 45th line, while in schools they mainly teach to use the 1st line.

Conclusion


Some of us wrote code without the 45th line of the decade. We have created dozens of applications serving millions of users. This is a reliable and understandable programming method. Trying to be smart using the 45th line does not help your users, but simply amuses your self-esteem. Be kind to poor administrators who are forced to lift your site in the middle of the night and jump on the 45th line in their debuggers.

We do not need the 45th line.

Update


User Zverik explained in the comments what this article is about:

I understand that it’s satire, but not really, 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 this is difficult for me, this must be avoided."
  • “Since this is not required, let's not do it” - if something can be done, it does not mean that it is necessary not to do it.
  • About the arguments from "anyone who coached the beginner" and lines 1, 39: the argument from the authority, "if you don't know this, you're nobody."
  • This article demonstrates the subjective arguments presented as truth and shows how far we have gone from the science with which programming was once associated.

The site lobste.rs noticed that this is a response to the article using the “more” sign in programs . Which shows that the level of discussion about conventions in programming is getting 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 Go.

KDPV is taken here .

Also popular now: