45 days, getting started with C++

d1e45a32a707904f339116848b745b82.jpeg

Why limit to 45 days? A holiday is almost 45 days. It may be a good opportunity for the student party to overtake in a corner. It is not that the student party wants to change careers to learn C++. After reading this article, you can also find your learning direction.

Readers who have followed me earlier should know that I work as a C++ background development software engineer. I have learned C++ over the years and have some experiences that I can share with you.

Generally speaking, learning C++ should be based on years, because C++ is closer to the bottom of the system, and it is indeed difficult to learn compared with other programming languages. It is difficult to learn and master the essence in a short time.

The learning cycle in years is aimed at the goal of proficiency. In that year, I failed to learn C++ within 45 days. At that time, there was no effective study plan and correct method, so I started reading books and knocking. Code, but I don't know that sharpening knives will not cut wood by mistake, and learn from the experience of the predecessors.

After planning the correct learning route, the feasibility of getting started with C++ in a short time is still very high, and you can get positive feedback quickly, and you will be more motivated to study in depth later.

To be honest, take the 45-day study plan as an example to plan an executable "short-time self-study introductory C++" learning route for new C++ beginners.

what to learn

Know yourself and know your enemy.

Before you start learning, you should have a general understanding of the content of the study. It's like getting a big book. Don't bury your head in turning it from the beginning to the end. First, learn the content of the whole book from the "Table of Contents". The C++ learning directory is as follows:

  • Object-oriented features, encapsulation, inheritance, polymorphism

  • The difference between heap and stack, the difference between mallocl and new

  • Virtual function, virtual function table, object memory layout

  • Overloading Overloading and Overriding Overriding

  • References and Polymorphism

  • Constructor and destructor in derived class, calling order

  • Destructor, Constructor

  • template class, generic

  • Structure memory alignment

  • pointers and references

  • The role of the static keyword

  • Virtual table, what is the virtual table of the base class, the virtual table of the derived class, single inheritance, multiple inheritance, diamond inheritance

  • The difference between #define and const

  • volatile keyword

  • Casting in C++: reinterpret_cast , static_cast , const_cast

  • High-level summary when exceptions are thrown in destructors

  • New features in C++1X, C++20

The above is the knowledge framework of your C++, and the content you need to learn is also these.

Not to be proficient in C++, but at least familiarize yourself with these concepts to lay a solid foundation for future in-depth study .

video learning

For this kind of short-term study, it is not the best choice to get started with tome books directly. I recommend starting with C++ video tutorials or open classes. Learning by video can lower the threshold for getting started. After all, there is a teacher who leads I can point out where the key content is and where mistakes are easy to make.

Here I also found some high-quality C++ video resources for you. Some are C++ public courses in universities, and some are well-received or very classic C++ teaching videos, such as Mr. Hou Jie's C++ series, which are all well-known classic video tutorials!

University Open Class

The subject should be a student. If you are more accustomed to learning in the form of teaching by university teachers, I recommend two open C++ programming courses in colleges and universities. This learning method is the same as a university class.

Tsinghua University C++ Programming

Course link : https://www.bilibili.com/video/BV1QE41147RT?from=search&seid=99686366215290298729f467f8163e5099172bfe1ccc6c54407.jpeg

e3860d7a5719bc64cdc41c3376b818aa.png
img

This video of Tsinghua University is a C++ programming class. The biggest feature is that the knowledge points are particularly comprehensive! It almost covers the knowledge points I listed above, which is equivalent to the teacher taking you to play this university course. There are 197 episodes in total, but don't be scared. The average episode is only about 7 minutes, and the speed is very fast. !

University of Electronic Science and Technology of China C++ Programming Fundamentals

Course link : https://www.icourse163.org/course/UESTC-1001774006

024303e04b3c6aa80ad579b6adad5aae.jpeg
icon

The C++ programming course of the University of Electronic Science and Technology of China is a national excellent course. It is the way of university lectures. If time is limited, choose one of the courses from Tsinghua University above. If you have enough time, you can brush both of them, or if you are not sure about a certain knowledge point, you can directly find the same knowledge point in two open courses and compare the learning, and the effect is better. The official course team explained this course:

