Hacker News new | ask | show | jobs
by Cushman 5335 days ago
You can't write a program in C without knowledge of assembly, unless you're willing to defer debugging to someone who does.

You can't write a line of code in any language if you don't know, on some level, what it's doing in the machine (whether physical or virtual). Sure, you can, but you're not a programmer, you're a tinkerer. To really program, you need to know assembly.

But at some scale, your application becomes large enough that no one person, no matter how well they know the assembly it's compiled to, can hold the whole thing in their head at once. At that point, reliably adding a new feature isn't hard, it's impossible. There will be side effects you can't predict.

Abstraction isn't there for making hard things easy. It does, and that's nice, but that's not what we need it for. We need it to make impossible things possible.

5 comments

The situation of CoffeeScript and Javascript isn't the same. All the existing debugging tool will only show you Javascript code when you want to debug. C is different on that point. Almost all (if not all) the IDE in which you can code and debug allow you to debug without having to ever see any line of assembly. You don't have to understand the generated assembly code to code in C, because you will never have to look at it.

The situation of CoffeeScript would be like C if the only way to debug C code was to debug it in assembly.

> All the existing debugging tool will only show you Javascript code when you want to debug

The key word here is "existing". This is about to change with CoffeScript support being worked on in Firefox (and some plugins like AceBug)

For details see: http://www.quora.com/CoffeeScript/Is-there-a-CoffeeScript-de...

At some point, being able to forget about what's below is a rare skill. Focusing on building your app, without necessarily having to understand everything it depends on, is hard work if you're a bit curious.
> To really program, you need to know assembly.

That's just an absurdly untrue statement.

All abstractions are leaky to some degree. There will be problems you don't understand if you don't know what's happening one layer down. This is not to say there's something wrong with being a tinkerer - but it is saying that there is a difference between a tinkerer and a professional. http://www.joelonsoftware.com/articles/LeakyAbstractions.htm... for better writing on this topic.
Well you don't need to know opcodes, but that's an implementation detail. If you don't have at least a basic understanding of what the machine is doing, you will never be able to really understand the code you write.
Let's take someone who has learned Ruby outside of the classroom and is now attempting a relatively simple Ruby on Rails site. What disadvantages does he/she have not having studied assembly (as most com sci/engineers do at some point in their coursework)? Are these disadvantages major compared to, say, the disadvantages of not having learned HTML and attempting to be a RoR dev?

I would guess no. But I've learned both assembly and HTML so I can't tell for myself how much either has influenced me in ways that I'm not conscious of. Except that I actually use HTML knowledge when designing RoR views.

Ruby presents a VM; someone who understands the capabilities and limitations of that machine will be able to write Ruby code much more effectively than someone who does not, simply because they will understand what they are writing.

It would not shock me if most Rails devs were in fact Ruby tinkerers; and there's nothing wrong with that, if that's all you need to do.

Every time I've heard people discuss that level of concern over code speed or space considerations the topic turns to C extensions. I cannot recall ever hearing or reading about tuning ruby code for its VM. Or even C code. Perhaps that's because I've never had the need to be concerned about it, but if there exists any writings or conference video on this i'd be curious to take a look.
While that may be true for C but I found that it's not necessarily true for GWT -> JavaScript. Knowledge of the DOM API is more important than knowing JavaScript.
this is exactly what I was think while reading the post! at some point abstraction isn't just a something to geek out on, it is necessary.

maybe the problem is not know some assembly or at least some C when you write Objective-C or C++ you can write some really bad, inefficient code if you don't know the work the language underneath has to do. the same goes for the DOM and Javascript our assembly on the web.