There are dry goods, more stories, wechat search [programming refers to north] pay attention to this different programmer, waiting for you to hit ~

There is a question on Zhihu:

When did your programming skills take off?

I feel very interesting, so I answered it and sent it to my blog at the same time. This article is purely broken to record running accounts, and there is no dry goods.

Let’s take a look at a story

The body of the

After reading a book and finishing one lab after another, there is no rapid progress. Everything is quantitative change and eventually accumulated into qualitative change.

But at some point in time, you will feel that your programming ability does improve a lot, you can code more ideas, the speed of accepting new knowledge will be faster, I think this is not scattered knowledge gradually connected lines, surface?

But to be honest, I didn’t feel like I was making leaps and bounds in programming ability.

We are ordinary script, can not be like Zhang Wuji because of falling off the cliff, the accident of “Jiuyang Shengong”, from then on by leaps and bounds, open hang, to the peak of life.

Only by constantly reading books, coding, learning excellent open source projects, building their own computer knowledge system, and constantly specializing in a specific field, can they become an excellent engineer.

Let’s talk about my own path to learning programming.

Confused Freshman year

I had no programming experience at all before college. After the college entrance examination, the first few majors I filled in were all traditional engineering majors. It was totally unexpected that I was admitted by software engineering.

At that time, I was worried that I would not be able to keep up with the university because I had no basic knowledge of programming. I also thought about going back to the university, but now I think it is naive.

At the beginning of my freshman year, the first programming language I learned was C language. How can I say it? I could understand what the teacher said and what the book wrote, but I couldn’t figure out how to write a big program. I do not know where to start, learned half a semester, also can only write after class exercises, calculate daffodils number of what.

And I had no systematic knowledge of computers, so even if I remembered that a pointer was the address of a variable, it was hard to understand what it was for. You can’t even tell the difference between an array and a pointer so much so that you get the now-rudimentary error of returning the address of a function local variable.

After taking the C language exam in my freshman year, I thought to myself that I would never write C again in my life, but unexpectedly, it became my favorite language.

When I was in college, I began to learn data structure and algorithm, digital logic and other computer core courses.

In addition, I learned a language that I thought was awesome at the time: Java.

Why did I think it was awesome?

Because just experienced the DESTRUCTION of C language, found that Java has a rich class library, a variety of convenient tool classes.

No more Pointers, object references, new world.

So I learned it very seriously, I still remember watching the Java Se tutorial of Ma Soldier at that time, but now Ma teacher has come out on his own ha ha ha.

I also wrote a lot of fun things in Java, such as online backgammon, HTTP Server and so on.

This made me feel so interesting in programming for the first time. As the saying goes, interest is the best teacher. Java also helped me unlock my interest in programming.

When I was learning Java, I liked to search information on the Internet, but I always felt that the knowledge on various blogs was too scattered. In order to “master” Java, I searched various book lists in Zhihu, and successively read several books such as Java Programming Thought, Java Core Technology Volume and Java Concurrent Programming. However, I have not written about it for nearly two years now, for reasons that will be mentioned later.

At that time, I thought it was cool to develop apps, so I began to learn Android by myself and wrote some apps to play, such as weather and snake. Now they are still lying on my Github.

However, after learning for a period of time, I don’t like client development very much. It seems that the sense of achievement of writing APP has been exhausted.

So at the beginning of the sophomore year, I started to learn Java Web, from Servlet to SSH and SpringBoot, and basically went through all of them. I even bought a book which seems to be very stupid now: Java Web Integrated Development – Return of the King, which is the one in the picture below:

Later, more and more feel that this road is learning a variety of frames, although learned something, but always feel not quite right.

At the same time, in the summer vacation of freshman year, senior students set up stalls in the school square to sell books, I also bought some, one of which is known as the computer professional book CSAPP.

Crazy try sophomore year

In my sophomore year, I used to take this book with me in some boring classes, and I might turn over several pages in each class. At that time, I was really in a fog when I saw the contents of assembly, memory management and memory hierarchy, because I had not learned the operating system and I was very poor in C language.

So I read a few chapters intermittently, I can’t say what I learned, but it made me interested in this kind of boring basic knowledge for the first time, and I had an idea that I wanted to understand them thoroughly.

Later, under the guidance of zhihu bosses, IN order to understand this book, I went to read Wang Shuang’s “Assembly Language”, also shown in the picture above.

