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

You're missing the point: in many cases, choice of C is not ideological but practical. I love Modula-3 and OCaml (and ML's incorporation of Modula's module system in general); yet I'm using C++ for the project I am working on. From even the purely technical point of view, despite all the features OCaml has that I enjoy, building this system wouldn't be feasible -- I need shared memory concurrency and multi-core support, for example.

On the other hand, memory leaks occur just well in memory-safe languages (looking at Modula-3, I see a WeakPtr type -- which is there for this very reason). Finally there are also many reasons to want to have manual control over memory -- which when using high-level languages, ends up looking very much like C programming (e.g., Unsafe module in Java). However, you're essentially on your own when doing this.

By the way, memory debuggers are just one example -- plain debuggers are another, tools for tracing the code execution, performance tuning, etc... are another. As are mature and universally available libraries.

I don't mean to disparage high-level languages: I greatly enjoy programming in them and would like them to expand. Yet we're talking about existing code -- and in this case, C's maturity and universality (as a "lingua franca" of programming) are unrivaled. Nothing stops one from using -- and enjoying -- both advanced high level languages and C.



I don't equate C++ with C.

At least with C++ the language offers the mechanisms without external tooling, for doing safe coding, if one so wishes.

You can use arrays that don't decay into pointers, bounded checked arrays, proper strings, references for output parameters, automatic reference counting.




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

Search: