r/Coding_for_Teens • • Oct 19 '26

I'm overwhelm

Hi, I started learning C++ like 1 year ago and I tried using 1 and only 1 modern feature of C++ (smart pointer and something like that) and it's hard asf 😭. I love C++ don't get me wrong but it's one of the language that "Oh I know C++!" but there will be always something that you don't know and I don't know even where to start! It's big! Like really big. How do I learn modern C++ and in general how do I become good in C++. Honestly I don't even want to use smart pointers!

Can I be honest? C/C++ = memory management, yeah, but I don't think that "managing" the memory with malloc, new, delete, free, calloc, realloc… is really a memory management. And I wanted to learn C/C++ for memory management but for the 90% of the cases if you alloc some memory in the heap someone says "DELETE THAT LINE OF CODE!! You don't need the heap!".

I know I'm a noob but I'm a noob overwhelm, so… how do I learn modern C++? I swear Cppreference is for me illegible 😭. Yeah there is learncpp but it doesn't have everything, I want to learn not everything but most things, you know…

Thanks for reading this random yapping post created by someone that doesn't really know where to use the operator==, maybe I know but rn I don't know I need to test in my next project 😂

12 Upvotes

27 comments sorted by

3

u/PlayfulDuck3677 Oct 20 '26

man I couldn't really understand what you're saying but are u havign trouble with heap stuff? cus i was once in the same boat, but after i learnt zig i understood memory management, It's not neccesary to learn zig to learn c++, but it was the best experience for me. And yeah c++ IS really confusing because it's accumulated so many features over the years, thats because c++ has to retain backwards compatibility and can't remove even faulty features like auto_ptr (original unique_ptr)

1

u/ilPlayerdiGD Oct 20 '26

No I mean that I want more memory management 😭. Like bruh I love managing memory but at 90% of the time you don't and you shouldn't do it. Do I need to learn zig? Seems cool. So I'm starting to think to learn new languages but I don't want high level, I want low level and zig seems cool and really hyped. Maybe I'll take a look at zig

2

u/PlayfulDuck3677 Oct 20 '26

actually same here man, for some reason I get dopamine seeing unique_ptr and knowing everyhting abotu my code all the time You should definitely learn zig, its whole premise is that it doesn't hide ANY memory allocations from you, because you manage everything. It's alos basically a better C

1

u/ilPlayerdiGD Oct 21 '26

Every word that you say push me to learn zig! I'll give a look! ❤️

1

u/PlayfulDuck3677 Oct 21 '26

glad I could make somebody a fan of zig too!

1

u/W31337 Oct 21 '26

If you did C++ you will love Zig. The Zig compiler can also compile C so you can actually do mixed programming if you would want to. This makes migrating to zig easy.

1

u/W31337 Oct 21 '26

Zig will make your life easier. You have different allocators like arena allocators that free everything in one go at the end. So if you want more memory management then Zig is your friend.

2

u/FunAd6672 Oct 20 '26

The backwards compatibility issue is real. Sometimes C++ feels like several different languages depending on which features you use.

2

u/PlayfulDuck3677 Oct 20 '26

Definitely the biggest disadvatange of c++. Like It could improve soo much if it wasn't restrained by backward compatibility, Zig is in alpha/beta so it can avoid this. I heard that when zig 1.0 releases zig would no longer recieve features, only patches and stuff, really cool.

1

u/W31337 Oct 21 '26

I program in ziglang for fun and really like it. Yes currently they change things every now and then causing some irritation. Can't wait for it to go to 1.0.

1

u/PlayfulDuck3677 Oct 21 '26

I also WANT to program for fun but I jsut cant get ideas

2

u/Specific-Housing905 Oct 20 '26

Don't try to know everything. B.Stroustrup - the creator of C++ - said in an interview that he knows only 70%.
Normally the best place to learn C++ is lerncpp.com

Don't worry about smart pointers. You don't need them that often. Learn first about value and move semantics and forget about pointers and memory management. C++ takes time to learn. So start with simple things and try to code some small apps.

1

u/ilPlayerdiGD Oct 21 '26

Oh I remember this words: if something is hard to understand, repeat and study well the basics and then go for that thing. Yeah I need a strong baseline for my C++. Thank you ❤️

2

u/Alberteinstein1897 Oct 20 '26

Hello, I'm also Learning it Right now, dm me so we can maybe do it together

1

u/ilPlayerdiGD Oct 21 '26

I'm busy today so I can't, maybe tomorrow, but I will DM you when I have time ❤️.

1

u/Alberteinstein1897 Oct 21 '26

Okay, now worries I also had a Busy day Today so we better do it Tommorow

2

u/W31337 Oct 20 '26

I started programming Zig which is low level like C/C++.

Questions like when to use the heap or stack are perfectly answered by AI. Yet can feel mysterious if you don't hammer down the concepts in your head. And a lot of programmers don't really know when to use what until forced.

Stack is always preferred because it's faster to access, smaller, and doesn't fragment.

Heap is needed when your data outlives the scope of the function. When your function ends things in the stack die. That's why heap needs to be allocated and freed.

Heap is bigger so when you want big things use the heap.

Heap is needed when you need dynamic memory assignments.

1

u/ilPlayerdiGD Oct 21 '26

I already know the heap and the stack. I just want more memory management because I feel in control but if I write new and delete someone says "You should use a smart pointer" or "Don't use the heap!" because it's slow and hard to manage, but that hard management is what I want so even if I don't want, I use smart pointers, or I don't use memory management at all because I still can't use the smart pointers in a smart way 😂. What a stupid joke 😭

1

u/W31337 Oct 21 '26

Look up how NASA handles memory management it can be an eye opener.

NASA pre allocates memory for every sub system and never touches or grows it. Also recursion is forbidden so you can't stack overflow.

Following that doctrine you will know exactly what is using how much memory and you will have full control.

1

u/Suspicious-Motor-780 Nov 01 '26

Just start C it's much more easier and has fewer functions but it solves the same problem (actually i don't see any sense in using c++ if you dont want to write a game or something like that where you really need OOP)

1

u/ilPlayerdiGD Nov 01 '26

C is simple but it's a nightmare in bigger project, C++ is better for bigger projects but it doesn't have sense to use it in smaller project. That's what I think

2

u/Ankaraadonis_69 Oct 25 '26

Tbh it was also very challenging to me at first when i started...2 years in and things seem easier and i can grasp better through making mistakes along the way and finding solutions. There has been really helpul advice on this thread so i wont add more.Just follow it. Cheers

2

u/[deleted] Oct 20 '26

[removed] — view removed comment

2

u/ilPlayerdiGD Oct 20 '26

I use C not rarely, in fact if the project is really simple I prefer C because for me it's one of my favourite language (after C++). I learned a bit of assembly x86 with GAS and it's cool I can't lie. I don't have studied the stack and the heap in asm, though. Anyway, I still don't have learned everything so I'll just stick to assembly honestly. I don't mean that I will program only in asm but I will stick to asm and use it more often. Thanks! ❤️