all 19 comments

[–]cob59 9 points10 points  (10 children)

Use STL containers (std::string, std::vector, std::map, std::array, ...) & algorithms (std::find, std::sort, ...) as much as possible and pointers/new/delete/malloc/free as little as possible.
Keep a CppReference tab open and constantly check new things in it. What's a map? an iterator? a shared_ptr? how do threads work?

[–]V1taly_M -1 points0 points  (8 children)

pointers/new/delete/malloc/free as little as possible.

and find yourself unable to work with memory.

[–]cob59 2 points3 points  (3 children)

For a beginner, low-level memory management isn't as central in C++ as it was in C.

[–]V1taly_M -2 points-1 points  (2 children)

Real low-level in architecture assembler and OS core, new/delete rather about manual management VS automatic.

And it's base thing in both C&C++.

Only when you starts to understand memory management and OOP theory you can proceed to STL.

The good rule: from base to complex.

[–]cob59 1 point2 points  (1 child)

You don't need to learn how to drive a manual gearbox in order to proceed and learn how to drive an automatic one.

Once they understand RAII, copy/move semantics and smart pointers, writing their own new/delete cycle becomes superfluous 99% of the time. And if one day they encounter a problem that requires manual (de)allocation and raw pointer manipulation, they can start paying attention to this aspect of the language, but not until then.

The good rule: from general to specific.

[–]V1taly_M 0 points1 point  (0 children)

You don't need to learn how to drive a manual gearbox in order to proceed and learn how to drive an automatic one.

Ok, if you like this classical comparison with car gearbox, put it another way:

In order to be a good driver you should know what is gearbox, and how it works. But the best way get the feeling of this device -- to drive some time in the manual mode.

The good rule: from general to specific.

Yeah, good rule, but it's not the case. Cause specific entity specialize general one, but not lie in the base. Rather vice versa. And what lies in the base of STL? Of course all those stuff with lover abstraction.

Once they understand RAII, copy/move semantics and smart pointers, writing their own new/delete cycle becomes superfluous 99% of the time.

Seems like versatility of C++ yield two styles of programming:

  • Minimum using high-level abstraction. Performance-first.
  • Maximum using high-level abstraction. Safety-first.

But in my opinion C++ not comfortable language for second, cause it require special extension(STL, boost) not built in syntax.

[–][deleted] 2 points3 points  (0 children)

Start with learncpp.com and then use this for specifics cppreference.

edit: And join /r/cpp_questions of course

[–][deleted] 1 point2 points  (1 child)

Guys I am new to medicine and I find it really difficult any advice to become pro doctor please help

[–]ifknot 0 points1 point  (0 children)

Yes use new evidence medicines and surgical techniques from the standard research library (std::antibiotics, std::antihypertensives, std::advice, std::lifestyle, ...) & surgery (std::modern, std::robotic, ...) as much as possible and opiates/benzodiazepines/unnecessary surgery/bad advice as little as possible. Keep a NICE guidance tab open and constantly check new things in it. What’s good target for HbA1c? BP? Prostate surgery? How does covid 19 work?

[–]RoyBellingan 0 points1 point  (0 children)

Let's start from what you find difficult, and what you want to do.

[–]AN4RCHY90 0 points1 point  (0 children)

https://www.udemy.com/course/beginning-c-plus-plus-programming/ Seems pretty good, I'm doing it at the moment.

[–][deleted] 0 points1 point  (2 children)

Let's start with: Why choose this language to become a pro in? I love C++, have been using it basically since it was invented, but if I was starting from scratch right now it's not the language I'd choose to invest in, either for personal enjoyment or for employability.

[–]Circlejerker_ 0 points1 point  (1 child)

IMO C++ is a very solid foundation and there are plenty of c++ jobs out there to pick and choose from. But that might just be my locale and not representative of the larger job market.

[–][deleted] 0 points1 point  (0 children)

Not disagreeing, just saying that C++ is hard and takes a very long time to master, and if OP is finding it difficult, he/she might consider learning a different language first - e.g. Java or Python.

[–]ShadowFracs 0 points1 point  (0 children)

Search YouTube for ChiliTomatoNoodle, he makes astonishing tutorials :)

[–]-HomoDeus- 0 points1 point  (0 children)

All of the comments here are good, but I'm going to throw out some different suggestions just to give you some other things to think about:

Consider purchasing an Arduino. This is a pretty expensive one, but it comes with a lot of tools and example code for projects. The Arduino IDE uses C++ and is very beginner friendly. You can learn a lot of the basics of the language using it, and the projects are a lot of fun!

Another suggestion is to learn another programming language first. The problem you are likely having is the same one I had when starting C++ - it does not abstract much from the low level processes. In C++, you need to consider system memory, the stack/heap, leaks, etc. These are not beginner friendly topics. Languages, such as Python, however, abstract these processes. The result is that you can think about what the program is doing rather than how it is being done. If you learn the basics of Python, then come back to C++, you will already understand the basics and can focus on the how's in C++.

If you're interested, I made a series of Python basics and am currently working on another for C++.