We're sunsetting PodQuest on 2025-07-28. Thank you for your support!
Export Podcast Subscriptions
cover of episode 852 How To Learn C++? (C++ Programming) - Simple Programmer Podcast

852 How To Learn C++? (C++ Programming) - Simple Programmer Podcast

2021/12/15
logo of podcast Simple Programmer Podcast

Simple Programmer Podcast

AI Deep Dive AI Insights AI Chapters Transcript
People
J
John Sonmez
Topics
John Sonmez: C++ 是一门很难的编程语言,但它具有很高的学习价值。学习C++ 的过程中,你可能会遇到很多困难,例如,你可能只学习了C++ 的理论知识,而缺乏实际编程经验。你可能只知道如何创建类和函数,却不知道如何用C++ 编写实际的应用程序。你可能因为学校的教学方式而难以通过查找教程来学习C++ 编程,因为学校要求你们自己定义库函数,而不是使用STL。 解决这些问题的方法是:首先,你需要学习并使用STL(标准模板库),这是实际应用中非常重要的部分。其次,你需要参与实际项目,例如贡献开源项目或者创建你自己的项目。这将帮助你更好地理解C++ 的应用,并提高你的编程技能。你可以尝试参与编程竞赛,例如TopCoder,这可以帮助你提高你的算法能力和编程速度。 此外,阅读一些优秀的C++书籍,例如Scott Meyers 的《Effective C++》系列,可以帮助你更好地理解C++ 的编程思想和最佳实践。记住,学习C++ 需要时间和努力,但只要你坚持不懈,你就能掌握这门语言,并用它来开发出优秀的应用程序。 Alberto: Alberto 的主要观点在于他在大学学习C++的过程中,遇到了实际编程的困难。学校的课程主要集中在理论知识的学习上,例如如何创建数据结构和函数,而缺乏实际编程的训练。他希望能够学习如何使用C++编写实际的应用程序,并寻求一些建议。

Deep Dive

Key Insights

Why is C++ considered a difficult language to learn?

C++ is challenging because it requires managing memory, pointers, and other low-level details, making it harder to master compared to higher-level languages like Java or C#.

What is the importance of using STL (Standard Template Library) in C++?

STL is crucial because it provides pre-built libraries for common tasks like creating lists and handling data structures, which are essential for real-world C++ programming.

What advice does the speaker give for learning C++ effectively?

To learn C++ effectively, contribute to open-source projects, build substantial applications, and use platforms like Topcoder to practice solving algorithm problems and understanding others' code.

What are some recommended books for mastering C++?

Books like 'Effective C++' by Scott Meyer, 'More Effective C++', 'Effective STL', and 'Code Complete' are highly recommended for learning C++ and improving coding practices.

Why does the speaker suggest contributing to open-source projects for learning C++?

Contributing to open-source projects helps in understanding real-world codebases, fixing bugs, and adding features, which are essential skills for becoming a proficient C++ programmer.

What is the speaker's opinion on the future of C++ in the job market?

The speaker believes that while C++ is still used, most new applications are developed in languages like Java, JavaScript, or C#. However, mastering C++ can make learning other languages easier.

How can Topcoder help in improving C++ skills?

Topcoder offers algorithm challenges where users solve problems using C++ and compete with others, providing an opportunity to learn from others' solutions and improve coding skills.

Chapters
A computer science student is struggling to learn C++ programming despite studying the theoretical aspects. The student seeks advice on bridging the gap between theory and practical application. The question explores the relevance of C++ in the current job market.
  • C++ is difficult to learn
  • University focus on theory, lacks practical application
  • Student struggles to apply theoretical knowledge to practical programming

Shownotes Transcript

Translations:
中文

Welcome to the Simple Programmer Podcast. Making complex programming simple and fast. With everything from career advice to philosophy. It's the Simple Programmer Podcast.

Hey, John Sonmez from simpleprogrammer.com. I got another question that I was going to answer in this video today about learning C++. How do you learn C++? There's a little bit more to it than just that. This question is from Alberto and I'm going to paraphrase a bit here, summarize this because it's a little bit long. He said that he came across a post regarding whether or not C++ was making a comeback and he's got a simple thing to ask. How did I learn C++?

He basically says that he's been studying at a university to get his BS in computer science and he's been getting stumped on how to actually program in C++. He says the school doesn't offer too much. It focuses on learning the uses and how to create structures and functions on paper, which he's been getting through the course with, but he needs to learn how to actually program and can't find any help.

He's been told by TAs and some faculty members to look up tutorials instead of trying to teach them methods, which makes things harder because you can't look up a section of code and transfer it over because we actually have to define our own library functions based on STL. Basically, other people use STL. If you're familiar with C++, it's a template center, template library or language library.

It shortcuts a lot of things like creating lists and the kind of—what you would see in a lot of Java, .NET framework kind of library functions. He says, "So now I may be looking at this wrong, but in any case C++ is the only language we'll really use until we graduate and I cannot keep skimming by simply on the pen and paper portions of the courses. Is there any advice that you can offer?"

