Replying to Avatar ChipTuner

Glad you found the one for you. Keep my npub if you want to do more C/C++ things :)

C++ is everything some dream of C with all the modern OOP. Yeah it's a beast, even systems developers admit that. Since C++ is a superset of C you can abuse C++ with C patterns (and many do because when in doubt just access memory directly) C++ adds many complicated features as security mechanisms to leverage the compiler (templates specifically) to help you make better patterns if you want to.

Imo C++ is a complexity short-cut, steeper initial learning curve, but dividends in high level applications compared to writing C. That an C++ has actually package management solutions where C doesn't really.

Finally since C/C++ compilers literally take individual C files, assemble them, and then implement machine code (translational units) called object files, it's a super manual process which is where GNU Make and CMake come in, both of which require their own languages too. Noscrypt (my nostr cryptography library) has like a 600+ line CMake file just to orchestrate the build lmao. So you're not just learning to write code in the language, you're also learning the compiler and build system.

Before I even write a line of code for a hardware project I read the manufactures' compiler manual. Because you may not realize that int is actually not an int at all, or the register keyword will cause stack issues because registers are limited. In C it's forced and for good reason, but not everyone needs to learn system level programming to get the job done nostr:npub1ecdlntvjzexlyfale2egzvvncc8tgqsaxkl5hw7xlgjv2cxs705s9qs735 can speak to this as well I'm sure

Not sure how much I can add to this. nostr:npub1qdjn8j4gwgmkj3k5un775nq6q3q7mguv5tvajstmkdsqdja2havq03fqm7 covered most everything I would have to say.

In my personal experience, I only started appreciating the complexity of C++ with respect to C - in other words the ++ part - whenever I would encounter the limitations of C.

At this point in your learning process, you shouldn’t fret about what happens under the hood with C/C++ programming like target CPU architecture, build systems and makefiles, talking with the kernel, all this is too overwhelming at first.

I suggest that you begin by porting basic python code to C/C++

Like reading keyboard input, string manipulation, data types and structures, reading/writing to files, sockets, threads, etc.

You start with things step by step. And then you decide how deep you want to go.

Reply to this note

Please Login to reply.

Discussion

No replies yet.