📜 ⬆️ ⬇️

Programming doesn't suck! At least it should not be.

Translation of an article from the Enfranchised Mind blog.

Recently, I came across two texts that I just could not help but answer. The first, the most terrible, is the article on the Daily WTF “Programming - sucks! Or something like that . ” The second is a post about why functional programming does not get distributed .

Having tried myself one way or another in almost all areas of the IT industry, I am convinced that there are no uninteresting non-trivial problems. For a very simple reason: any boring, trivial, mechanical work should be a machine. No seriously! We are programmers . Who, if not us, is able to ease the work with the help of computers, if we do the same for others?
')
Programming can be sucked only for stupid. Five lines of code repeated over and over to set user interface properties? Oh god Have you ever heard of subroutines? Abstractions? How about generating code, or maybe it’s worth writing a DSL ? Well, if you copied these five lines just a couple of times, no big deal. But if you do it again and again (sometimes editing these lines slightly), you should probably think about how to abstract from it.

Abstractions help to increase the ratio of interesting and routine work, reducing the amount of tedious code. If instead of five lines of code repeated ten thousand times, you were able to write one line, repeated the same ten thousand times, the project was reduced from fifty to ten thousand lines of code that you can write at least five, or even twenty-five times faster. Get rid of dirty work as soon as possible, and you will have more time to do some really interesting things.

I did not say a word about changing the development language, I am only talking about thinking outside the box, or at least just thinking . But learning new languages ​​makes programming more attractive, because at least it gives you new tools and methods of abstraction. Some programming languages are actually better than others, and the more you know them, the more likely you are to know some good language. If you do not know anything better, you can not use its benefits.

My first impression of an article on the Daily WTF was that this was another manifestation of the starving child in Africa. Well, you saw the pictures. A child in some kind of damn hole of the third world, usually in Africa, but Asia or South America will go. Hungry children, tormented by disease and parasites, doomed to a short life, full of hardship and cruelty. But they are smiling happily because they know nothing but such a life. They have not seen anything else, they have not heard of a better lot. That is their life. I often find myself thinking that many programmers are like these children. They resigned, and they see nothing wrong with writing half a dozen lines of code that set the properties of the interface, because they don’t know that it can be different. Infested with bugs and viruses, bloated, slow, completely unsupported software - such is the programming for them.

But the second post convinced me that in fact the situation is much worse. This is not just ignorance. Many programmers not only do not know, but do not want to know anything better, and seek any excuse to remain in ignorance. As if the hungry child refused the food offered.

The fact is that I have already heard every single argument from that post. You see, I witnessed the last Great Paradigm Shift when the industry moved from procedural programming to object-oriented programming. In addition, I heard echoes of the previous revolution - the transition from non-structural to procedural programming. I heard all these arguments, more precisely, excuses, from people who do not want to learn C ++ and Java.

These excuses do not climb into any gate. Watch yourself:

I heard how each of these arguments was used against C ++ and Java in due time. If this were true, we would still program in Fortran and Cobol. In general, we do it anyway. The cobol was not by itself. The bad thing is that you had to write five lines of code to set the parameters of the interface. Worse, the programmers in Cobol did not even try to isolate abstractions, but simply copied these five lines again and again.

I was engaged in "boring" data processing. It turns out that in this “boring” code you can find an interesting and deep problem . When I praise a particular language or paradigm, I’m not trying to cram some product into you, I’m just suggesting a way to get rid of sloppy programming. Come with me, if you decide, to the magical land of interesting problems, where bydloderchederstvom have to deal with occasionally and not for long. Mysterious country where life always boils, Watson! How to come to this, how to make life better? Come with me to where programming is a great art and engineering miracle of the era, and not at all crap.

How to take the first step? First, learn a new language.

Source: https://habr.com/ru/post/53929/


All Articles