4 ms·
"C is not like a hammer, C is like wood. [...] Knowing all about the subtle details of working with wood isn't especially portable to working with cables that c
by zeteo 16y ago
"C is not like a hammer, C is like wood. [...] Knowing all about the subtle details of working with wood isn't especially portable to working with cables that carry electricity or layers of carbon fibre or blocks of solid aluminum."
All metaphors leak, but this one seems leakier than its predecessor. Turing equivalence (http://en.wikipedia.org/wiki/Turing_completeness http://en.wikipedia.org/wiki/Turing_completeness) tells us that any program can be written in any computer language. (Except SQL. But let's not get into Turing-incomplete languages now.) Whereas electric cables can't be made from wood.
The "hammer" metaphor, on the other hand, would suggest that you can do all kinds of woodwork with just a hammer; it's just needlessly difficult. Which seems more accurate.
- raganwald 16y agoDepends, .. Mr. Babbage tells me we can make a computer out of wood. And our wooden computer can simulate what an electric cable does. And that's what Turing tells me. Not that we can write any program with a Turing complete language, but that we produce the same computational result, quite possibly by simulating the other programming environment, just as we might Greenspun Lisp into every other programming language. So when discussing media, no we can't make a bamboo bicycle that has exactly the same weight and strength as a carbon fibre bicycle. But then again, we can't write an assembler program with the same number of lines as the equivalent Haskell program, so those differences can be hand-waved away. The point is that we can make bicycles out of either material, and knowledge of the material is different from knowledge of a specific tool that works the material. I think your point is interesting, but I'm not convinced that my suggestion is leakier than comparing C to hammers. I stand by my suggestion that hammers are more like IDEs than programming languages, and that there is a very important distinction between IDE as a tool and programming language as a tool. I reject the latter. To borrow another Perlisism, "The debate rages on: Is this metaphor Bactrian or Dromedary?"
- zeteo 16y ago"our wooden computer can simulate what an electric cable does." Theoretically, yes, but I still think that using C for all your programming needs is closer to the degree of difficulty of "using only a hammer for all your woodwork" rather than the degree of difficulty of "replacing all your electric cables with miniature wooden computers".
- raganwald 16y agoWell, that's very true. But you know, if I meet someone who calls themselves a "C Programmer," I would be surprised if they were trying to build a client-side web application as a browser plug-in in C. C Programmers tend to ply their trade in places where their skills provide value, so "using C for all of their programming needs" might work out with very little difficulty, just as a carpenter would be unlikely to try to wire a house. Then again, there's nothing like expanding your horizons a little. While it's fun and surprisingly instructive (for me, at least) to think things like this through, I'm sure people will grant that debating how much the metaphor leaks says nothing about what you or I might think of C, or Javascript, or the benefits of learning a new programming language every year.
- deleted 16y ago[deleted]
- castis 16y agoI have become completely lost in this conversation and am now contemplating writing my next project in wood.
- raganwald 16y agotry Lego: http://aleptu.com/images/2009/04/lego_difference_engine.jpg http://aleptu.com/images/2009/04/lego_difference_engine.jpg
- jpr 16y agoHere's a wood compiler: http://bitbucket.org/cheery/z_woodc/overview http://bitbucket.org/cheery/z_woodc/overview
- mkramlich 16y agoYou can almost do that in Minecraft. Some folks have built simple computers in the game using blocks of stone, water, torches and explosives.
- gjm11 16y ago> Except SQL. Actually, SQL2008 is Turing-complete! See (if HN doesn't mangle the link): http://assets.en.oreilly.com/1/event/27/High%20Performance%20SQL%20with%20PostgreSQL%20Presentation.pdf http://assets.en.oreilly.com/1/event/27/High%20Performance%2...
- zeteo 16y agoOuch. That kind of sucks, actually. IIRC, Turing incompleteness had some nice side effects for SQL - such as guaranteeing program halt, and allowing perfect automatic optimization.
- dagheti 16y agoAt least most of the time people stick to the Turing incomplete subset of the language.
- kenjackson 16y agoBeing Turing Incomplete doesn't mean that programs are guaranteed to not halt. It just means that the Halting Problem may not be undecidable for that class of programs/machines. I'd be surprised if that was useful in the real world.
- DougBTX 16y agoYou can't talk about Turing equivalence without acknowledging the Turing tarpit (http://en.wikipedia.org/wiki/Turing_tarpit http://en.wikipedia.org/wiki/Turing_tarpit), which reminds us that in theory there is no difference between theory and practice, but in practice there is.
- zeteo 16y agoWhy not? I'm not advocating the use of Brainfcuk for all your programming needs, and Turing completeness has plenty of other uses in discussion. (It's particularly useful for converse statements - e.g., for most languages, there exists no compiler that determines whether your program will halt.)