I learned C language again (mainly Pointers and memory). Since I have learned assembly, Pointers are no longer a problem for me. Meanwhile, I have read “C and Pointers”, “C expert Programming”, “C traps and Defects”, and become more proficient in using C language.

During the sophomore year, the school suddenly started to learn machine learning. Although not all of them, many of them really learned it. Although android client development was quite popular in the freshman year of 2016, various machine learning and neural network were swept by in the freshman year of 2017.

Cannot but sigh, IT industry changes with each passing day, do not learn may be eliminated.

Of course, I was no exception to join, has seen some Ng’s video, watermelon book.

I followed up with handwritten number recognition, a necessary entry project, but later I always felt that I was not interested in machine learning and deep learning. One of the reasons was that I could not fully master each step and understand the principle behind each step. In addition, I was not good at mathematics, which made me very discouraged in learning.

So machine learning ended in sophomore year.

Sophomore year was the time when I learned the most. At that time, my roommate wrote a script to steal lessons with Python, which was very fun.

And then went off to learn Python, to learn crawlers.

I wrote a bunch of crawlers, such as douban movie crawling, Zhihu answer, grab lessons script, but I’m not very interested in it after playing for a while.

Time came to sophomore, according to the course arrangement, began to operate the system.

So I searched “how to learn the operating system” on Zhihu. I have to say that the answers of the senior leaders on Zhihu are very important to me.

Following a bunch of answers, I realized that it was fascinating to be able to write a Mini OS with someone else.

So I bought a copy of “Operating system true image restore”, this book is really very careful, write OS need to use the pre-theoretical knowledge, Intel manual, assembly, inline assembly all tell you clear.

I followed all the way to write, write to the assembly boot print out my name, and then later into the C language to write each module of the kernel, to the memory management I interrupted, did not continue to write, this is also a pity.

I spent two months poring over 500 pages of this 800-page book, running to the library right after class and running QEMU on my virtual machine, immersed in an interface like the one below:

At that time I was really fascinated by this, in order to write the mini OS I also went to see part of the Linux0.11 code, see Harbin Institute of Technology Teacher Li Zhijun OS open class, the reason is that Harbin Institute of Technology OS experimental class is to use Linux0.11 to magic change.

Also very strange changed my QQ signature to JMP 0x7C00

PS: This assembly jumps to address 0x7c00 and BIOS starts booting the operating system

As a result, I became more and more interested in the lower level things, so I decided to go the Linux C/C++ route, but now it seems too young, Linux C/C++ is mostly used to write business.

