In programming languages, loop variables usually use i? Do you know why?

01

The day before yesterday, I posted a question in Moments:

Why do loop variables usually use i in programming?

Didn't expect so many people to reply! You have to turn several pages.

4b430eb20ded3c74c21150bcf75cc552.jpeg

2/3 of the people answered this question correctly, and a small number of people know it, but they are not sure.

Habitually use i as a loop variable because the word index means: index .

I have put the answer in the reply area, and at the same time I asked the next question:

Then do you know why the second loop variable is used to j ?

The correct answer is:

i is followed by .

If you want to ask me why, I can only say: This is just a habit! And, for many, many years. Look at ChatGPT's answer:

1bfec3bd29d230f04c23e42a0a0d64f3.png

Did you get it right?a3e5a9da888549a0a5a634a6c33fc7ae.png

02

So far, do you feel you have gained something? What is the use of knowing why the loop variable uses i, j, and k ?

Actually! I feel that it is useless except for bragging and pretending.

Knowing this so-called knowledge cannot improve your programming level, especially for novices.

It can even be harmful if you entangle in such useless problems! Of course, if it's just chatting and blowing water, say something else.

It's better to study more: the use of for, for ... in, Array.forEach, Array.map, etc. is really coming.

Tell a story that I personally experienced.

I remember that when I was taking the C language class at school, there was a classmate who was a top student (with good grades in every class) and was printfpuzzled by the printing function in the C language.

I have been digging printfinto how to print characters and numbers to the screen. If you don't know C language, it can be console.logequivalent .

At that time, I was almost taken into a pit by him, and we ran to ask the teacher together.

The answer is something like this:

This is a programming language, combined with the functional interface provided by the hardware, there is no need to delve into it.

Your focus is printfto understand the parameters and formatting first.

But my classmate still didn't printfgive up on the principle, and kept asking the teacher, so that the teacher couldn't answer more.

From then on, in my classmate's heart, I always felt that the teacher's level was not good enough, and I went to the corner by myself. Until the end of the semester, without writing a few lines of code, I always struggled with some trivial issues.

It is good to have questions, but it is important to distinguish which questions are meaningful?

Which questions are simply unsolvable?

Which issues are not suitable to be touched at the current level?

You may have to ask again, what if you can’t tell the difference?

Then take a small notebook and record it first, and keep moving forward.

03

People, why did the above situation happen, have you ever thought about it?

I've thought about it, but I haven't really understood it until I read some books and articles recently and found a little answer.

It is human nature to fear uncertainty.

I really want to get the result, and I want it right away.

The second is perfectionism, hiding it, always thinking about holding back a big move, making a big hit, and getting rich overnight.

What about combining two ones?

That is, if one thing does not see benefits and returns in the short term, it is better to starve to death.

There are no opportunities and outlets, these are the excuses of those successful people who are self-effacing!

All success is based on continuous accumulation bit by bit.

Ideas and ideas are the "soldiers", execution and process are the "kings".

Just like you have a Lamborghini, put it in the garage, never go on the road, don't step on the accelerator with your foot, and you will never reach your destination.

I will tell another story of my own.

If you have followed Xiaoheng, you probably know that I started learning English recently and posted some videos.

In fact, when it comes to learning English, I used to learn it secretly, learning phonetic symbols and memorizing words, for fear that others would know that I am not good at English.

Since the end of 2021, I have tried to learn English by memorizing words, 10 new words every day, and a total of 2,173 words have been learned, which lasted 13,236 minutes.

a576412882e90bccedddffbc2ccae522.png

To be honest, the effect was very bad. I once doubted myself that I was not suitable for learning English at all.

I'm in my forties, and I still have to learn what kind of ghost English. I'm earning my full life.

After studying for so long, I still can’t understand the article. I looked up the meaning of every word, but what I understood was wrong. I am simply too stupid.

Whenever I heard that I was going to have a meeting with overseas colleagues, my palms were sweating and my heart was trembling.

