Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualCornstalks

Posted 14 September 2012 - 07:48 AM

Two big reasons come to mind:

Standard Library Support
The C++ Standard Library lacks data structures, algorithms, and functionality that other "higher-level" languages like C# have for standard support. C++11 added a good amount of new functionality to C++'s Standard Library, but think about it: before C++11, there was no support for threads in C++'s Standard Library (whereas Java, Python, C#, etc. offer support for threads right out of the box). As another example, there is no networking/sockets support in C++'s Standard Library, but other languages again provide support for this right out of the box. The list of (commonly used/needed) features missing in C++ and its Standard Library is quite long. So developers have to spend a good amount of time in C++ either a) re-inventing the wheel, b) finding, downloading, compiling, and debugging 3rd party libraries, or c) picking a different language, where the list of lacking features is much smaller.

Bugs
The father of C++, Bjarne Stroustrup, has said "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off." Other languages, like C#, Java, Python, etc. try to protect you from yourself. But let's be honest. We all make mistakes (even if you don't want to admit it (*cough* Linus *cough*)). In C++ (and C), there are lots of places in the standard where it says "undefined behavior," "unspecified behavior," and "implementation defined behavior." It says these things a lot. There are lots of times you can do something totally wrong in C++, but you'll have no clue because it magically works (and you somehow think you wrote valid code). It works because the C++ standard doesn't say "doing x will not work and will result in the program crashing." It says "doing x is undefined," and who knows, it may work today and then crash your program tomorrow. But let that subtle bug of undefined behavior you introduced sit in your code base for a few months, and suddenly BOOM! Your program starts crashing. Now you've got to stop what your doing and dig through your code with your debugger. Other languages try to make it easier by a) making it so you can do less wrong, and b) telling you as soon as you do something wrong so you don't build an entire system on a broken foundation. Even if you don't introduce a bug in your C++ code, there's a good amount of mental book keeping and edge case handling that must be done to avoid these bugs, and this can also slow you down.

#3Cornstalks

Posted 13 September 2012 - 09:46 PM

Two big reasons come to mind:

Standard Library Support
The C++ Standard Library lacks data structures, algorithms, and functionality that other "higher-level" languages like C# have for standard support. C++11 added a good amount of new functionality to C++'s Standard Library, but think about it: before C++11, there was no support for threads in C++'s Standard Library (whereas Java, Python, C#, etc. offer support for threads right out of the box). As another example, there is no networking/sockets support in C++'s Standard Library, but other languages again provide support for this right out of the box. The list of (commonly used/needed) features missing in C++ and its Standard Library is quite long. So developers have to spend a good amount of time in C++ either a) re-inventing the wheel, b) finding, downloading, compiling, and debugging 3rd party libraries, or c) picking a different language, where the list of lacking features is much smaller.

Bugs
The father of C++, Bjarne Stroustrup, has said "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off." Other languages, like C#, Java, Python, etc. try to protect you from yourself. But let's be honest. We all make mistakes (even if you don't want to admit it (*cough* Linus *cough*)). In C++ (and C), there are lots of places in the standard where it says "undefined behavior," "unspecified behavior," and "implementation defined behavior." It says these things a lot. There are lots of times you can do something totally wrong in C++, but you'll have no clue because it magically works (and you somehow think you wrote valid code). It works because the C++ standard doesn't say "doing x will not work and will result in the program crashing." It says "doing x is undefined," and who knows, it may work today and then crash your program tomorrow. But let that subtle bug of undefined behavior you introduced sit in your code base for a few months, and suddenly BOOM! Your program starts crashing. Now you've got to stop what your doing and dig through your code with your debugger. Other languages try to make it easier by a) making it so you can do less wrong, and b) telling you as soon as you do something wrong so you don't build an entire system on a broken foundation.

#2Cornstalks

Posted 13 September 2012 - 09:44 PM

Two big reasons come to mind:

Standard Library Support
The C++ Standard Library lacks data structures, algorithms, and functionality that other "higher-level" languages like C# have for standard support. C++11 added a good amount of new functionality to C++'s Standard Library. Think about it: before C++11, there was no support for threads in C++'s Standard Library (whereas Java, Python, C#, etc. offer support for threads right out of the box). As another example, there is no networking/sockets support in C++'s Standard Library, but other languages again provide support for this right out of the box. So developers have to spend a good amount of time in C++ either a) re-inventing the wheel, b) finding, downloading, compiling, and debugging 3rd party libraries, or c) picking a different language.

Bugs
The father of C++, Bjarne Stroustrup, has said "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off." Other languages, like C#, Java, Python, etc. try to protect you from yourself. But let's be honest. We all make mistakes (even if you don't want to admit it (*cough* Linus *cough*)). In C++ (and C), there are lots of places in the standard where it says "undefined behavior," "unspecified behavior," and "implementation defined behavior." It says these things a lot. There are lots of times you can do something totally wrong in C++, but you'll have no clue because it magically works (and you somehow think you wrote valid code). It works because the C++ standard doesn't say "doing x will not work and will result in the program crashing." It says "doing x is undefined," and who knows, it may work today and then crash your program tomorrow. But let that subtle bug of undefined behavior you introduced sit in your code base for a few months, and suddenly BOOM! Your program starts crashing. Now you've got to stop what your doing and dig through your code with your debugger. Other languages try to make it easier by a) making it so you can do less wrong, and b) telling you as soon as you do something wrong so you don't build an entire system on a broken foundation.

#1Cornstalks

Posted 13 September 2012 - 08:55 PM

Two big reasons come to mind:

Standard Library Support
The C++ Standard Library lacks data structures, algorithms, and functionality that other "higher-level" languages like C# have for standard support. C++11 added a good amount of new functionality to C++'s Standard Library. Think about it: before C++11, there was no support for threads in C++'s Standard Library (whereas Java, Python, C#, etc. offer support for threads right out of the box). As another example, there is no networking/sockets support in C++'s Standard Library, but other languages again provide support for this right out of the box. So developers have to spend a good amount of time in C++ either a) re-inventing the wheel, b) finding, downloading, compiling, and debugging 3rd party libraries, or c) picking a different language.

Bugs
The father of C++, Bjarne Stroustrup, has said "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off." Other languages, like C#, Java, Python, etc. try to protect you from yourself. Let's be honest. We all make mistakes (even if you don't want to admit it (*cough* Linus *cough*)). In C++ (and C), there are lots of things in the standard (that defines the language) that says "undefined behavior," "unspecified behavior," and "implementation defined behavior." They say these things a lot. There are lots of times you can do something totally wrong in C++, but you'll have no clue because it magically works (and you somehow logically think you wrote valid code). But let the subtle bug you introduce sit in your code base for a few months, and suddenly BOOM! Your program starts crashing. So now you've got to stop what your doing and dig through your code with your debugger. Other languages try to make it easier by a) making it so you can do less wrong, and b) telling you as soon as you do something wrong so you don't build an entire system on a broken foundation.

PARTNERS