News for hackers. Stuff that matters.
Re:Principles for C programming by userbinator on Thursday March 16, 2017 @07:46AM (#13884223)
"Magic" becomes obvious common-sense once you understand. The overall theme of the parent comment is that we should try to understand instead of giving up, because that's what makes us learn and become better at the language.

IMHO if you want to become an expert in C and C++, you must be able to read Asm and understand what the machine is actually doing.

A very relevant article on this same idea: http://www.linusakesson.net/programming/kernighans-lever/

Re:Principles for C programming by thlst on Thursday March 16, 2017 @08:14AM (#13884359)
Magic has nothing to do with understanding assembly. Magic simply is probably undocumented piece of code (they aren't even self-documenting), that in order to understand you have to ask the author about it. There's no magic if you understand the code right away, or by looking up some reference.
Re:Principles for C programming by attractivechaos on Thursday March 16, 2017 @10:20AM (#13885195)
> "Magic" becomes obvious common-sense once you understand.

I fully agree. Packing data into a binary array, popcount with bit fiddling, macros for generics, etc may seem "magic" to some, but they can be useful especially in performance-critical code. Once you understand these "magic", they are just some common pieces in your toolbox. C is a simple language. Learning C plus such "magic" still takes much less time than grasping the entire C++.