|
|
| rant about the state of c++ software |
|
Darizel
Member #10,585
January 2009
|
Quote: Actually, OOP is a lot more fun using a language that has built-in constructs for getters/setters, interfaces, events, a mother-of-all-classes ("class Object"), a built-in string type that goes all the way, and all those other nice things that make your life easier. I'm sure you can find code that contains similar features and alter it slightly to your purpose. If you want a mother class, write one and use it in every program. class Object { }; class Whatever : public Object { // Put your stuff here. };
---------- |
|
Steve++
Member #1,816
January 2002
|
Obviously that is useless if Object doesn't actually contain anything useful. |
|
anonymous
Member #8025
November 2006
|
Quote: Libraries are a mess because C++ (other than C) lends itself to multiple programming paradigms, and the same problem can be tackled using different programming techniques (e.g., use exceptions or return values? OOP or procedural? How do other C++-like languages prevent using multiple paradigms? In Python I can write perfectly procedural code or OOP code, I can use exceptions or I can use return values. I can do things in many-many ways (e.g list comprehension or manual loops). Wouldn't it be perfectly possible to write purely procedural code even if you are forced to only use classes and methods? |
|
axilmar
Member #1,204
April 2001
|
The problem is that c++ allows for multiple incompatible "worlds" to exist: 1) the MFC world. All these are incompatible with each other. Different ABIs, different built systems, different implementation details, different memory management techniques, different threading, etc. You can only choose one of them and be happy. |
|
Steve++
Member #1,816
January 2002
|
Except for memory management, that's not a very strong argument against C++. Java has different build systems (although many times better than make) such Ant and Maven. There's also an explosion of mutually incompatible web frameworks around Java. The real advantages of Java over C++ to developers are garbage collection, the huge standard library and the builtin standards that allow easy linking of classes at runtime. |
|
axilmar
Member #1,204
April 2001
|
Quote: Except for memory management, that's not a very strong argument against C++. I disagree. You can't use one of these "worlds" with any other "world". In many cases, simply including files from two or more "worlds" does not even allow the program to compile (let alone function properly). And then designing something that mixes features from these worlds requires extreme hacking techniques. For example, Boost signals are incompatible with Qt signals. MFC and wxWidgets don't even have signals. Or each library contains its own string class. |
|
Kibiz0r
Member #6,203
September 2005
|
C++ is a great language, that's why it's in such a predicament. It happened to be a reigning champ during the computer boom, so tons of companies put all their weight behind it, pushing it far beyond what it was meant to be. It's only natural that, with such a popular language, mutually exclusive dialects spring up. But now, almost two decades later, it's bursting at the seams because we've refused to move on. We insist on patching up the holes with C++0x, allowing everyone to invest even more in something that's increasingly less important. {"name":"jobgraph.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/f\/9f660dd16bf392139835691f2a06925e.png","w":540,"h":300,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/f\/9f660dd16bf392139835691f2a06925e"} (Note that it's percentage growth, so C++ is continually losing job positions.) I hardly think C++ is going to "die out" any time soon, but I do think that it's outlived its purpose. It's also entirely possible that I'm talking out of my ass. --- |
|
SiegeLord
Member #7,827
October 2006
|
Quote: I do think that it's outlived its purpose So doing computational simulations is no longer needed? You might think that's not important, but that is the cornerstone of my future research career. I want a language that works well with that, and the patches coming in C++0x are very much welcome to people like me. Perhaps business world does not need C++ anymore, but business world != entire world. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|
Kibiz0r
Member #6,203
September 2005
|
Quote: So doing computational simulations is no longer needed? See, that's what they call a false dichotomy. I did say it wasn't going to die out any time soon. My point was just that... Quote: [The] business world does not need C++ anymore And, like it or not, the business world fuels the evolution and adoption of programming languages, the same way with Java and C# as with C++. Is it strange to think that people 10 years from now may talk about C# the same way we're talking about C++? --- |
|
BAF
Member #2,981
December 2002
|
The difference being C# is still changing a lot, and can continue to change. C# is controlled mainly by Microsoft, so they don't have to deal with standards committees and a bunch of whiny nerds when they want to change or add something. |
|
Darizel
Member #10,585
January 2009
|
As far as I know, C++ has a lot more libraries/support/etc. than C#. But I don't really know anything about C#. ---------- |
|
SiegeLord
Member #7,827
October 2006
|
Quote: See, that's what they call a false dichotomy. I did say it wasn't going to die out any time soon. My point was just that... C++ has not outlived it's purpose. You said that, I corrected you. No false dichotomies introduced. Quote: And, like it or not, the business world fuels the evolution and adoption of programming languages, the same way with Java and C# as with C++. I'd like to see some proof of that. Academia has been creating quite a few innovative languages these days, irrespective of their business applicability. FORTRAN is still going strong in the academia too, being revised and updated constantly. I doubt it even registers in your little percentage growth chart. I think that the business world fuels the evolution and adoption of programming languages in the business world only. Business world != entire world. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|
BAF
Member #2,981
December 2002
|
Support doesn't matter much to me, I can find all the resources I need in dealing with C#. As far as libraries go, I haven't had much problem finding whatever I need with C# either. In fact, most of the stuff you'd have to do yourself or find a third party library for with C++ is built in to C#'s standard library (.NET). |
|
axilmar
Member #1,204
April 2001
|
When it comes to business applications, C++ is not relative any more. But there is a lot more than business applications out there. For example, one of our next projects at work (if we are offered the contract) includes the modernization and enhancement of software that operates the torpedo systems on a certain class of French Frigates (details can not be disclosed of course). The software is huge. We are talking about 5 million lines of C++ code and 3 million lines of Java code. Java is used for the GUI. Java apps are stored in a cluster of servers, accessible from any console on the ship. All the consoles are programmable. C++ is used for the torpedo systems. The torpedo launcher kernel is written in Ada (a few hundred thousand lines of code), but the rest of the system is written in C++. One thing that C++ has, and it is a tremendous advantage when compared to other languages, is performance. All the power of C++ comes from two things: 1) templates. A list of integers works in C++ many times faster than a list of integers in Java, simply because Java has generics, not templates. In Java, a list of integers is actually a list of Integer objects. 2) static allocation. Much of the data in a C++ program live on the stack. Especially small classes used as keys to maps, iterators, etc. Big win for C++ in this domain. These things matter very much, especially when there are run-time constraints. So, overall, C++ is still relevant. It may not be obvious, because C++ is not used in business applications, but it is here and it is not going to go away anytime soon. |
|
Tobias Dammers
Member #2,604
August 2002
|
C++ is, IMO, slowly moving from being the #1 mainstream language into a niche: applications where detailed control over memory allocation is needed, runtime performance is crucial, or the target platform is severely limited hardware-wise. --- |
|
axilmar
Member #1,204
April 2001
|
C++ is also used in all the major applications: http://www.lextrait.com/vincent/implementations.html So I don't think C++ is moving into a niche any time soon. |
|
count
Member #5,401
January 2005
|
Not c++ but c. Maybe interesting non the less. Quote: C dominated 2008's open-source project nursery C overwhelmingly proved the most popular programming language for thousands of new open-source projects in 2008, according to license tracker Black Duck Software. The company, which monitors 180,000 projects on nearly 4,000 sites, said almost half - 47 per cent - of new projects last year used C. Black Duck said 17,000 new open-source projects were created in total. Next in popularity after C came Java, with 28 per cent.
|
|
Tobias Dammers
Member #2,604
August 2002
|
Open Source, yes. I can see why: An open source project needs as many contributors as it can get, and C is somewhat the lowest common denominator for most programmers. I still think that C++ is slowly moving from its pole position as the most popular general-purpose programming language towards a more specialistic role - when runtime performance is more important than developer efficiency; when legacy C++ code needs to be supported; when coding at a very low level is necessary; when JIT compilation cannot be afforded; things like that. The process is obviously slowed down a lot because: --- |
|
axilmar
Member #1,204
April 2001
|
Quote:
I still think that C++ is slowly moving from its pole position as the most popular general-purpose programming language towards a more specialistic role - when runtime performance is more important than developer efficiency; when legacy C++ code needs to be supported; when coding at a very low level is necessary; when JIT compilation cannot be afforded; things like that. The process is obviously slowed down a lot because: And another reason: - C++ is faster than the other languages. |
|
BAF
Member #2,981
December 2002
|
Speed doesn't matter in most cases. Only in special cases would the slight speed hit to a different language matter. |
|
axilmar
Member #1,204
April 2001
|
Quote: Speed doesn't matter in most cases. Only in special cases would the slight speed hit to a different language matter. I disagree. All the big packages mentioned in the page I posted above would be slower from Java and C# (databases, office, browsers etc). There is still no big app in these languages. GC'd languages require 2.5 times the memory of languages where memory is managed manually. |
|
Matthew Leverton
Supreme Loser
January 1999
|
Speed doesn't matter in most cases. You are mentioning huge applications. How many good office programs, databases, and browsers are there? Not many. The vast majority of business applications do not require the marginal speed benefits of C++. And even of the three you mentioned, only databases would truly benefit from that. C# is more than sufficient for a word processor or web browser. Ease of development trumps using fewer CPU cycles. |
|
axilmar
Member #1,204
April 2001
|
Quote: Speed doesn't matter in most cases. You are mentioning huge applications. How many good office programs, databases, and browsers are there? Not many. The vast majority of business applications do not require the marginal speed benefits of C++. And even of the three you mentioned, only databases would truly benefit from that. C# is more than sufficient for a word processor or web browser. Ease of development trumps using fewer CPU cycles. I agree with all your points, except one: that only databases would truly benefit from that. At work we have some freakin' huge documents (800+ pages), which are handled very slowly by Word 2007. If Word was implemented in Java, it would be truly painful. Perhaps the situation would be better with C#. |
|
BAF
Member #2,981
December 2002
|
The language itself doesn't make the handling of such huge pagecounts slow, but rather their algorithm. |
|
axilmar
Member #1,204
April 2001
|
Assuming that the algorithm is optimal, it's the fault of the language. Practically, Java would choke on such large files, setting fire to the hard disk due to extreme swapping. |
|
|
|