Hacker News new | ask | show | jobs
by ct4ul4u 5838 days ago
> But C is so hard to get right, that you will probably be able to use only the simplest algorithms in your C code

This is a gross exaggeration. It's not that hard to get C code right (C++ is a different story). I am unaware of any effort undertaken by skilled C programmers that failed because of limits C placed on algorithmic complexity. I am not arguing with your preference for higher level languages, just your statement that C is so difficult that it limits algorithmic expression.

C is substantially less compact and requires you to write code for things you get for free from other languages. Longer code takes more time to write and more time to read. Each feature or function point will, on average, take significantly longer to develop. On the other hand, a developer trying to write an OS in Python would also have some productivity challenges in other dimensions.

I am aware of the paradigmatic challenge C presents for many developers trained in the last 15 years. Trying to write in an OO style in C is neither fun nor advisable. Fortunately, most non-ui development is equally agreeable to other styles (although the developer may not be).

I'm not a C bigot and I like or love a number of high level languages (Python, Lisp, Haskell). I just don't think people should be afraid of C. Its closer-to-the-metal nature is an opportunity as well as a cost.

I'll close with a pointer to a great site written in C: http://www.halfbakery.com.

1 comments

I agree. And I should have chosen different words. What you say is pretty much what I wanted to express.

The original comment said, that with Python you run into scalability problems earlier than with C.

And I wanted to add, that with C you run into (solvable but hard) `scalability' problems in terms of effort needed to cope with algorithmic complexity, much sooner. And more clever algorithms are often the key to solving scalability problems.

(P.S. I do not like OOP, either. State is ugly.)

> And I wanted to add, that with C you run into (solvable but hard) `scalability' problems in terms of effort needed to cope with algorithmic complexity, much sooner.

I have certainly seen this effect. In retrospect, I wonder if this could be somewhat mitigated by real refactoring for C?

Perhaps. What also seems to work nice -- at least for me: Prototype in, say, Python, and then translate to C (either the hotspots or everything, in case you need to have a solution in pure C only).