Okay, so Alberto, here's the deal. C++ is difficult.

Obviously, it's a language that I don't really recommend learning today as opposed to C# or Java or JavaScript, but your school is requiring you to learn it. It's not a bad language to learn because if you can do C++ you can program in any other programming language because everything is easier than C++. That should make you feel somewhat good because it's hard and that's why you're having trouble with it.

What I hear you describing is that you're basically learning some of the constructs of C++, how to solve algorithms and how to build structures, but you're not actually learning how to program in C++. You actually want to write an application.

This was something I struggled with for a long time, especially when I was learning C++ is I felt like I could create classes. Sure, I could do that. I can create a function for you if you want that reverses a string or whatever, but how would I actually write a real application using C++? Well, the good news is fortunately for you there

There's not a lot of real applications that you would start today that you would write it from a new application in C++. If you get a job doing C++ work, most likely you will be extending an existing application or supporting it. Some companies do create new applications in C++ today. I know I'm going to get a little bit of hate from that, but I'm just telling you majority and likely you'll be programming in Java, JavaScript, C Sharp unless you specifically are looking for C++.

Here's the thing, if you want to learn it and you want to learn to the degree of being able to build the applications, first of all, you do need to use the STL. When you see example code that's using STL, I know you can't implement it in your classroom, but real world usage,

People don't implement things themselves. They use STL. They use libraries. That's the most important skill. Recognize that that actually is important and that's not a shortcut. You're not really learning C++. That's the first thing. The second thing is you need to actually— What's up, guys? John Sonmez here from simpleprogrammer.com. I want to tell you about my free blogging course that you can sign up for at simpleprogrammer.com forward slash pblog.

Now, this free blogging course is going to tell you how to create a blog to boost your career. It's something that you definitely don't want to miss. Thousands of developers have already gone through the course, the free course that you're going to get by email, and have learned how to create a blog to boost your career, to make more money, and even to grow their own side business. It's something that every single developer should do, especially if you're a web developer. You should have your own blog. I'm going to show you exactly how to do it, how to be successful, how to get traffic,

everything that you need to know about creating a blog and even making money from it, just go to simpleprogrammer.com forward slash pblog to sign up now. Once again, it's simpleprogrammer.com forward slash pblog. Build something of substantial size or contribute to something. I wouldn't recommend just creating your own C++ app.

There are obviously frameworks that you could create a Windows app. Windows 8 supports it or you could create a Linux app or

There are a lot of different platforms. You can even program iPhone and Android using C++ although it's quite difficult. But you might be better served by looking on something like GitHub to see if you can find a C++ project that you can contribute to. Start by fixing bugs. That's what you'll do in the real world, trying to understand the code base.

and then adding some features. If that works out and you're feeling comfortable, then the next step would be to create your own application, to create something simple, maybe a very simple Windows application or Android. Just pick a platform, learn the tools for it. That's going to be the hardest part is getting set up for that application.

Then go through it, but here's the thing about learning C++ in general. It takes time and it's difficult and it's just going to be a matter of writing a lot of C++ code. One of the ways that I really learned C++ best is I use a site called Topcoder and they have all these kind of problems you have to solve and a competition interface if you want to do that. In Topcoder, you solve this algorithm problem and

Other people are competing to do that at the same time. There's a part where you solve these three different problems and you use STL or whatever and you try to solve it. Then after that you come to this round where you try to challenge other people's solutions. You give them bad inputs that will break their program. Well, you get to see their code when you do that. That kind of helped me to learn how other people were doing this that were really good at C++.

That really helped me. I just started doing Topcoder every single week or like twice a week for a while and that really brought my C++ skills up. But yeah, C++ is difficult language to learn. You're just going to have to write a lot of code. The more code that you write and the more code that is actually doing something useful. That's why I say contribute to some kind of open source project.

Start your own project and that's how you're really going to learn it. Yeah, it's a big thing. You need to learn STL as well because that's a real world thing. A couple of books I recommend, Effective C++ by Scott Meyer, that whole series. If you go through Effective C++ and more Effective C++ and I think he has Effective STL.

I used to love those books. Those are really great C++ books. Code Complete is another great book, not necessarily C++, but just in general structuring your code. Hopefully that helps you. Good luck with this.

Don't worry too much. You've got to think though if you're going to become a C++ programmer or not. If you're not, then don't worry too, too much about understanding C++ that much. But if you do master it, like I said, you'll be able to do any other programming language pretty easily because it's much easier once you can manage memory and pointers and all that in C++.

a lot of things become a lot easier. Don't worry. Don't get too overwhelmed. Other people do it. You'll do it just fine. You just got to keep on hitting it. Get your own projects going. Start writing a lot of C++ code and read some really good C++ books like the Effective C++ series. Well, that's it for this video. If you have any questions or comments, leave them below or send me an email and subscribe to the channel. Take care.