4 ms·
My pathway into software development was through electrical engineering and embedded systems. So I don't know if this applies to other ways into software develo
by aequitas 6y ago
My pathway into software development was through electrical engineering and embedded systems. So I don't know if this applies to other ways into software development as well. But what really stood out to me in the beginning was how useless code comment where. I would almost always see code like this:
x = 1; // assign 1 to x
y = x * 2; // multiply x by 2
I don't know if it was because they thought electrical engineers needed to be explained everything about code. Or if it was because all teaching material used this style and people just copied it. But I never understood why you would add comments like this, but had to do so anyways otherwise I would not pass my exams.
It took me a while to learn that comments are the tool in which you can express your expectation of what the code should do.
- blt 6y agoThose samples were probably written by someone who had learned how to code in assembly language. In assembly, this kind of comment reminds the reader of the semantic meaning of what is in each CPU register. It could be very useful. Then the person learns C and never drops this habit.