|
|
Log in / Subscribe / Register

My advice on implementing stuff in C:

My advice on implementing stuff in C:

Posted Oct 15, 2010 23:34 UTC (Fri) by dlang (guest, #313)
In reply to: My advice on implementing stuff in C: by chad.netzer
Parent article: Russell: On C Library Implementation

what language 'learned the lessons of C++' and is so clearly superior?

the fact that C++ is still being used so heavily (in spite of people saying for 25 years that it is junked and should be skipped and people instead use a 'real' language ;-) makes me believe that all of these next-generation languages are missing something.

companies keep trying to ignore C++, but they aren't succeeding so spectacularly that C++ is dieing away.


to post comments

My advice on implementing stuff in C:

Posted Oct 16, 2010 1:25 UTC (Sat) by dskoll (subscriber, #1630) [Link] (6 responses)

what language 'learned the lessons of C++' and is so clearly superior?

C++ is "good enough" for many purposes, and it's certainly possible to write decent C++. The problem is that you have to restrict yourself to a subset of the language and have a very disciplined programming team with strict style guidelines.

Once you start going mad with esoteric C++ features (or even not-so-esoteric ones like templates), you code can become unreadable and unmaintainable.

Too bad Objective-C didn't catch on more than C++. I think it is a much better language if your goal is "C with objects".

My advice on implementing stuff in C:

Posted Oct 16, 2010 10:59 UTC (Sat) by marcH (subscriber, #57642) [Link]

> C++ is "good enough" for many purposes, and it's certainly possible to write decent C++. The problem is that you have to restrict yourself to a subset of the language and have a very disciplined programming team with strict style guidelines.

and the result of such discipline is called... Java.

OK, maybe too much discipline :-)

My advice on implementing stuff in C:

Posted Oct 16, 2010 13:15 UTC (Sat) by HelloWorld (guest, #56129) [Link] (3 responses)

If your code is unmaintainable, it's usually not because of language features, but because you have misused a language feature or you have chosen the wrong one for the problem.

My advice on implementing stuff in C:

Posted Oct 16, 2010 14:31 UTC (Sat) by Baylink (guest, #755) [Link]

And I believe that the assertion being made here by the anti-C++ faction is that *the fundamental design of the language and it's library/template environment is such* that this is much much harder than seems warranted, given the competition.

My advice on implementing stuff in C:

Posted Oct 16, 2010 19:50 UTC (Sat) by dskoll (subscriber, #1630) [Link] (1 responses)

If your code is unmaintainable, it's usually not because of language features, but because you have misused a language feature or you have chosen the wrong one for the problem.

What I assert is that there are many dangerous features in C++ that are easy to misuse. This is what I mean when I write that C++ is a horrible language; there are much better-designed languages that take a lot more effort to misuse. :) (C, Tcl, Lisp spring to mind immediately...)

My advice on implementing stuff in C:

Posted Oct 19, 2010 10:23 UTC (Tue) by nix (subscriber, #2304) [Link]

Tcl and Lisp are so flexible that they can be very easy to misuse in the wrong hands. This is mostly because of the very feature that gives them expressivity: the macro system (for Lisp) or ability to redefine every word in the language (for Tcl and for that matter Forth).

Subsets of C++

Posted Oct 17, 2010 4:53 UTC (Sun) by CChittleborough (subscriber, #60775) [Link]

dskoll is right: if you select an appropriate subset of C++, you can use it to write perfectly good code, even very large systems. Several teams have done this.

The problem is that the other teams using C++ are very unlikely to be using the same subset. Worse still, the team that wrote a library that your team would like to use probably selected a different subset than your team ...

My advice on implementing stuff in C:

Posted Oct 16, 2010 3:24 UTC (Sat) by chad.netzer (subscriber, #4257) [Link]

Note that the context is convincing diehard "C hackers", not necessarily C++ programmers, to migrate. Although, for the latter case, certainly Java is an example of a language directly intended to replace many of C++'s use cases, and both it and C# have been quite successful overall. C++ obviously has a long road ahead of it, and some exciting changes are on the horizon.

That said, of the languages meant to be "a better C++ for C hackers", several have been mentioned, and I don't claim any of will ever be "superior", in the sense of mindshare, marketshare, etc. Just that convincing those C hackers who have repeatedly objected to C++ (pardon the pun), is perhaps a fruitless battle. Personally, I'd kind of like "ooc" to become popularĀ…

As for the "lessons learned", its no surprise that many of the newer languages deliberately make an effort to ease the burden of implemention, speed of compilation, etc. Waiting for non-buggy implementations of C++'s newer features over the years left quite an impression on peopleĀ…


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds