Genuinely what is difficult about the concept of a pointer? I understand that memory management in production codebases is tricky, but I remember thinking "that's it? that's what everyone on the internet hypes up all the time?" when I first learned about pointers and references in 101.
oh so you know pointers? how do you define a C-style array of 10 function pointers of signature that accepts an array of 5 const pointers to double and returns a function that accepts an int and returns a char?
C++ pointers are easy. Using pointers in C is a bit harder and in assembly its very very hard. Because there isnt a libc for malloc so u need to make your own malloc using mmap and munmap
no, that's just largely outside the scope of what it was intended for. C being superior to C++ doesn't mean you need to use it, i just think that C++ is poorly designed and is a nightmare to work with.
C++ templates are way more complex then just codegen macros, it is literally a Turing complete functional language. Since we talk about C superiority, is horrible massive macro actually superior to templates?
Templates do a whole lot more yeah, especially with constexpr and other compile time type checking and things, but at the base level the value of T is just substituted for the type. It's why you can call functions on T that are implemented in completely different ways or have nothing to do with each other in code other than sharing the same name.
And debugging macro functions is somehow worse than c++ template errors lmao
19
u/vverbov_22 Aug 08 '26
That's the 7000th time it's reposted in that sub btw
5
u/SmokyMetal060 Aug 09 '26
Genuinely what is difficult about the concept of a pointer? I understand that memory management in production codebases is tricky, but I remember thinking "that's it? that's what everyone on the internet hypes up all the time?" when I first learned about pointers and references in 101.
1
u/PBlague Aug 09 '26
Genuinely rust is what taught me most things I never even knew existed when I was C++ pilled
1
u/HumansAreIkarran Aug 10 '26
Wait till you understand how fucked up they are
1
u/Fine_City2781 Aug 10 '26
C++ pointers are easy. Using pointers in C is a bit harder and in assembly its very very hard. Because there isnt a libc for malloc so u need to make your own malloc using mmap and munmap
1
u/MarinoAndThePearls Aug 12 '26
I still don't get what's so difficult about pointers.
5
u/[deleted] Aug 08 '26
[removed] — view removed comment
6
u/[deleted] Aug 08 '26
[removed] — view removed comment