I had read that C is more popular than C++, but double checking, on freshmeat.net there are 5367 projects tagged C++, 9594 tagged C.
However, the point i was trying to make in my original post is that complexity doesnt come from language, it comes from design.
If you have a really good design for a project, it should be just as easy for a C programmer to implement that design in C, as it would be for a C++ programmer to implement it in C++.
Design can be really hard, for simple tasks a lot of programmers do it themselves without thinking about it, its only when projects get larger that it gets recognized as a separate problem.
Posted Jan 12, 2011 21:53 UTC (Wed) by HelloWorld (guest, #56129)
[Link]
However, the point i was trying to make in my original post is that complexity doesnt come from language, it comes from design.
If you have a really good design for a project, it should be just as easy for a C programmer to implement that design in C, as it would be for a C++ programmer to implement it in C++.
This is just nonsense. The whole point of a programming language is to give you the means to express things more easily. The converse of your argument is essentially that we shouldn't have bothered with programming languages in the first place, since, given the right design, we might as well implement it in assembly language.
An object-oriented design with heavy use of inheritance, virtual function calls etc. will be much cleaner, terser and simpler in C++ than in C.
Sobotka: Why GIMP is inadequate
Posted Jan 13, 2011 16:11 UTC (Thu) by mgedmin (subscriber, #34497)
[Link]
Why not go all the way and recommend something like Python then? *Much* cleaner, terser and simpler than C++.
(Of course there's a cost -- larger memory usage, slower running speed. Just like C++ has costs that C doesn't have -- gotchas in the language design, longer compilation times, increased memory usage, slower application startup due to eager linking overhead for vtables, etc.)
Sobotka: Why GIMP is inadequate
Posted Jan 13, 2011 17:27 UTC (Thu) by HelloWorld (guest, #56129)
[Link]
It's all about tradeoffs. Python is slow and uses more memory. I also dislike dynamic typing, and it's easier to use a C library in a C++ program than in Python. If these aren't problems for you - great, use Python.
If instead you're looking for a programming language that offers both flexibility and suitability for systems programming (perhaps even in the embedded world), then C++ is in my opinion a reasonable option.
Sobotka: Why GIMP is inadequate
Posted Jan 13, 2011 20:31 UTC (Thu) by daniel (subscriber, #3181)
[Link]
"The point i was trying to make in my original post is that complexity doesnt come from language, it comes from design."
If you are saying that design complexity cannot possibly be caused by the language then I strongly disagree. The absence of essential organizational constructs in C is a breeding ground for complexity. Look at Xlib for example, you have to match up discriminated unions properly by hand, which involves keeping track of struct names, typedefs and union field names, all spelled differently and sometimes inconsistently. The resulting code is unnecessarily hard to write, harder to read (at least if "understanding" is a required part of reading) and full of accidents waiting to happen. I do not see how that can fail to translate into design complexity. You just can't cover up those flaws with a design, the underlying mechanism insists on showing through.
Sobotka: Why GIMP is inadequate
Posted Jan 13, 2011 22:31 UTC (Thu) by bug1 (subscriber, #7097)
[Link]
"If you are saying that design complexity cannot possibly be caused by the language then I strongly disagree."
Design _should_ be separate from its implementation, they are separate stages.
But if you are designing as you go then its likely to all turn to shit a few times anyway, the efficiency loss of the language probably isnt significant compared to lost time due to re-writing whole sections of code.
Sobotka: Why GIMP is inadequate
Posted Jan 18, 2011 17:54 UTC (Tue) by daniel (subscriber, #3181)
[Link]
"Design _should_ be separate from its implementation, they are separate stages."
That is the waterfall method. I do not find it as effective or efficient as the iteration method.
Sobotka: Why GIMP is inadequate
Posted Jan 18, 2011 17:52 UTC (Tue) by daniel (subscriber, #3181)
[Link]
It is hard to get reliable data on language popularity. That said, a search for "int main" lang:c vs lang:c++ on code.google.com shows C and C++ nearly tied. I think it is safe to say that a few years ago C++ would not have been anywhere close. (Caveat: it is naive to assume that a lot of care and attention goes into ensuring accurate search stats in a search engine.)
As far as freshmeat goes, it would be nice to know the relative popularity of C vs C++ for active and new projects versus inactive and old projects.