Posted Jun 30, 2012 8:15 UTC (Sat) by HelloWorld (guest, #56129)
[Link]
That can't possibly be true. Everything that can be done in C can be done in C++, and more.
What is Science?
Posted Jun 30, 2012 8:27 UTC (Sat) by Cyberax (✭ supporter ✭, #52523)
[Link]
I'm speaking about rewrites in "C++ style", not simple "recompile with g++" rewrites.
They do tend to shrink amount of lines of code quite significantly.
What is Science?
Posted Jun 30, 2012 8:39 UTC (Sat) by HelloWorld (guest, #56129)
[Link]
You're contradicting yourself. Wol said "if it takes 10 lines of C++ or 100 lines of C", you said "it's the other way around..", and now you're saying that rewrites in C++ style tend to shrink the amount of code.
What is Science?
Posted Jun 30, 2012 22:00 UTC (Sat) by Cyberax (✭ supporter ✭, #52523)
[Link]
Yes, rewrites in modern C++ tend to shrink code significantly compared to plain C. There's no contradiction.
What is Science?
Posted Jul 1, 2012 10:17 UTC (Sun) by HelloWorld (guest, #56129)
[Link]
Uh, yes there is, unless my english parser is utterly broken, but I don't think so.
What is Science?
Posted Jun 30, 2012 8:28 UTC (Sat) by khim (subscriber, #9252)
[Link]
This depends on your design very much. If you've dreamed up nice buzzword-compliant architecture of your project with classes, delegates and other such things then usually C++ code is smaller. If you instead will think about the task on hand and remove all the useless abstractions then often the end result will be less buzzword-compliant yet much smaller.
Of course you can write similar code in C++, but it'll not be "ideomatic C++".
What is Science?
Posted Jun 30, 2012 8:44 UTC (Sat) by Cyberax (✭ supporter ✭, #52523)
[Link]
Uhm. Why classes are 'buzzword'? They are, like, 30 years old buzzword.
In fact, even in languages like Java/C# architects now try to separate data from functionality (Fowler calls that 'anemic domain model').
And I don't understand that bit about 'useless abstractions'. For example, this kind of code: