News for hackers. Stuff that matters.
Re:The "C is Efficient" Language Fallacy by stcredzero on Monday May 04, 2009 @05:51PM (#593154)
"Premature optimization" is just another way of saying "use the right tool for the job." Look at Mercurial. It's not quite as fast as Git, but it's just fine for its purpose. Most of it is written in Python, with some speed critical parts written in C. This strikes me as using the right tool for the right job at the right time. Write most of the app in something like Python. This makes it easier to write concise, understandable code that reads like pseudocode in a short time. When you have the system running correctly and get it factored in a way you find nice, then rewrite the speed-critical parts of it in C.

Having a running model of your system to profile is one of the best tools you can have for optimization.

Re:The "C is Efficient" Language Fallacy by tptacek on Monday May 04, 2009 @06:01PM (#593172)
As true as that is, it's orthogonal to the actual debate at hand. There are plenty of good reasons to pick Python, or Java, or Scala, over C/C++. But this article claims performance is one of those reasons, and then crafts a particularly leaky argument to carry that claim.
Re:The "C is Efficient" Language Fallacy by stcredzero on Monday May 04, 2009 @06:22PM (#593204)
I read the article more like: "Writing a program in C is no guarantee of having a fast program. Here are a few examples." (Of both places where C is not the best for speed, and other languages giving good results.)

I think your idea of "the actual debate at hand" is too narrowly focused. As a reader of HN, I'm generally interested in how to get things done in a reasonably efficient manner. I find that "get it running, profile it, understand it, then optimize" is a good thing to think about when discussing performance. It cuts through a lot of delusions people have about their ability to write fast code. (Especially when they try to do it up-front.)

Re:The "C is Efficient" Language Fallacy by vegai on Tuesday May 05, 2009 @12:25AM (#593622)
And notably, Mercurial written in python is much faster than Subversion written in C.
Re:The "C is Efficient" Language Fallacy by tptacek on Tuesday May 05, 2009 @01:06AM (#593676)
Apples and oranges much?
Re:The "C is Efficient" Language Fallacy by vegai on Thursday May 07, 2009 @11:06AM (#598027)
Yes. Apples also can be compared to oranges by several different criteria.
Re:The "C is Efficient" Language Fallacy by vorador on Tuesday May 05, 2009 @01:53AM (#593714)
Remember that Mercurial is a dvcs.
Re:The "C is Efficient" Language Fallacy by stcredzero on Tuesday May 05, 2009 @08:23AM (#593968)
That's an example of how architecture trumps language.