Comment Re:The Compiler Knows... (Score 1) 102
I've already covered this.
As an aside, you should have already abstracted away the details of that type-specifier via at least a typedef. In other words, your argument is a straw man.
I've already covered this.
As an aside, you should have already abstracted away the details of that type-specifier via at least a typedef. In other words, your argument is a straw man.
See here.
returning anything other than an iterator from cbegin() is a gigantic misdesign
That's precisely the point, now isn't it...
You are begging the question; you are assuming the contract; you are programming by [implicit] convention—that which plagues dynamic typing.
That is to say, such informal programming tends to be practical in these cases, but don't confuse that practicality with correctness.
That's begging the question; that's assuming the contract; that's the "programming by [implicit] convention" that plagues dynamic typing.
That is to say, such informal programming tends to be practical in these cases, but don't confuse that practicality with correctness.
There's no "again" about it.
Which part of that is difficult to grasp?
auto... the compiler knows the type of MemVec.cbegin() so why should I need to repeat it?
You're not repeating it; rather, you're specifying it.
Specifying the type is establishing a contract for the following code. This can be very worthwhile.
Note how the scope of cit is now limited to its area of use.
Of course, you could have achieved the same by declaring the variable inside the for-loop; keep things looking simple via a local typedef outside the for-loop:
typedef std::vector::const_iterator CIT;
for (CIT cit = MemVec.cbegin(); cit != v.end(); ++cit) {
if (LookForPatterm(*cit))
return true;
}
return false;
Adam Smith called such an intelligence the "Invisible Hand".
From the article:
Misra came up with a formula
Bruce, there's a reason why the gun is called The Great Equalizer.
Indeed, in the grand scheme, you are suggesting that we take guns out of the hands of the individual, and put them solely in the hands of the State; that sounds like a transfer of power from the Weak to the Strong...
Carl Sagan, in Cosmos:
If the general picture, however, of a Big Bang followed by an expanding universe is correct, what happened before that? Was the universe devoid of all matter, and then the matter suddenly, somehow created? How did that happen?
In many cultures, the customary answer is that a "god" or "gods" created the universe out of nothing. But, if we wish to pursue this question courageously, we must of course ask the next question: Where did God come from?
If we decide that this is an unanswerable question, then why not save a step, and conclude that the origin of the universe is an unanswerable question? Or, if we say that God always existed, why not save a step and conclude that the universe always existed? There's no need for a creation—it was always here.
These are not easy questions; cosmology brings us face to face with the deepest mysteries, with the questions that were once treated only in religion and myth.
inanimate matter
What does ‘inanimate’ mean? The problem is that people are always making this bizarre differentiation between ‘animate’ and ‘inanimate’, when really there is just matter interacting with matter; some sets of interactions are more complex and organized (or, shall we say, repetitive and sustained) than other sets of interactions. Indeed, sometimes that complexity and organization is so great that we call it ‘life’ and even ‘intelligent life’, but it’s all one and the same:
Matter interacting with matter.
When you eat some metal such as calcium, that calcium may become incorporated in your bones. Is that calcium all of a sudden ‘animated’ and ‘living’? Is the water that you drink somehow ‘animated’ because it flows through your brain cells?
A child is a continuation of that complex interaction between matter that we call the parent.
Random processes
The variation may be random (whatever that really means). The selection is not random.
The whole process, evolution by variation and selection (yes, "abiogenesis" is as specious as the notion of "nonliving" matter), is decidedly not random.
I reject your notion that evolution is unrelated.
Both variation and selection are still at work, even on "inanimate" objects.
This concept was considered in Star Trek: Deep Space 9's "Hard Time", in which Miles O'Brien spends a few hours being subjected to the experiences of a couple decades or so in prison.
Just because you can does not mean it's supported.
Guess what? It's not supported.
FORTRAN is not a flower but a weed -- it is hardy, occasionally blooms, and grows in every computer. -- A.J. Perlis