4 ms·
Dial your time machine back a few decades, and you'll see assembly programmers telling those C upstarts that they should learn assembly for all the same reasons
by IsaacSchlueter 18y ago
Dial your time machine back a few decades, and you'll see assembly programmers telling those C upstarts that they should learn assembly for all the same reasons. A few more, and it's the logic circuit designers griping that you can't trust instruction cards because you can't see the program. A few more, and it's the vacuum tube enthusiasts complaining that digital switches are slower, less reliable, and too small to debug properly.
If you want a visceral relationship with your hardware, get a soldering iron and go to town. That's a respectable hobby, and confers mega geek-points. If you want to write software and be productive at it, learn a real language.
C is a powerful tool, and every programmer should know it. But it's woefully underpowered as a fulltime software development tool.
- ajross 18y agoAnd you know what? All those curmudgeons were right (except for the bit about vacuum tubes: transistor logic was never slower or less reliable than tubes, ever). If you don't know how your tools are put together, there will be areas of software development at all levels which will forever remain voodoo to you. You can do an awful lot of useful work while relying on voodoo, but eventually the voodoo will catch up with you and you'll end up with an ugly mess where a better trained developer would produce an elegant hack. That's no less true for a web developer using rails than it is for an embedded systems driver developer. Basically, I've never known a great hacker who doesn't understand CPU architectures and at least a little bit of digital logic design. As for C specifically, let's just agree to disagree. I'll put of the sum total of "great hacks" written in C up against any amount of C++ or Java you can find. It's true that for some problems (web development being a good example) there are better tools (scripting languages, databases) for the domain. But that alone doesn't make C "woefully underpowered".
- jimbokun 18y ago"It's true that for some problems (web development being a good example) there are better tools (scripting languages, databases)..." most likely implemented in C.
- IsaacSchlueter 18y agoIt's implemented in machine language somewhere. Programmers should know what a register is. It's implemented in electrons, too. And, some of the best programmers I've known were EE majors. Don't get me wrong, it's wise to know your craft. That's never a bad thing. But it's foolish to use a tool that is, frankly, not as powerful. Saying a tool is "powerful" doesn't mean "you can do lots of stuff with it." You CAN saw down a tree with a screwdriver. But a chainsaw is a much more powerful tool for that job. Yes, a screwdriver can do lots of things that a chainsaw can't, which only proves that it's a more versatile tool. The power of a tool depends on the context of the problem you're trying to solve. I'm guessing that screwdrivers are used in the assembly of chainsaws. They still suck for cutting down trees. Same with C vs just about every other language. C is a fairly small step up from assembly. An important step, no doubt, but for most tasks that software developers face, especially on the web, it's not appropriate.
- ajross 18y agoI'm going to go out on a limb and guess that you've never actually worked seriously in C. You probably had to maintain someone else's code at some point, got confused by the linker or debugger semantics, and decided you hated it. [disclosure: I peeked at your blog and resume, and it seems I'm broadly correct.] That's fine: work in C is grounded deeper than web development. You don't have the scaffolding around you to provide a fallback for changes. Sometimes you need to fix bugs from first principles, and that takes a lot more knowledge up front than web work does. But that's not the same as saying that someone who has that background is as unproductive in C as you are. Seriously: spend some time writing something serious in C, you might like it better. It will certainly seem more powerful than it does to you right now.
- IsaacSchlueter 18y agoYou're "broadly correct" in the sense that the Republican Party is "broadly libertarian." I spent 5 years writing almost 100% C and C++ in college, with detours into Lisp, Java, VB, and Ada. (Actually, I'd grown up on Basic, so VB wasn't a detour, really.) After school, I worked at a VB shop, but built a few side-projects in C++. I've had to fix things that were broken, and I don't have a problem with the linker or debugger semantics. I've used templates, and both has-a and is-a object extension. I am certainly not an world-class expert in it, but it's not like I tried it once, got burned, and decided I hated it. I'm a web developer because I like web development better. For a variety of reasons, not the least of them the challenge of building code that is so portable it will run on 12 different browser/os combinations, and the opportunity to work in many different languages, I find front-end development much more rewarding. My aversion to C is based on a simple rule of thumb: (usefulness of a feature) / (tokens required to implement it) Lines of code is a pretty good fill-in for "tokens", but I had to change the rule when someone pointed out that a 500 character regex in Perl is hardly an elegant or maintainable program :) Another way to express this is that the elegance of a solution is the number of tokens that are not essential to the solution and do not aid in understanding the intent of the code. For example, compare Javascript's closures with Lisp's or Erlang's syntax. On the other side, compare any of those with the mess of class and object boilerplate in C++ or Java or PHP. Conceptual cruft is even more pervasive. If encapsulation requires class/object constructs, then there is no way to get past that. Some programmers will be able to create more elegant solutions than others, of course. But without changing languages, you can't get past the cruft that is built into language. (Or, in the case of C, the cruft that was not removed from the language.) Again, "power" does not mean "you can do anything with it." C can be used to tell a computer to do anything that computer can do. But I'd argue that that's a naive view of the power of a programming language. There are things that are trivial to express in other languages, and require several lines to do in C. Just something as simple as comparing that two strings hold the same value requires about half as much conceptual overhead in almost any other language. Or is there a version C with lexical closures, first-order functions and strings, and a garbage collector that I'm not familiar with? I'm not sure what you mean by You don't have the scaffolding around you to provide a fallback for changes. The claim that C programming takes more knowledge up front than web work does is frankly presumptuous and a bit misguided. I've seen the Javascript that C experts write. It's terrible. In fact, I'd argue that since quality web work requires an understanding of semantic HTML, CSS, Javascript, maybe some Flash and/or Canvas chops, and probably at least one kind of server-side language like PHP or Java, it requires much more knowledge up front than almost anything else out there.
- jrockway 18y agoVery well said. This was the point I was trying to convey, but you did it better ;) Anyway, I think programmers think too much in black and white. There are people that say you never need to know how the computer works. Then the rest say that you always need to think about how the computer works. The reality is somewhere in the middle. There have been a few cases in my programming career where knowing how the hardware actually worked was helpful. But it was never critical, just good to know. (Another similar area is data structures. Yes, it's good to know how merge sort and quick sort and B+ trees work. That direct knowledge has helped me a number of times, either because I needed my own tree or because thinking about how merge sort worked helped me solve a related problem. But the other 99% of the time, I'm not thinking about sorting or the tree balancing algorithm. I just use libraries. So theoretically, it's possible to write good programs without knowing that stuff.)
- ajross 18y agoYeah, but think about what you're saying: the dichotomy you're drawing here between "essential" knowledge and "helpful" knowledge is precisely that between the skills of a merely adequate developer and a great hacker. Sure, an IT wonk can churn out working software. But they'll never aspire to build the world's next great startup. Have some standards, man. You can't be a true hacker if you're cutting corners like this. :)
- jrockway 18y agoI disagree. Building a startup is about having an idea and implementing it, not about B+ trees. If knowing obscure details of data structures made you rich, I would be rich :)