Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Tools only created to solve the lack of safe constructs in C.

C made lots of sense in the context it was developed, but the world would be better if we had safer systems programming languages.

Valgrind, purify and friends are required to C, the same way Java requires IDEs, to improve language usability.

Have said this, the new trend in having static analysis tools integrated in the development process, like Clang, Eclipse CODA, Visual Studio's tools or HP Code Advisor, among others, can bring a bit more safety into C.



C is popular, good enough, portable, and fast. Skilled C programmers do not need profilers, bounds checkers and memory leak detectors. They help some people, though, no doubt. When size and speed matters, as in Operating Systems, C has won and continues to win the survival of the fittest competition. Almost all the programs I use are C (and/or C++): bash, linux, perl, firefox, awk, sed, grep, apache, mysql, etc. I assume good chunks of Java are written in C, but I'm not sure.

We have "safer" languages but our systems and tools remain in C. Given the intense competition in software, there must be solid reasons C remains the foundation of computing.


I'm with you on the advantages of C, but this is not true:

"Skilled C programmers do not need profilers, bounds checkers and memory leak detectors."

Skilled programmers use profilers because the alternative (guessing) is a poor strategy for diagnosing poor performance. And no skilled programmer would spurn a useful tool like a bounds checker or memory leak detector, because nobody is perfect and these tools save immense amounts of time by pointing you straight to the problem.


Not need profilers? I haven't run into a C (or any other language) programmer so skilled that he's even usually correct at finding the bottleneck without a profiler.

Programmers who don't use profilers write slow programs (even though they spend many hours "optimizing" them).


By that metric, here's a list of non-skilled programmers:

- Donald Knuth (wrote a study on profilers)

- Rob Pike (wrote a profiler, 'though for FORTRAN)

- Brian Kernighan (used a profiler to double the speed of his AWK interpreter)

I wonder who you consider a skilled C programmer, if not K from K&R.


> ... Skilled C programmers ...

Sadly you don't find many of them in the enterprise world, specially when dealing with off-shoring companies. :(

> ... Given the intense competition in software, there must be solid reasons C remains the foundation of computing.

Because it is dumb to code everything new, just because another language is cooler, nicer, safer, etc. So existing software keeps being coded in C.

Even if I expressed my opinion the way I did, I will surely pick C if it makes sense for the project at hand.


In the case of C safer also means weaker and less useful, it is a language where you need to be able to do everything. In some way C is "Assembler-complete". With valgrind you have no compromises, because you have a specialized runtime giving you control over what happens only at debugging time.


There is lots of great discussion going on in this thread. I particularly enjoyed the article, which took a "deliberately novice" approach, and was very Zen-like.

Why attack C at all? Why not instead convince us of the merits of another language?

There are great tools around. I agree with that. Which parts of Clang do you like best?


The static analyser, friendlier error messages and the plugin architecture that allows it to integrate easily in IDEs.

The re-factoring support and modules extensions are also a welcome additions.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: