"
 

My public number: What does Aimee learn every day ?

My personal WeChat ID: Emmy-self

If you think the article is useful to you, please reward, like or watch it~

Inscription

Date: August 25, 2022 22:00-23:00

Topic: The 36th Feishu Conference of Xiaobai Slow Climbing Camp

Content: How many prime numbers are there between 101 and 200? and output all prime numbers

Moderator: Mr. Goose

Participants: Aimei Xinran Teacher Xiaowu Qingqun Yanhuan Zhong Kang Peng Yizhao

New and old

Today, a newcomer Zhong Kang attended the Feishu conference, very happy, met new friends, and the team of peers has grown again.

Peng Yizhao has been here before, and he is considered a newcomer. I hope that next time I will be able to appear in real life, and everyone will get to know each other, haha.

In this issue, Kunlin was unable to attend due to temporary work, which is a pity, because she missed a very important lesson;

There is also Deju, who can't attend due to time constraints recently. I know she has been anxious recently and feels that her progress has fallen behind, but it's okay, don't worry, the road is long, take your time, we are all waiting for you here.

Let's start with the topic.

Harvest 1: Harvest code wealth

The title of this issue, the person who asked the question is Mr. Goose.

In fact, the moment I got this topic, my mind immediately corresponded to the corresponding knowledge points in the book, and I also knew the general problem-solving ideas.

At that time, there was a moment of doubt: why did the goose always ask this question?

Because of this topic, we have discussed it several times when we read it together, and the basic logic is the same.

But since it was work at the time, I just glanced at it, had this flash in my mind, and put it down.

On the subway after get off work, I thought about the code for a while, tried to write a few prime numbers on the note, and found the logic and correlation.

10 minutes before the meeting, I turned on the computer and typed the code I thought of in my head. The code was very short, only 4 lines, and the result came out as soon as I ran it. The whole process took less than 10 minutes.

The subject seems simpler than I thought.

So far, it's still just the pre-meeting stage.

However, the real gain came from the meeting.

As usual, we analyzed everyone's problem-solving ideas, because this problem is not difficult, so everyone's problem-solving ideas are similar, only some details are different.

However, when Mr. Goose's code came out and explained it, the point that shocked me came.

His code is divided into two parts in total. The first half is to define a prime() function, and the second part is to use the function to calculate and judge and output the result.

His code is much longer than mine.

At first, I was still thinking, or my code is more concise.

However, it was not until Mr. Goose finished his logic that I really understood the reason why his code was written like this, and the reason why he asked this question.

He used the form of defining functions, not only to answer the question this time, but also to facilitate future calls or others at any time.

That is, with this function, not only the prime numbers between 101-200 can be judged, but also the prime numbers between 10000-20000, and higher-order ones can also be calculated. Instead of the concise code like mine, it needs to be rewritten.

In the words of Peng Yizhao: it is reusability.

But if I understand it: I think this is product thinking.

It is to treat any piece of code as a product, a product that can be called and used for polishing. Only in this way can we slowly precipitate and accumulate.

When writing code, you must treat yourself as a user, not only at the moment I need to use this code to solve a problem, next time, if there is a similar problem, I can call it directly, or it is convenient for others to use it directly .

This makes me think: We usually have a lot of inspiration for reading and writing. If we record it in time, we will become richer and richer, but if we answer questions for the sake of answering questions, there is no precipitation, accumulation, or iteration. , then we are forever wandering from 0 to 1. (It seems necessary to review the "card note writing method" again.)

This is my most important takeaway today.

That is, to write any piece of code, it must be polished as a product, taking into account the convenience and practicality of user invocation and reuse.

This is similar to what Eric Jorgensen said in the "Naval Collection" about accumulating wealth, to find leverage, in addition to labor and capital leverage, to "replicate products with zero marginal cost", including books, media, movies, code. Of all the levers that can be used without the permission of others, code is arguably the most powerful—all it takes is a computer.

Today, Mr. Goose reminded us of this concept through the topic, which gave me a new understanding of code.

Code is not just a tool, it is an asset.

How to use this wealth is to productize the code.

We also discussed what we hope programming can do for us in the future.
We initially established a small dream:

"
 

Hope to have our own digital products in the future.

This was Mr. Goose's dream, and now it's my dream, haha.

Harvest 2: New uses of code

Regarding the prime number output part, how to set the control output result and control the output quantity of each line, the method that the goose always uses is something I have never thought about before, let me know that the original code can still be used in this way.

The surprise at that moment, the curiosity about the code has risen again.

This feeling is very wonderful.

Harvest three: sorting, summarizing, summarizing

This topic, for me, is not really a problem.

But when I actually wrote it, I found that the knowledge points I talked about countless times before, such as break, continue and other process control, are still easy to get confused. Even in the previous meeting, Mr. Goose also made an exquisite analogy.

However, because there is no timely induction, sorting, and summary before, there is a lack of such an internalization process.

Therefore, Mr. Xiao Wu and I both intend to start the action of sorting, summarizing and summarizing as soon as possible.

The above is the harvest of this conference. I hope that you who want to learn programming, or who have already started programming, can join us to explore this mysterious country.

The point is, the people here are interesting, informative, and loving, and worthy of company.

I'm Aimei , see you next time.

picture