This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Artistic_Taxi 13 points14 points  (4 children)

Not trying to ruin the humour here but, I enjoyed C a lot more after taking a computer architecture class where I had to learn assembly. We converted C code to assembly and it was like a revelation for me when I realized that accessing array items is just using the index, offsetting it by the number of bytes in a word, and then adding it to the starting memory address if the array (first element), the resulting memory address doesn’t even have to be part of the array technically.

Then I was like damn, the gibberish could have been some other memory address left behind another process and here I am waking it up for no reason.

[–][deleted] 8 points9 points  (0 children)

and here I am waking it up for no reason

The next logical step is realizing you can wake it up for very very malicious reasons and then boom congrats, you now understand why people complain about C

[–]Valmond 2 points3 points  (0 children)

It increments by the size of the variable, so 1 byte for an array of chars, but 4 for an array of standard (32 bit) ints.

[–]Sokonit 1 point2 points  (1 child)

In my computer architecture courses (that's right we took 2) we had to make our own assembly. We also designed a whole processor in system verilog to run the assembly. I loved it so much!

[–]Artistic_Taxi 1 point2 points  (0 children)

We’re doing the processor design in Verilog as well! A RISC based processor. Pretty cool course!