4 ms·
If a programmer can't at least read (normal) assembler code, I'd doubt they're a fully qualified programmer. (Just my way of viewing things, I might be wrong. M
by kasperni 7y ago
If a programmer can't at least read (normal) assembler code, I'd doubt they're a fully qualified programmer. (Just my way of viewing things, I might be wrong. My reasoning is that if you don't know assembler code, you probably don't know what a simple line like 'foo = bar + "abc"' even entails.)
My point being, that it is a bit arrogant claiming that somebody isn't a fully qualified programmer unless they understand X technology. In my book you can be a fully qualified programmer (what ever that entails) if the only programming you have ever done is in Excel.
- habnds 7y agoComparing C to python, the lack of explicit memory management and pointers in python make it hard to understand what the machine is actually doing compared to writing in C. Are there equivalent examples between C and assembler? What sort of conceptual stuff is C missing that assembler clarifies?
- ginko 7y agoCalling conventions, inlining, understanding the cost of indirect function calls.
- foota 7y agoYou could argue it's not conceptual, but you don't have to deal with registers in C. Also system calls. C handles dynamic library loading, I think. Not too familiar with how that works in assembly.
- kazinator 7y agoYou have to deal with those register when debugging C, at least from time to time. C debuggers show you the registers; e.g. "info reg" in the GNU debugger. Linux kernel debugging often means working from a dump of the CPU registers, raw memory around the stack pointer, and surrounding the instruction pointer. From that you figure out what bad thing the C code did.
- pjmlp 7y agoSIMD, registers (you can do clever stuff with direct control of them), and lots of opcodes that aren't exposed to C.
- GoblinSlayer 7y agoAssembler specifies what actually happens. What is undefined behavior, again?
- kazinator 7y agoAlthough that lower level stuff (like calling conventions and register use) is missing in C, you have to deal with it when debugging C. C programmers know how to debug at the machine level. By contrast, the average Python programmer couldn't debug into the Python internals if their life depended on it.
- craigsmansion 7y agoVery much so. But there are many architectures and C is a reasonable "portable assembler" of sorts, so having an inkling of a single ISA and a grasp of C will help a lot in de-mystifying more complicated data structures in any language on most architectures. But you are correct that C by itself is not quite enough.
- esjeon 7y agoTo be fair, machine-generates assembly codes are much more cryptic than hand written ones. That’s why, even though the language is straight simple, reading through it is still difficult. The same works for high level languages, like generated parser, generated protocol layer, generated object system, etc. And, yes, knowing assembly sometimes do make huge difference as a programmer, but only in limited fields.
- notacoward 7y agoThe difference, of course, is that significant classes of programs are still mostly in C - operating systems, compilers, databases, web servers, etc. The same can not be said of assembler.
- kazinator 7y agoI agree with both of you.