HNHacker News
TopNewBestAskShowJobs

dllthomas

14,908 karma · joined May 29, 2012

[ my public key: https://keybase.io/dllthomas; my proof: https://keybase.io/dllthomas/sigs/hFRmQI8xdRlL3QWWR9FqNJJXPOptbXWy2d2SDlhJdCE ]
submissionscomments
dllthomas··on Setelinleikkaus: When Finns snipped their cash in half to curb inflation
Unless I miss something, it's very much not a standard measure of inflation. That said, leaning on that "at all": If wages are stickier than expenses, then the gap between wages and expenses will represent recent inflation to some degree.
dllthomas··on Functional Programming Self-Affirmations
`?` and `let ... else` both partially address this, yeah.
dllthomas··on Functional Programming Self-Affirmations
> By either marking your data as const, or encapsulating mutations with private fields and public methods

That would seem to be making illegal states unreachable rather than unrepresentable, closer in spirit to "parse, don't verify".

dllthomas··on Functional Programming Self-Affirmations
> How can you "Make illegal states unrepresentable" with mutable state and sequences of mutations that cannot be enforced with the type system?

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.

dllthomas··on The meme-ification of the "Demon Core"
Plutonium is heavy metal.
dllthomas··on The Rise of Malört, an Unexpected Midwest princess
It's never Luips.
dllthomas··on Good Software Development Habits
Uncertainty as to the line between "one piece of information" and "two pieces of information" may be a problem. I don't think it makes sense to say it's "the problem" when most people don't know that DRY is formulated in those terms in the first place.

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).

dllthomas··on Good Software Development Habits
> I have to assume there's industry wide misunderstanding on this term?

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.

dllthomas··on Good Software Development Habits
I think a part of the problem is that in addition to being a well regarded principle with a good pedigree, "DRY" is both catchy and (unlike SOLID or similar) seems self explanatory. The natural interpretation, however, doesn't really match what was written in The Pragmatic Programmer, where it doesn't speak of duplicate code but rather duplicate "pieces of information". If "you are okay with functions drifting apart or the cases they handle are allowed to differ" then the two functions really don't represent the same piece of information, and collapsing them may be better or worse but it is no more DRY by that definition.

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).

dllthomas··on Good Software Development Habits
> I started out really DRY

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).

dllthomas··on What I wish someone told me about Postgres
> piping colored output through 'less' can result in some messy control-character rendering rather than having the desired effect.

It can, but -G or -R can fix that.

dllthomas··on Welcome to the Antarctic Fire Department
Not to mention the bigoted penguins.
dllthomas··on Bitcoin rises 3% after topping $73,000 since March
Also, the Bitcoin received as mining rewards might sometimes be more valuable to the recipient than the notionally greater amount of other currency (or even nominally greater amount of Bitcoin!) spent on equipment and power, eg if it is outside of sanctions, no longer tied to proceeds of a crime, no longer connected to a state's budget, etc.
dllthomas··on Jeff Bezos killed Washington Post endorsement of Kamala Harris
Using "majority of people" to mean anything but something over 50% of people is going to lead to miscommunication. I'd advise against it.

> 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.

dllthomas··on Jeff Bezos killed Washington Post endorsement of Kamala Harris
Betting on winner, or on popular vote? Because even assuming the betters have the odds right, those are not the same thing.
dllthomas··on Jeff Bezos killed Washington Post endorsement of Kamala Harris
My understanding is that Silver's model has been more favorable to Trump than 538, by virtue of 538 having Kamala up just a little while Silver had her up less or Trump up a little. In the past couple days 538 shifted a little toward Trump; I'm not sure Silver's model did the same. His updates have been saying "small moves, still basically tied" for a while, but like you I'm outside the paywall.
dllthomas··on A new book shows how the power of companies is destabilizing governance
Doesn't really undermine your point, but as a fun aside: Trusting Trust style attacks on compilers were (theoretically) solved by David Wheeler with "diverse double compiling".
dllthomas··on The Nazi of Oak Park
It does display the lyrics w/ one click, also the sheet music, has multiple recordings, and is actually Lehrer's site. It's true that there's no video.
dllthomas··on Wealth Distribution in the United States
> Now I'm pretty sure we will see the first trillionaire in the next decade

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.

dllthomas··on The Nazi of Oak Park
https://tomlehrersongs.com/wernher-von-braun/ is perhaps a better link.
dllthomas··on Do U.S. ports need more automation?
There's a social sense in which you're correct - the machine wasn't counting on that wage, didn't cancel plans to be available, etc...

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.

dllthomas··on Being Raised by the Internet
I think you probably need more dexterity (and grip strength) for minimal successful communication with a pen than with Morse code, especially if you wind up trying to do both without visual feedback.

The odds of those around you noticing is something you have some power over, if you're thinking about it ahead of time.

dllthomas··on Why Most Published Research Findings Are False (2005)
I don't think the fact that the law (rightly, I will grant) unified two things when determining whether to punish means that we should always unify those things in our reasoning in other contexts.
dllthomas··on Vapour: A typed superset of the R programming language
"Typing your code forces validations at the boundaries" was too strong because of course you can type your code without actually doing the validations, but you can structure your code such that that won't happen accidentally: https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-va...

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).

dllthomas··on Hezbollah pager explosions kill several people in Lebanon
The accounts may be serious (even accurate!) but whoever chose the numbers was not being serious in their choice of number. Or it's quite the coincidence.
dllthomas··on Hezbollah pager explosions kill several people in Lebanon
> I see some reports claiming that the trigger message was “07734 58008” but hard to tell if all these accounts are serious.

Clearly someone's not being serious.

dllthomas··on Why Not Comments
> With a half decent IDE you do not need it.

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.

dllthomas··on What are the best options for Amazon SDEs thinking about leaving over RTO policy
> The game "tit for tat" requires you actually tit if you get a tat.

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.

dllthomas··on Why Not Comments
I once came to a complicated, multi threaded C++ program and saw:

   using namespace std; // using namespace standard
dllthomas··on Steve Ballmer's incorrect binary search interview question
> really, this is a stupid question and a waste of everyone’s time

Yeah, 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.

← PreviousPage 4 of 34Next →