📜 ⬆️ ⬇️

How programming makes it logical to express thoughts



It is widely believed that programs can only perform a set of commands embedded in them and nothing more. Is it really?

This question in one of his articles is asked by one of the founders of MIT Media Lab Marvin Minsky. He tries to dispel the myth that the program - only a set of strict rules and instructions. Minsky writes: “This false belief arises from the fact that people confuse the form with the content [...] The developer must clearly follow the syntax of the chosen language, but the content that he wants to express through it is not limited to anything”.
')
The STUDENT program, developed by Palo Alto research center Daniel Bobrow back in 1964, solved school problems in algebra in the following form:

Masha was twice older than Anya, when Masha was as old as Anya. If Masha is now 24, how old is Anya?

The program copes with most tasks, since it can more or less accurately select a series of data from a task and, on their basis, compose and solve an equation.

Further, Minsky draws attention to another common misconception. Naturally, when writing a program, you must strictly observe its syntax. But this does not mean that you have a complete idea of ​​what your program will do.

If you are writing a program in Fortran and want to call an existing procedure, you need to use one of the strictly fixed commands, for example, GO TO. You cannot replace it with another team, but you can go with it to any place in the program, that is, you have a certain leeway.

Worse, when a person believes that the reason for such severity lies in the computer itself. In fact, the reason is in the programming language. The essence of any programming language is to translate your thoughts into a set of zeros and ones that will be understood by a computer, that is, a language is a means by which a programmer can express any, sometimes even the most complex ideas.

It is appropriate to recall the Sapir-Whorf theory , according to which the language we use determines our thinking. This theory also applies to programming languages. Any programming language is a tool, and we use different tools for different tasks.

The tractor, bicycle and car Tesla - vehicles, but they are used for different purposes. The same with languages. Ruby and JavaScript are ideal for creating websites, Java and C ++ are often used to create trading algorithms, Python and R do an excellent job with statistical tasks and information processing.

Languages ​​are often chosen based on their convenience, security, and speed — just like transportation — according to their current task. Therefore, we usually choose the language that suits us best. Some developers choose Ruby for its flexibility, others prefer the rigor of Java. But sometimes there are those who dislike object-oriented programming: these people do not use its advantages simply because they worked more with the methods of procedural languages.

Thus, the peculiarities of the language actually limit our thinking. However, we ourselves can overcome these limitations. For example, such expressions in Lisp as "cons", "sexp", "car", "cdr" may not have analogues in a number of other languages. Yet Lisp gives us the freedom to express our ideas within this language.

The book Design Patterns shows well how to express thoughts in C ++. More than half of the patterns from the book are missing in Lisp, since they can be expressed in it without changing the structure of the language. It turns out that programming languages ​​form the course of our thoughts, each in its own way.

To make sure of this, it is enough to write the same program in different languages ​​and see what results they produce. Then translate the program from one language to another. Given that the choice should be significantly different from each other languages, for example, the same Lisp and C ++. As a result, you will understand that the language does not express all your thoughts, but the most important thing is that it allows you to assess what is easy to implement and what is difficult to implement.

All languages ​​are united by the fact that they can express almost any human thoughts and ideas. A student who permanently leaves a flash drive in a computer classroom can solve his problem by writing client and server parts of the application for storing files in the cloud in Python. So, for example, Dropbox appeared.

Continuing the theme of Python, you can remember the open source project Django written on it. In 2003, the World Online news agency decided to start developing a web framework that would save developer time. Two years later, the project became open. Python is good because it is simple, and most importantly - it allows the developer to quickly create a working prototype.

Therefore, it is often used in startups, and its popularity over the past few years has risen to the skies. Among other products in Python, BitTorrent, MyPait, MoinMoin and others stand out. This language can be supplemented with Javascript, which helps to present your ideas. As a result, a bunch of Python + Javascript is ideal for implementing and presenting any business ideas, as well as scaling them.



Former Microsoft employee Mike Bolodzin in an interview with Business Insider talks about the importance of the ability to express one's thoughts. Programmers must be able to correctly express even the most ordinary ideas in writing (in addition to programming).

This will help not only communicate more effectively with management, but also show rights to the results of their work. Bolodzin recalls how once they did not recognize his contribution to the work: "I argued that this was my idea, and I knew that this could not be overlooked." A clearer presentation of your ideas will allow you to avoid such situations.

In addition, if you write good software, you will probably have to communicate more with other people. According to Bolodzin, if you show a good result, then you have to write in your native language as much as you usually write in Java or Objective C. To do this, it is enough to develop the habit of regularly writing: it’s no more difficult than keeping your blog.

PS We regularly sort out similar (and other) questions at our events: the founders exchange experiences and can ask for help from colleagues and experts. Here you can see the calendar of seminars that we hold throughout the country.

As an additional reading on the topic - a couple of our publications on Habré:

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


All Articles