I persisted for 449 days, until the end of this year, I made a decision - to give up memorizing words!

172df3ab8ec130618ae165069be3cf5e.png

04

I decided not to memorize words anymore, and treat myself as a primary school student , starting from scratch!

I found the textbook "New Concept English Volume 1" from the bookshelf. I don't know how many times I have read the first few texts.

In the first 30 lessons, it is not bad to learn, but after 30 lessons, I feel that the course design of "New Concept English Volume 1" is really good, it is full of knowledge points, and they are interlocking and exquisite (I I also found some materials to assist learning).

However, every lesson is dry goods, I can't stand it! ! ! Learning new things and forgetting old ones made me very distressed.

When you open a book, you know it, but when you close it, you don't know anything 306ddb458c67abf30e2d6a800d52a36c.png.

I thought about it for a while. "New Concept English Volume 1" seems to be an introduction, but there are not many daily conversations and exchanges, and the content is not practical. I guess there is a problem: just learning but not learning !

I dug out another English book from the bookshelf, "Learn Lai Shixiong's American Language from Scratch—Introduction", which was full of dialogue exercises. I listened to Mr. Lai Shixiong's words, acted out the dialogues as much as possible, and played role-playing games.

This makes me find some feeling of learning English. I won’t talk about the rest of the story this time. You can watch my video account and station B account—— Learning English with Doubi Xiaoheng .

05

Having said that, I asked myself, why should I learn English? Is it my love for English?

No, absolutely not! I used to hate it, hate it.

So where does my motivation come from?

Think...write it down, think again...write it down...

......

Most of the veterans who have followed Xiaoheng know that I am currently in charge of the operation of the Cocos Store resource mall in the Cocos engine, helping Cocos Creator creators: game development, technology realization ! Help users and make game development easier.

After more than two years of development, Cocos Store is growing at a rate of 5-10 times every year. From KOL to individual developers, from individual developers to enterprise sellers, the content on Cocos Store is changing with each passing day.

And my job content is to deliver these good content to more users who need it, and actually solve their current problems for users.

However, I am facing a big challenge - overseas market!

Cocos Store currently supports overseas buyers to use PayPal for payment.

As long as you set the product name, price, and product description in English on the Store , it can be displayed in the English store after the review is passed, and you can get USD order revenue.

As the products on the Cocos Store become more and more abundant, an embarrassing problem arises.

Overseas users find that there are many more Chinese products than English products, and most of the products they want to buy are in Chinese.

They don't have WeChat or Alipay, so they can't buy it! ! !

In the process of communicating with overseas users and colleagues, I once felt scared and inefficient, which made me very uncomfortable.

What's more, the Cocos engine can be pushed overseas to the world, and it can help developers in the Cocos community earn a dollar. I am excited to think about it, and I can't stand it instinctively.

I guess, it is this kind of constant discomfort, excitement, and responsibility that drives me to have a continuous motivation to learn English.

Definitely not a hobby, and if it was a hobby, it's probably already ruined. Just like playing games, since I started making games, my hobby of playing games has gradually disappeared.

Unknowingly, I have been so long-winded, today’s sharing ends here, if you see this, thank you for giving me a like before leaving!

oh! Let me say one more thing: Someone asked in the background, how can I persist in doing one thing for a long time?

I thought about it for a while, and I used the idea I want to convey in this article: give great meaning to what you are going to do, and make you feel passionate when you think about it!

d6ea8b06cb2200767c9720260361fd4a.jpeg

I am Xiaoheng, follow me, let us grow together!

Wonderful past

Creator 3.x Getting Started Practice Guide  

CocosStore seller growth guide

The Struggles of a Lost Youth Playing Games (1/4)

The Struggling Process of a Lost Youth Playing Games (2/4)

insist on being a long-termist

A formula to make yourself better and better at the age of 35!

Guess you like

Origin blog.csdn.net/6346289/article/details/130776147