This course is suitable for beginners who have no programming foundation or who have learned the C or C++ language and still cannot independently write programs according to the problem. From theory to practice, from analyzing problems, finding ideas for solving problems, to programming, debugging, and running, they are all demonstrated with the help of actual cases. Especially the initial compilation errors and the later running errors, learn programming methods and debugging techniques through the step-by-step video demonstration. ----Course Team

Quality C++ Video Tutorials

The above recommended C++ programming courses in colleges and universities are still in the form of college classes as a whole. The style of painting is more serious. Some people may not be used to this way. I recommend that you can search for C++ learning videos at station B.

There are some teachers' lecture videos from training classes on station B that can be watched for free. Those teachers have practical project experience, and the teaching format is also interesting. When I was addicted to station B learning, I couldn't extricate myself. For the beginners of C++ programming, I recommend the following C++ with conscience Video tutorial.

The dark horse programmer C++ tutorial of station B starts programming from 0 to 1

Course link: https://www.bilibili.com/video/BV1et411b73Z?p=1

It's not that I advertised the dark horse, and they didn't charge any money!

This is a free learning video course on station B. It is said to be the best tutorial for beginners to learn C++ on station B. How popular is this video? Word of mouth has no basis, this video has 4.35 million views on station B! You can also see the number of likes and collections at station B in the screenshot below.

0c26947e1436f7ebf6769de628e1224b.jpeg
img

I cut some comments for you to see:

2a456c42f3d5e99ab95eada05068c16e.png
img

This video tutorial is great for getting started and takes you from scratch . In the end, I will take a project, and a part of the catalog will be intercepted to understand the approximate learning content. It is recommended to brush it from beginning to end, and it is not a big problem to master the basics of C++.

302450d9ad3fd05c16e99b7553972874.jpeg
img
f6b2efb29c9271e7de433cdce7a588b1.png
img

Advanced Video

It's definitely enough to watch the above videos to get started, and it's not enough to watch it for more than 45 days . However, I also list some high-quality C++ learning videos. You can continue to deepen your advanced learning in the future, and you will be able to use them at that time.

The high-quality video I am talking about here is Mr. Hou Jie's C++ video course,

Mr. Hou Jie is very powerful. Even if you haven't watched his videos, you will definitely read his books. The books he has participated in translating or writing include:

  • Deep dive into the C++ object model

  • Analysis of STL source code

  • Effective C++

  • More Effective C++

