14,908 karma · joined May 29, 2012
That would seem to be making illegal states unreachable rather than unrepresentable, closer in spirit to "parse, don't verify".
I think you're confusing "make illegal states unrepresentable" with "parse, don't verify"? If your type cannot represent any invalid states, there's no way you can reach them through mutation.
Personally, I don't think the ambiguity is actually much of a problem; often it's not ambiguous, and when it is it's usually the case that multiple ways of organizing things are reasonably appropriate and other concerns should dominate (they may need to anyway).
The "misunderstanding" is at least as prevalent as the original, yes. I wasn't trying to say the original is "correct" - language is determined by usage - just wondering which you were discussing.
> To avoid the confusion, it seems like DRY would be better named something like "Single source of truth".
It could probably do with a better name, but "single source of truth" is usually about the information operated on by the program, rather than information embodied in the program.
I've tried to counter-meme with the joke that collapsing superficially similar code isn't improving it, but compressing it, and that we should refer to such activity as "Huffman coding".
It's also worth noting that the focus on syntax can also miss cases where DRY would recommend a change; if you are saying "there is a button here" in HTML and also in CSS and also in JS, your code isn't DRY even if those three look nothing alike (though whether the steps necessary to collapse those will very much depend on context).
When you say "DRY" here, would you say you had familiarity with the original definition, or merely what you (quite understandably) inferred from the acronym? Because I think the formulation in The Pragmatic Programmer is pretty spot on in speaking about not repeating "pieces of information", whereas I find in practice most people are reacting to superficial similarity (which may or may not reflect a deeper connection).
It can, but -G or -R can fix that.
> If you think betters do not have the odds right, you should start betting right now.
Sure, depending on my risk tolerance and existing exposure.
Not if we do the right thing and switch to labeling our large numbers using the "long" system. Then they'll merely be back to being "billionaires" (instead of milliardaires) despite having the net worth you were discussing.
But from a financial perspective, most of the cost for the machines is probably in buying the machines, where most of the cost of the worker is probably hourly wage (or similar). Turning off the machines probably saves less money than sending the people home.
The odds of those around you noticing is something you have some power over, if you're thinking about it ahead of time.
The idea is that checking should be the only way of making a value of the type. That prevents you from forgetting to check when you turn some broader type (say, string) into the more narrow one (date, in this case).
Clearly someone's not being serious.
I agree.
> It is inexcusable.
I think it can be quite easily excused on grounds of triviality, though whether that's appropriate may depend on context.
My understanding is that in iterated prisoner's dilemma, "tit for two tats" will often outperform "tit for tat", so in its original setting that's not really the case.
Here in reality, of course, "tit for two tats" can be better exploited if it can be (easily enough) identified and there are more potential ways of doing that.
using namespace std; // using namespace standardYeah, I think I agree. I was just responding to (what I saw as) sentiment that it was entirely unrelated to performance, which seems to overstate the case.
> Could you image how idiotic you’d sound beginning by asking is it a real car?
Tbh, "willing to sound like an idiot to double check assumptions" is probably something worth selecting for! I don't think that saves this question, though.