Because that way you'd not get the ownership transfer semantics of auto_ptr. And of course if you tried to use that pointer with auto_ptr, you'd be firmly into trouble.
Judging from the rest of your comment, I don't think you think that. C++ being "all but horrible" would mean C++ being almost horrible. What you obviously mean is C++ being not at all horrible.
The compatibility that you can freely exchange data structures with C code, as long as C knows about the data structure in question (which in good approximation means anything not containing classes or references).
If C++ arrays included sizes, you'd not be able to receive them from C code, and not to pass structures containing arrays to C code. If you're writing pure C++ code, you generally shouldn't use raw arrays anyway.
Worse still, the very situations where exceptions are the only way to signal an error also happen to be the situations where throwing an exception is dangerous: constructors and destructors.
There's nothing dangerous in throwing from constructors. Of course destructors are a different matter.
It is not hard to understand why "C++ is horrible" has become the go-to response to any comment about C++. It is a horrible language, and it is likely a culprit in the billions of dollars wasted on software bugs each year (buffer overflows, dangling pointers, etc.).
So you claim you'd get more buffer overflows and dangling pointer with C++ than with C? I strongly doubt that. Remember, this is about C++ being a horrible language compared to C.
In almost of the cases where you'd use multiple inheritance, the intersection of the interfaces of the two classes should either be zero, making any precedence questions moot, or obtained through diamonds with virtual inheritance and pure virtual functions in all base classes, so again there's no precedence question because the only class implementing the shared interface at all is the most derived one.
I'd say if you need to think about precedence, you've probably already done something wrong.
Of course the complete functionality of grep can be obtained with a awk or perl script. So unless you consider grep an useless legacy program, that's not much of an argument against the option.
wow, you'd think they would be pretty much done by now
Well, the post is actually a sed release message. Here's the start:
I am pleased to announce the release of GNU sed 4.2.2. The latest release has the following bug fixes and new features:
* don't misbehave (truncate input) for lines of length 2^31 and longer
* fix endless loop on incomplete multibyte sequences
(There are actually quite a few more points)
Line lengths of more than 2^31 are probably not that common (indeed, even about a decade ago that would have exceeded maximal file size), so it's no surprise that it only came up now (indeed, some vendors would probably just have documented it as limitation of their program instead of fixing it). Also, multibyte characters for sure weren't in the original specification of sed.
But if you build custom structures using macros on top of C (and if you look at the gcc source code, you'll find they did that a lot), you'll be no better off. Instead of learning advanced C++, you'll be learning advanced project-specific macro-based structures.
It also supports just about any programming paradigm, badly, making the choice between them especially hard.
So C++ is bad because it doesn't force you to use a specific paradigm? I'd say that's one of the strengths of C++. Yes, it means you have to think more. But I don't consider that a ad thing. Especially if the forced paradigm would lead to suboptimal code because your problem (or worse, just part of your problem) is more naturally described in a different paradigm. Or you'd be fighting the other language to make your code fit (like in Java building pseudo-classes only to hold "global" functions which cannot be global just because the language doesn't allow it).
Note that I don't claim that C++ doesn't have its problems (the most important one being its overly complicated syntax, which in large parts comes from being compatible with C, but in some parts also comes from bad decisions in C++-specific features). C++ is definitely not the best language possible. but its advantages over the existing languages (at least those I know) are large enough to make it still better than those despite its problems.
Especially in my view the languages which start with the expressed goal of improving on C++ (at least those I know) throw out the baby with the bathwater. Which is a shame because C++ could win a lot if properly redesigned without the compatibility baggage (both to C, and to earlier versions of C++).
Bohr's model of the atom had scientific consensus until it didn't.
OK, that makes the count: One.
And it is also questionable if you can call the Bohr model "wrong" when it can actually be recovered from the correct quantum mechanics by making a standard approximation. Yes, the underlying image is wrong, but quantum mechanics is a complete new paradigm (one of the few cases where this term really is appropriate). This is in no way comparable to global warming where all the fundamentals are perfectly known and the only question is how they act together.
To make a car analogy: With the Bohr model, the people who tried to explain traffic didn't even know about how cars move. On the other hand, global warming is more like predicting that there will be traffic jams in the rush hour.
Aristotle's view of the sun revolving around the earth had scientific consensus until it didn't.
At that time there did not exist science in the modern sense, and therefore there also could not be scientific consensus in the modern sense.
The impossibility of travel faster than sound had scientific consensus until it didn't.
That's also not comparable. The fact that an object can travel faster than the sound was well known (every gun does that, after all). What was considered impossible was to create an airplane which could go faster than the sound without being destroyed.
There's a big difference between the question "how will this given system behave" and "can we build a system which behaves a certain way". In the first case, the system we consider is given, and the only question is on how well we can describe it. In the second case, it's a problem where the system itself isn't given.
To make a car analogy again: It is the difference between "if I keep pressing the gas pedal of this car, will I eventually go faster than allowed?" versus "can I build a car which exceeds the speed limit"? The first one can be answered if you know enough about the car. The second can be answered "yes" by building such a car, but every "no" will be by nature be limited to "as far as we know" unless we can point to a fundamental law which would be violated (this is the difference between going faster than sound and going faster than light).
Global warming is by nature the first type: We ask "if we keep doing as we do now, will it get warmer on average?" On the other hand, Geoengineering to fight global warming would be of type 2: "can we fight global warming with some special technology?"
The issue is not life as a whole. The issue is our own survival. It doesn't serve us if life as a whole gets more diverse, but we are not among those diverse life forms.
You do realize that something as simple as soap flakes in your powdered laundry soap can be used to make explosives.
If you arrested everyone that had explosive chemicals in the house, then you would have to arrest everyone that cleans anything.
You can create an explosion with nothing more than flour. So add anyone baking his own bread or cake to the list. Oh, and what if your garage is integrated in your house? Your car contains a tank full of an explosive chemical.
In their almighty wisdom they thought I wasn't doing as great a job
If you didn't tell them up front that in the given time frame it would be impossible to do a system which wouldn't need to be fixed and patched later on, you weren't doing a good job. Of course if you did and they ignored that, it's clearly their fault alone.
The only times I've ever had X crash was due a faulty proprietary graphics driver (and honestly, there's no way an OS supplier can protect against that). My home PCs had no X crash for about a decade. My Laptop hasn't had an X crash ever.
You can also buy computers without Windows. Maybe not at the big stores, but there are options. Except for my very first self-bought computer, no computer I've ever bought came with Windows installed. And not a single one was self-assembled.
Motorola now sells smartphones without Android? As far as I know you cannot use Android without a Google account (well, I guess formally you can if you forego using any advanced features; but then, why buy a smartphone at all?)
Of course that "IIRC" was just a parenthetical remark (I even put it in parentheses) I just couldn't resist.
About Usenet: Maybe you remember in the old times before the web, what people who confused Usenet with Internet always were told? "Internet is the thing with computers. Usenet is the thing with people." Yes, there still exist news servers. But there are not too many people left. While there are still a few groups that work, in large parts Usenet has degraded into a distribution mechanism for binary files.
And yes, BitTorrent is a very decentralized protocol. But that's a special case because it is used (not only, but to a non-negligible part) for illegal file sharing where any non-shared part of the distribution system can be easily targeted, and the distributed nature is a defence against that.
I'm sure if there had been a similar fight against web-based message boards for some reasons, Usenet would still be a popular discussion system.
A whole spectrum of places to buy stuff, most of which AREN'T Amazon
Yes. Until you get to the payment part. Then you need to log into Amazon, Google, or PayPal, in about 90% of the cases.
That must be an American thing, then. Because I've never encountered a web page that requires Amazon (apart from Amazon itself, of course) or Google, and the only web site requiring PayPal I know is eBay (but then, eBay owns PayPal, therefore it's basically the same as with Amazon). Other than that, I've never encountered a seller which required more than a credit card (and your address, of course) for payment.
Because that way you'd not get the ownership transfer semantics of auto_ptr. And of course if you tried to use that pointer with auto_ptr, you'd be firmly into trouble.
Judging from the rest of your comment, I don't think you think that. C++ being "all but horrible" would mean C++ being almost horrible. What you obviously mean is C++ being not at all horrible.
The compatibility that you can freely exchange data structures with C code, as long as C knows about the data structure in question (which in good approximation means anything not containing classes or references).
If C++ arrays included sizes, you'd not be able to receive them from C code, and not to pass structures containing arrays to C code. If you're writing pure C++ code, you generally shouldn't use raw arrays anyway.
There's nothing dangerous in throwing from constructors. Of course destructors are a different matter.
So you claim you'd get more buffer overflows and dangling pointer with C++ than with C? I strongly doubt that. Remember, this is about C++ being a horrible language compared to C.
In almost of the cases where you'd use multiple inheritance, the intersection of the interfaces of the two classes should either be zero, making any precedence questions moot, or obtained through diamonds with virtual inheritance and pure virtual functions in all base classes, so again there's no precedence question because the only class implementing the shared interface at all is the most derived one.
I'd say if you need to think about precedence, you've probably already done something wrong.
Of course the complete functionality of grep can be obtained with a awk or perl script. So unless you consider grep an useless legacy program, that's not much of an argument against the option.
wow, you'd think they would be pretty much done by now
Well, the post is actually a sed release message. Here's the start:
I am pleased to announce the release of GNU sed 4.2.2. The latest
release has the following bug fixes and new features:
* don't misbehave (truncate input) for lines of length 2^31 and longer
* fix endless loop on incomplete multibyte sequences
(There are actually quite a few more points)
Line lengths of more than 2^31 are probably not that common (indeed, even about a decade ago that would have exceeded maximal file size), so it's no surprise that it only came up now (indeed, some vendors would probably just have documented it as limitation of their program instead of fixing it). Also, multibyte characters for sure weren't in the original specification of sed.
But if you build custom structures using macros on top of C (and if you look at the gcc source code, you'll find they did that a lot), you'll be no better off. Instead of learning advanced C++, you'll be learning advanced project-specific macro-based structures.
So C++ is bad because it doesn't force you to use a specific paradigm? I'd say that's one of the strengths of C++. Yes, it means you have to think more. But I don't consider that a ad thing. Especially if the forced paradigm would lead to suboptimal code because your problem (or worse, just part of your problem) is more naturally described in a different paradigm. Or you'd be fighting the other language to make your code fit (like in Java building pseudo-classes only to hold "global" functions which cannot be global just because the language doesn't allow it).
Note that I don't claim that C++ doesn't have its problems (the most important one being its overly complicated syntax, which in large parts comes from being compatible with C, but in some parts also comes from bad decisions in C++-specific features). C++ is definitely not the best language possible. but its advantages over the existing languages (at least those I know) are large enough to make it still better than those despite its problems.
Especially in my view the languages which start with the expressed goal of improving on C++ (at least those I know) throw out the baby with the bathwater. Which is a shame because C++ could win a lot if properly redesigned without the compatibility baggage (both to C, and to earlier versions of C++).
OK, that makes the count: One.
And it is also questionable if you can call the Bohr model "wrong" when it can actually be recovered from the correct quantum mechanics by making a standard approximation. Yes, the underlying image is wrong, but quantum mechanics is a complete new paradigm (one of the few cases where this term really is appropriate). This is in no way comparable to global warming where all the fundamentals are perfectly known and the only question is how they act together.
To make a car analogy: With the Bohr model, the people who tried to explain traffic didn't even know about how cars move. On the other hand, global warming is more like predicting that there will be traffic jams in the rush hour.
At that time there did not exist science in the modern sense, and therefore there also could not be scientific consensus in the modern sense.
That's also not comparable. The fact that an object can travel faster than the sound was well known (every gun does that, after all). What was considered impossible was to create an airplane which could go faster than the sound without being destroyed.
There's a big difference between the question "how will this given system behave" and "can we build a system which behaves a certain way". In the first case, the system we consider is given, and the only question is on how well we can describe it. In the second case, it's a problem where the system itself isn't given.
To make a car analogy again: It is the difference between "if I keep pressing the gas pedal of this car, will I eventually go faster than allowed?" versus "can I build a car which exceeds the speed limit"? The first one can be answered if you know enough about the car. The second can be answered "yes" by building such a car, but every "no" will be by nature be limited to "as far as we know" unless we can point to a fundamental law which would be violated (this is the difference between going faster than sound and going faster than light).
Global warming is by nature the first type: We ask "if we keep doing as we do now, will it get warmer on average?" On the other hand, Geoengineering to fight global warming would be of type 2: "can we fight global warming with some special technology?"
And where would he ssh to?
The issue is not life as a whole. The issue is our own survival. It doesn't serve us if life as a whole gets more diverse, but we are not among those diverse life forms.
I mean, come on, how many atomic models have we already been through since the mid-1800s?
And how many of those have been scientific consensus?
What does the Federal Communications Commission have to do with that?
This thing is literally the size of a brick (and likely the weight too).
But at least it won't be bricked if you tamper with it. :-)
He operates under the implicit assumption that generally if people are arrested, there are good reasons to do so.
You do realize that something as simple as soap flakes in your powdered laundry soap can be used to make explosives.
If you arrested everyone that had explosive chemicals in the house, then you would have to arrest everyone that cleans anything.
You can create an explosion with nothing more than flour. So add anyone baking his own bread or cake to the list.
Oh, and what if your garage is integrated in your house? Your car contains a tank full of an explosive chemical.
Are you sure? If he codes 8 hours a day, he probably has at least 10 hour of work per day after you add in meetings, code review and bureaucracy.
Of course the people who write comments on YouTube usually are not paid for it.
If you didn't tell them up front that in the given time frame it would be impossible to do a system which wouldn't need to be fixed and patched later on, you weren't doing a good job. Of course if you did and they ignored that, it's clearly their fault alone.
The only times I've ever had X crash was due a faulty proprietary graphics driver (and honestly, there's no way an OS supplier can protect against that). My home PCs had no X crash for about a decade. My Laptop hasn't had an X crash ever.
You can also buy computers without Windows. Maybe not at the big stores, but there are options. Except for my very first self-bought computer, no computer I've ever bought came with Windows installed. And not a single one was self-assembled.
Motorola now sells smartphones without Android? As far as I know you cannot use Android without a Google account (well, I guess formally you can if you forego using any advanced features; but then, why buy a smartphone at all?)
Of course that "IIRC" was just a parenthetical remark (I even put it in parentheses) I just couldn't resist.
About Usenet: Maybe you remember in the old times before the web, what people who confused Usenet with Internet always were told? "Internet is the thing with computers. Usenet is the thing with people." Yes, there still exist news servers. But there are not too many people left. While there are still a few groups that work, in large parts Usenet has degraded into a distribution mechanism for binary files.
And yes, BitTorrent is a very decentralized protocol. But that's a special case because it is used (not only, but to a non-negligible part) for illegal file sharing where any non-shared part of the distribution system can be easily targeted, and the distributed nature is a defence against that.
I'm sure if there had been a similar fight against web-based message boards for some reasons, Usenet would still be a popular discussion system.
A whole spectrum of places to buy stuff, most of which AREN'T Amazon
Yes. Until you get to the payment part. Then you need to log into Amazon, Google, or PayPal, in about 90% of the cases.
That must be an American thing, then. Because I've never encountered a web page that requires Amazon (apart from Amazon itself, of course) or Google, and the only web site requiring PayPal I know is eBay (but then, eBay owns PayPal, therefore it's basically the same as with Amazon). Other than that, I've never encountered a seller which required more than a credit card (and your address, of course) for payment.