Hacker News new | ask | show | jobs
by userbinator 3450 days ago
I've actually had a few coworkers think I'm some sort of elder god when I find the root cause of subtle bugs that would've either required deep knowledge of the C++ standard, or not-as-deep knowledge of Asm. These are bugs that others have spent many hours staring at the source and stepping through in a debugger without any better idea of why they occur, but are solved in minutes by a glance at the Asm. IMHO if you are working with native code at all, it's a very useful skill to have.
3 comments

Even though it was a bit of a "sufferance", I enjoy having been full circle somehow. Starting with Java OOP in college, then went lisp maniac [1], then ml/FP. Which were all somehow further away from the machine, in a way. But at the same time lisp model seems a fairly thin layer over raw asm. And you realize that primitives of computing: arithmetic, logic, iterations.. are very similar whatever the language or paradigm. I then learned a bit about continuation, non determinism, compilation and now I'm almost free. A language is mostly an encoding. Most of them speak about the same things but in a different clothing.

Not 100% free, I think I need to finish my compiler training and forth bootstraping before I can claim that.

I can't really suggest others to follow the lisp, ml, prolog road though, so I'll just state what I wrote above.

[1] SICP especially, with its gradual pedagogy. From substitution, to environment, to register machines. You can see the relationships up close.

Everyone who works with native code, not just C or C++, should at least understand how linkers and loaders work.
Once you are tired being praised, teach them some valgrind. It will solve most of their problems.
I'm pretty sure the bugs I found would not have been valgrind-able as they were unrelated to memory errors.
From my experience most of the hard to trace errors come from uninitialized variables and they are usually valgrindable. It is VM-based so it can cache jumps and other conditions that depend one uninitialized vars via taint analysis.