As long as these books are students who are learning C++, they must have heard or read them (if you haven't read them, you should plan to read them quickly). For students who want to advance to C++, I am also very, very much about Mr. Hou Jie's C++ series of videos. Strongly recommend everyone to watch and learn .

It will definitely bring your understanding of C++ to a higher level! These videos are free and you can watch and learn directly at station B, just search for " Hou Jie C++ " on station B.

[Hou Jie] C++ object-oriented advanced programming:

3c047ca3777b7c9817e2715f74a5f54c.jpeg
img

[Hou Jie] New features of C++11:

1701b6b13864e143b29bc0ae1fc9c25c.jpeg
img

[Hou Jie] C++ memory management - from flat ground to tall buildings:

234caaea766c6895d3a2451a71d90c8f.jpeg
img

[Hou Jie] C++ STL Architecture and Kernel Analysis--From Flat to High Building

It is better to teach a man how to fish than to teach him how to fish. If you are a beginner in C++, don't know where to find video learning resources? I'll tell you!

Generally, you can search it in China MOOC University, NetEase Cloud Classroom, and Station B (really a learning website). In addition to these videos I found, you can also go to the above platforms to collect them! In today's information explosion era, efficient information retrieval is also an indispensable skill!

C++ Primer

Of course, if you just watch the video to learn, you won't remember after watching it once, and you still have to go back to the book . While watching the video learning, look for some C++ textbooks. There are many classic C++ books, and you can search a lot on the Internet, but you will definitely not be able to read the pile of books in a winter vacation. I recommend you one:

  • "C++ Primer" Douban 9.4

5813a311fabd8df6349ac67161d81e3b.jpeg
img

If this book has C language foundation, it should be ok to read it in a winter vacation. I have C language foundation and read it faster. It took about half a month to read it at first. The place is normal, it doesn't matter if you jump over it, just go through it quickly first.

The purpose of reading a book for the first time is to become familiar with the concepts, without seeking further explanation .

I will tell you that although it took me half a month to read this book, it has been sitting on my desk, and every time I have a problem, I will read it to find the answer, and it has been almost 3 years, sometimes before If you don't understand the content, you will suddenly become enlightened when you encounter problems again and again to read, and your understanding of the concept will deepen again and again, and you will have a different understanding every time you look at it!

Now the book is still in hand, but the number of times I have turned it has decreased, and the cover has been torn by me .

fa70dc3fa87d946ff793d5365b13b3b7.jpeg
Primer 4th Edition I bought

When I bought this book, it was the fourth edition. Now there is a fifth edition. You can directly buy the fifth edition. It includes the description of the syntax features of C++11 . These new features are now mature in many open source projects and companies. The project is in use, and there is no harm in learning it together at the beginning of learning.

How to use this book, I have also said before. In addition, the learning method I recommend is: follow the previous learning video + reading synchronously, the specific implementation steps:

  • Which section of the video is about, you can find the corresponding section in Primer first.

  • First preview the corresponding chapters in Primer for the knowledge points to be covered in the video, and then watch the video.

  • After watching a chapter of the video, review it by reviewing the content in Primer.

  • When you have time to write the code for Primer's after-school exercises, remember to code by yourself !

As for other C++ classic books, although I also want to recommend them, this article only talks about getting started. You can’t read too many books in a short time. article.

Projects and Exercises

According to the arrangement I gave you, you can learn from the book and the video, which is almost an entry.

But don't forget, the most important thing, hands-on coding ! You must know that programming is also a craft. If you just watch and don’t practice, you can’t write code in actual projects, and you can only stay at the textbook level because you haven’t internalized C++ into your own.

Where can I find code and projects for Practicing Hands?

homework

The after-school exercises in this classic introductory textbook of C++ Primer are a treasure trove. Those exercises must be implemented by hands, such as the design of the Screen class and the design of the Message class that often appear in the exercises. These are all training your coding skills. The effect of writing it once and reading it again is completely different.

open source project

Find a few small open source projects for you first, practice your skills, and learn from the code style and coding methods of open source projects.

TinyXML

We often need to process XML configuration files in projects. Have you ever thought about writing a simple XML parser by yourself? Here is a very simple and compact XML parser written in C++, which can be easily integrated into other projects. , for the purpose of C++ learning, you can also download the code to learn and practice.

Project home page : http://sourceforge.net/projects/tinyxml/

C++ JSON parser

JSON++ is a light-weight JSON parser, writer and reader written in C++. JSON++ can also convert JSON documents into lossless XML documents.

A lightweight JSON parser written in C++, which can also convert jSON documents into XML documents

Project homepage : https://github.com/hjiang/jsonxx

Mini C++11 JSON library

json11 is a tiny JSON library for C++11, providing JSON parsing and serialization.

It is also a mini JSON library, with only 1 CPP file and one header file, which can be easily embedded into your own project

Project homepage : https://github.com/dropbox/json11

The above is the learning advice I gave you for "C++ Short-Term Introduction". The full text is summarized :

  • Video learning is preferred

  • Quickly read books to master C++ knowledge framework

  • After-school exercises and small projects to practice and consolidate

I came back from get off work and sat in front of the computer for a few nights, and accidentally wrote a few thousand words. It should give you some learning directions. Self-learning is an introduction to overtaking in corners~

729d3e9cea17979c89c033dfcb0f51bc.gif

·················END·················

Guess you like

Origin blog.csdn.net/weixin_41055260/article/details/126844585