News for hackers. Stuff that matters.
Re:Why I call myself a Javascript Programmer by zeteo on Monday October 25, 2010 @02:10PM (#1830857)
"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) 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.

Re:Why I call myself a Javascript Programmer by raganwald on Monday October 25, 2010 @02:41PM (#1830992)
Depends, ..

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?"

Re:Why I call myself a Javascript Programmer by zeteo on Monday October 25, 2010 @02:56PM (#1831074)
"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".

Re:Why I call myself a Javascript Programmer by raganwald on Monday October 25, 2010 @03:02PM (#1831098)
Well, 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.

Re:Why I call myself a Javascript Programmer by castis on Monday October 25, 2010 @03:24PM (#1831221)
I have become completely lost in this conversation and am now contemplating writing my next project in wood.
Re:Why I call myself a Javascript Programmer by raganwald on Monday October 25, 2010 @03:31PM (#1831239)
Re:Why I call myself a Javascript Programmer by mkramlich on Tuesday October 26, 2010 @12:21AM (#1832958)
You can almost do that in Minecraft. Some folks have built simple computers in the game using blocks of stone, water, torches and explosives.
Re:Why I call myself a Javascript Programmer by jpr on Monday October 25, 2010 @03:38PM (#1831266)
Re:Why I call myself a Javascript Programmer by gjm11 on Monday October 25, 2010 @02:58PM (#1831081)
> 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%2...

Re:Why I call myself a Javascript Programmer by zeteo on Monday October 25, 2010 @03:09PM (#1831132)
Ouch. 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.
Re:Why I call myself a Javascript Programmer by kenjackson on Monday October 25, 2010 @05:38PM (#1831722)
Being 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.
Re:Why I call myself a Javascript Programmer by dagheti on Monday October 25, 2010 @03:57PM (#1831352)
At least most of the time people stick to the Turing incomplete subset of the language.
Re:Why I call myself a Javascript Programmer by DougBTX on Monday October 25, 2010 @04:54PM (#1831551)
You can't talk about Turing equivalence without acknowledging the 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.
Re:Why I call myself a Javascript Programmer by zeteo on Monday October 25, 2010 @05:21PM (#1831652)
Why 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.)