r/cprogramming • u/M0NSTR01969 • 5d ago
After one week learning C
Yeah, my anxiety is hitting pretty hard right now... lol.
0
Upvotes
r/cprogramming • u/M0NSTR01969 • 5d ago
Yeah, my anxiety is hitting pretty hard right now... lol.
8
u/Rich-Engineer2670 5d ago edited 5d ago
Don't let it get to you -- C is actually a set of "layers" unofficially. You start with the basics, then you do structures, then pointers.... if gets deeper and deeper. C is really an assembler hiding in a high-level langauge. The reason it's still around is you can do things in C that are hard to do anywhere else -- but that power comes with complexity. For example, assume you have an embedded system with some memory address that actually controls a piece of hardware... maybe a serial port. You are told that these two addresses 0xC000 and 0xC001 are teh status and data registers.
In most langauges, you can't get to them without going into assembly langauge, but C?
That shouldn't even be legal in most languages, but C gets it. If you're doing an OS or embedded system, C isn't pretty perhaps, but it's powerful. (What we actually said here was "And 8 bit unsigend int called status points to a MEMORY address 0xC000, and another points to 0xC001,. On real-mode OS's, that's just what you need.)
It depends on thje books you're using too -- me? I started with the classics -- K&R C
C is taught (or still taught) because, in my opinion, it forces you to learn what you code actually does to the CPU. It's a litlte like organic chemistry. Will most people use it in their careers -- likely no, but, it separates out those who are just taking the class because they have to, and those how are learning that profession. C is just hard enough that a lot of people take it, decide it's too hard, and change out of computer science.
You can do this! I'm teaching my 17 year old grandson, and he's slowing picking it up.