In the second year of sophomore, I searched zhihu and Niuke.com for learning routes, and I probably knew what books I needed to read (searching on the blackboard, I must learn to actively search for various information.

Focused junior year

So I started a very standard Linux C/C++ learning path around my junior year:

Read C++ Primer, APUE, UNP, deep exploration of C++ object model, STL source code analysis, C++ design and evolution, Linux kernel design and implementation, complete annotation of the Linux kernel, effecitve C++ , effective modern C++, programmer self-cultivation, Linux high-performance server programming, Linux multi-threaded server programming (zhihu Chen shuo written)……

By the way, I also read the source code of Muduo. I imitated a Web static server based on Epoll to write a Reactor model, and wrote Json library with the big guys of Zhihu Milo. In short, I wrote some small “wheels” during this period.

(PS: Some friends on Zhihu asked me how I finished reading so many books. In fact, I wrote in the previous article that I would choose chapters to read and not read them from the beginning to the end. Besides, there will be fewer classes at the beginning of my junior year. After all, I’m not in any clubs, student council or anything, and I don’t have a girlfriend…

At that time, I would record the progress of reading every day, feeling particularly exciting:

The more books you read, the more you can actually find your own direction. In my junior year, I set my learning position for myself:

Deep into C++ language (multithreading) + storage (learning Redis, leveldb) + network programming (learning muduo, various network programming models) + learning distributed (MIT 6.824, ddia, Google three papers, etc.)

Basically along the above several directions to expand learning, some reading, some papers, also some to see the blog to see the source code.

In short, my knowledge was expanded in my junior year, and I began to pay attention to learning background servers such as C10K and C100K to develop high-performance and high-concurrency solutions.

Of course, there are some things that haven’t started yet, such as levelDB source code, 6.824 Lab, maybe lazy……

Or maybe learning has become less technology-oriented and more job-oriented and money-oriented hahaha.

It is worth mentioning that in my junior year, there was a course of System Programing in our college, and the textbook was CSAPP, so I could open the book I had read briefly in my sophomore year. This time, I did the attached experiment side by side, and gained a lot. There was an operation with various strange and clever techniques. Have Bomb lab stimulation beat strange pass, also know the buffer overflow attack…. Implementing basic memory management and so on.

What impressed me most was doing the Bomb lab. It was really exciting to pass the phases one by one. I almost stayed up all night to pass these phases, and of course I didn’t lose my hair.

At that time, he wrote a swastika record in Jane:

Later, I got the offer of wechat internship and got a full-time job.

After I got the internship offer at the end of my junior year, I started to do some foreign computer courses LABS. On the one hand, I earned a lot of money and it was not cheap, with which I realized economic independence in the end of my junior year. On the other hand, some of these LABS were very interesting and helpful to improve my basic and programming ability.

Here are some of the LABS I have done that I found interesting (as mentioned in a previous article) :

The first is the file system

The idea is to design your own file system — files, blocks, directories, etc. — and provide interfaces for creating, reading, writing, deleting, random reads, random writes, etc., and then mount it into the Linux kernel via the VFS mechanism. You can then use the system calls open, read, and write to read and write on your file system. VFS is a Linux mechanism that specifies IO interfaces, and then you implement those interfaces so you can mount them. I learned a lot about the file system and the rewards were worth it.

The second is SVC

It is a version management system, similar to SVN and GIT, but it has made a lot of simplification compared to GIT. The core is to create branches, merge branches, rollback, commit and so on. Through this, I went to understand the implementation principle of GIT in detail, and wrote a simple version of GIT myself, which benefited a lot. And made thousands of dollars.

The third is the lock implementation of the operating system

This is to let you based on hardware atomic instructions XCHG, CMPXCHG these implementation of a lock, this requires inline assembly, assembly and other knowledge, it is hard core!! Doing this also clears up some of my doubts about the lock implementation.

Web Proxy

Nginx is a proxy server that uses C++ as a proxy server.

The proxy server randomly inserted some images and text into the response from the original server, because it was April Fool’s Day. I have to say foreigners are fun.

There are analog TCP reliable transmission

The more hardcore, the somebody else a foreigner teacher is to give, directly made a site, the site you can use a TCP connection, then you need to run a few nodes, send messages to each other, the messages between them will be after the teacher’s website, so through the website can be control packet loss rate, can also control node topology, The requirement is to let you make reliable data transmission based on this unreliable channel! This is just like TCP again, timeout retransmission, ACK, sliding window, etc. Just as in the figure below, the circle represents the range you can reach. Different nodes form various network topologies and can adjust the network packet Loss chance.

Of course, there are also a lot of algorithms, data structure implementation, graph search, machine learning, deep learning, anyway, in all directions.

Doing these LABS has really improved my programming practice ability, and also tested the effect of reading so many books in the early stage.

So I have written so much, and I will point to the question again. I think my programming ability improves by leaps and bounds after reading big black books, finishing one lab after another, and writing down lines of code.

The appendix

Here are some books I bought in college, but sold most of them when I graduated, because they are really inconvenient to carry:

This is the book to take to the study room of the library.

This is my graduation book:

It cost me a lot of money to buy these books. Everyone knows that computer books start in their fifties, sixties, seventies and eighties. I spent thousands of dollars just on books in four years of college. But I always thought it was the best investment I ever made.

Of course, I also have their own electronic book library, is not the kind of package download on the Internet, but their own need to learn a certain direction of knowledge, need to see, go to the Internet one by one to find, and finally summarized. This part I will constantly improve it, as their own small electronic library, not much, but in essence.

Finally, I really want to say that constant dropping wears away a stone not in a day. Learning computer still needs to sink down to hit the books, read the source code and write “wheels”.

Gradually build up their own computer knowledge system, and then choose a professional direction to continue to study.

Welcome to zhihu to see the original text, by the way to help me point a thumbs-up ah, thanks!

When did your programming skills take off?

The article continues to update, the full text of the first release of my personal public account, you can search wechat “programming refers to north” the first time to read.