I heard that you want to be a functional programming engineer (Part I) Translated 100%

oschina Posted at 14:20, January 11, 2019 (20 paragraphs in total, translation completed on March 7)
Reading 8045
Collection ten
top five
Loading

The first step in understanding the idea of functional programming is the most important and perhaps the most difficult. On this point, different people have different views.

School car

When we first touched the car, we were pained and worked hard. It seemed that it was easier to operate the car than we thought. Although I have practiced many times in my parents' car, I dare not take risks on the expressway unless I know the surrounding roads well. But after constant practice and some "heartbeat moments" that parents would rather forget, we finally got our own driver's license.

A
Translated at 15:12 on January 13, 2019
top
one

With our driver's license, we will drive out whenever possible. Every time we travel, we become better and better, and our confidence grows. Then one day, we had to drive someone else's car, otherwise our car finally gave up the ghost, and we had to buy a new one.

What's the feeling of driving under different cars for the first time? Is it like driving for the first time? Not even close. The first time, they were so strange. We were in the car until then, but only as passengers. This time we sit in the driver's seat. The one containing all controls.

But when we drove the second car, we just asked ourselves a few simple questions, such as where the key went, where the light is, how you use the turn signal, and how to adjust the side mirror

 bokee
Translated at 20:25 on January 13, 2019
top
one

After that, the voyage was very smooth. But compared with the first time, why is it so easy this time?

That's because the new car is very much like the old one. It has all the basic functions required by the car, and they are almost all in the same place.

Some things are implemented in different ways and may have some additional functions, but we didn't use them for the first time or even the second time. Finally, we learned all the new features. At least we care about those.

 Psychotria fluviatilis
Translated at 15:07 on January 14, 2019
top
zero

Learning a programming language is similar to learning a car. The first time is very difficult, but once you master a language, it will be easy to learn other programming languages later.

When you first start learning the second language, you will ask the following questions: "How do I create a module? How do you find an array? What are the parameters of a substring function?"

You are confident that you can learn and master this new language, because it will remind you of your old language, and perhaps there are some new things that can make your life easier.

 

 Munan Zhao
Translated at 22:22, January 24, 2019
top
two

Your first spaceship

Whether you have driven a car or dozens of cars in your life, imagine that you are going to fly a spaceship.

If you want to fly a spaceship, you won't expect your driving ability to help you much.

When you start training, you will expect something very different in space, and flying this device is very different from driving on the ground.

 clamness
Translated at 15:28 on January 25, 2019
top
zero

There is no change in physics, but the way you navigate in the same universe has changed.

The same is true for learning functional programming. You would expect that everything would become very different, and that the programming knowledge you know would not be converted to each other.

Programming is the process of thinking, and functional programming will teach you to think in different ways. Even, you may never return to the original way of thinking.

 Hunter5
Translated at 15:37 on January 28, 2019
top
one

Forget everything you know

People like to say this, there is some truth. Learning functional programming is like starting from scratch. Although not necessarily, it is indeed effective. There are many concepts similar to other categories in functional programming, but if you plan to Re learn everything This is the best choice.

From the right perspective, you will get the right expectations; With the right expectations, we will not give up even when things are difficult.

As a programmer, you have done all kinds of things, but now you can do nothing with functional programming.

 Hunter5
Translated at 15:56 on January 28, 2019
top
zero

Just like in a car, you are used to backing away from the driveway. But in the spaceship, there is no backward operation. Now you may think: "What? No retreat? How can I drive without retreat?!"

However, it turns out that spaceships can operate in three-dimensional space, so you don't need to reverse. Once you understand this, you will no longer miss "reversing". In fact, one day you will think about the limits of cars in reverse.

Learning functional programming takes some time. Please be patient.

Then let's exit the cold world of imperative programming and gently enter the hot spring of function programming.

 Hunter5
Translated at 16:28, January 28, 2019
top
zero

In this multi part article, we will introduce some functional programming concepts that will help you before you learn the first functional language. Or, if you have already tried it, it will help improve your understanding.

Please don't worry. From this point on, take the time to read and understand the code examples. You can even stop reading at the end of each class to let your thoughts be deeply understood. Then come back and finish

The most important thing is that you should understand.

 clamness
Translated at 15:34 on January 25, 2019
top
zero

Purity

When functional programmers talk about Purity, they mean pure functions.

Pure functions are very simple functions. They operate only on input parameters.

This is an example of a pure function in Javascript:

 var z = 10;    function add(x, y) {       return x + y;    }

be careful add The function will not be modified z Variable. It does not read data from z, nor write data to z. It only reads x and y, their input values, and returns the sum of the two.

 Tocy
Translated at 20:13, January 26, 2019
top
zero
All translations in this article are only for learning and communication purposes. Please be sure to indicate the translator, source and link of the article when reprinting.
Our translation work follows CC protocol If our work infringes your rights, please contact us in time.
Loading

Comments( nine )

 Selina_Sun
Selina_Sun
sds
 Mujiutian
Mujiutian
six
 Mujiutian
Mujiutian
What shall I do?
 Mujiutian
Mujiutian
six
 Cold zz
Cold zz
👍
 amynik
amynik
Building owner 666, awesome, thanks for sharing, I have more resources here http://mall.amynik.com
k
kknd97_97
[JustTen needs to be better defined as a constant] It is suggested to change it to [JustTen needs to be better defined as a constant]
 i6u
i6u
@zhenruyan Come and have a look
I
ICANN
Isn't the translation finished? How does it display 90% translation?
 Back to top
Top