15 ms·
It's not that hard to write assembly. It is hard to write good assembly. In order to produce maintainable software you need incredible discipline (and probably
by kevincox 4y ago
It's not that hard to write assembly. It is hard to write good assembly. In order to produce maintainable software you need incredible discipline (and probably some advice what that discipline should be).
To a large extent you can consider high level languages opinionated. They have decided how to pass arguments, how to return values and how to lay out memory. The programmer no longer needs to think about these things, and they can't mess them up if they try. Doing this yourself you need to pick to those conventions and stick to them if you want maintainable software.
Of course the benefit of assembly is that it is trivial to break those conventions when there is good reason (optimization for example) but then you will pay the price of more difficult maintenance for that unconventional code.
- labrador 4y agoI was hired to write assembly (68000) so I didn't know any better. I liked developing the discipline and the knowledge of the machine. I still miss it sometimes. But like another comment said, it's tedious, so I wouldn't go back to it.
- retrac 4y agoGreat point. The only time I've been required (rather than for fun/hobby purposes) to write assembly was for a controller where we didn't have a C compiler. Like I hinted, I followed the approach of writing in C (including testing it as much as possible on my desktop in C) and then hand-translating precisely because of what you mention -- by default there's no structure. I basically adopted the structures and conventions of the C language and C compilers and imposed them on my assembly code, since I was familiar with those, and know how to make working software using them. You could use another language's conventions. Or you could veer off into the wild, but there be dragons.