HNHacker News
TopNewBestAskShowJobs

PeterWhittaker

2,211 karma · joined April 27, 2009

submissionscomments
PeterWhittaker··on Proposal: JavaScript Structs
(Wipes away tears of laughter) I needed that! [1] [2]

[1] just got some bad news [2] all in all, I love working in JS when I have to, but I’ve worked in it long enough to know of at least very many of the foot guns.

PeterWhittaker··on Engineers are not fans of technologies
Others are commenting on the “abrasiveness” and other emotional aspects of this post, and I guess I am just too little a fan (of python) to see it. I have nothing against it, I’m just not a fan...

...of python or of anything else.

Well, with the possible exception of bash, which is my go-to for those first few rounds of hacking, and which sometimes gets me into trouble when I stick with it too long, unless and of course it is obvious that something else is better suited.

(Like two years ago when I wrote a queue management orchestrator for our core security product using C because it HAD to be fast, and since I am stronger in C than Rust. I would have preferred Rust, for traits and safety, but I didn’t know it well enough and needed to get to 1.0 fast, so C it was.)

Anyway, my point is that while perhaps wordier than it needed to be, TFA is spot-on: don’t use your favourite tool unless it also happens to be a right tool for the job (and there are almost always more than one right tool).

Seems like something we should all know.

PeterWhittaker··on William Cowper and the Age of the Earth [pdf] (2019)
As much as I like poetry, why do we attribute to a poet that which we owe to a most observant and introspective canal digger who felt free to question dogma and received wisdom?

William Smith deserves so much of our respect. Cf, e.g., https://en.m.wikipedia.org/wiki/The_Map_that_Changed_the_Wor..., which summarizes the most excellent book.

PeterWhittaker··on Winamp removed "No forking" restriction from license
So basically this change allows contributors to fork the repo in order to offer pull requests, and nothing else changes.

The dotting and crossing of Is a Ts, sort of like how users of social media platforms grant those platforms certain rights to their posts and comments in order to allow the platforms to copy/distribute/publish that content.

PeterWhittaker··on Questioning the Criteria for Evaluating Non-Cryptographic Hash Functions
I’ve read the first several paragraphs and skimmed the article a few times, and the motivation still eludes me: given the existence of cryptographic hash functions that are well designed and thoroughly tested, why spend so much time on non-cryptographic hash functions?

What benefits do they provide that are not provided by their secure “brethren”?

PeterWhittaker··on Firefox no longer works after upgrading to macOS Sequoia
{MacOS,Linux} seems to have a lot of {apologists,haters}.

There, fixed that (with a bashism) for you.

PeterWhittaker··on The Unfortunate Physics of Male Urination (2016)
Personally, unaroused, single stream. Any level of arousal, two streams at ninety degrees to one another.

Been that way for over 40 years. I can only figure that erectile tissue distorts the internal shape, especially at the “nozzle”.

No other fluids involved.

PeterWhittaker··on UK Shops can refuse to take cash even though it's legal tender (2023)
Ah! Thank you! That is a subtlety I had overlooked. Pedanticism (pedantry?) FTW.

"One has no recourse should one refuse to accept cash in settlement of the debt", or something like that.

:->

PeterWhittaker··on UK Shops can refuse to take cash even though it's legal tender (2023)
Likewise IANAL and this jives with my understanding: legal tender simply means that it cannot be refused in payment of a debt, e.g., to pay for fuel already pumped, a meal already eaten, a service already rendered.

However, there is no obligation to take when paying ahead of time, e.g., when ordering at a takeout counter, or otherwise as part of the offer and acceptance process, which is how all over the counter retail sales are characterized for legal purposes.

The only restrictions are on denominations, e.g., a business is not obligated to accept more than X coins of type T, etc.

PeterWhittaker··on UBC engineers develop all-in-one solution to catch and destroy forever chemicals
I’m guessing that you mean as a preservative?

If so, no: the article is about a technique for destroying long-lived PFAS molecules, which are extraordinarily stable and therefore long lived, and about which there are health concerns (they do very odd things to biological systems in very low concentrations).

Linked in the article is the research paper detailing the technique: https://www.nature.com/articles/s44172-024-00267-4

PeterWhittaker··on GNU Screen 5.0 Released
That’s my default as well, worked great, except on a machine with shared sessions, a test driver machine where several of us will login as the same user: some of those people come from windows machines where ctrl-space gets mapped to ctrl-@, which is NUL.

So we had to find another prefix for those machines; fortunately, tmux can have two.

This (space->@->NUL) is mentioned in the tmux docs, tbh.

PeterWhittaker··on Ask HN: Which movies did you watch multiple times?
I’ve been struggling with how best to express it, but I think it comes down to the recapitulation, in the musical sense, i.e., how a composer will revisit a theme and take it in a new or at least different direction; to the möbius strip/meta quality; and to the banality of the evil of the antagonist: why, yes, that’s exactly how I would expect a deranged and resentful program to punish its (perceived) enemy.

The continuing question of perception, both of reality and of values, is a key element of all of that.

It’s true to the original, repeating parts of it without ever being the same. The River of The Matrix, or the Matrix of Thaddeus, if you will.

PeterWhittaker··on If Your World Is Not Enchanted, You're Not Paying Attention
I’m not really sure what their point was. My world is (mostly) not enchanted (I am a Maritimer with Irish roots, after all, so the weird isn’t that far away), as I am a reductionist at heart.

Is my sense of wonder diminished by understanding Rayleigh Scattering?

Not only “no”, but I would say that it is doubled or more by being able to appreciate the blue of the sky and the reflected blue of the water while understanding the mechanisms...

just like how my appreciation of both optics and E&M deepened tremendously when I realized that the former was just a simple expression of the latter...

the same “latter” that led Einstein to the Lorentz transformation to solve the problems of additive velocities causing ridiculous magnetic fields, and thus gave us SR.

I mean, wow, just wow.

My world IS enchanted, but by math and its wondrous ilk.

PeterWhittaker··on Ask HN: Which movies did you watch multiple times?
Hunt for Red October

The Outpost

Master and Commander

The Martian

All four Matrix movies

The Godfather Trilogy, best in a single sitting (Connie’s arc is awesome, the cinematography of the third epic; the only problem is how much more of the outside world each of the sequels needs).

Greyhound

A Bridge Too Far (which has changed dramatically as I have learned over the last almost fifty years; I now see it as so subtlety tongue in cheek and cynical).

Draft Day. Possibly the best constructed movie.

PeterWhittaker··on The Tenth Man Rule: How to Take Devil's Advocacy to a New Level
It's a catchy name, but it really comes down to, well, not drinking your own Kool Aid. :->

The project and risk management literature have plentiful examples of this sort of thinking, including performing post mortems now, before starting anything: "Assume we are 2 years out and everything failed: What went wrong? How did we fail? Why?"

One of the things I like best about my current position is that the colleague I work most closely with (he's head of development, I'm a senior technical contributor sort of thing (it varies by project/week/day/need)) do this all the time, pretty much whenever one of us proposes a change or a new feature.

We listen to the other, make sure we understand, then we critique, find flaws, consider gotchas, but reasonably, not pathologically.

It's at the point where we will each sometimes start critiquing our own ideas, with the other defending.

It helps our work immensely.

PeterWhittaker··on Ask HN: What code editors or IDEs are easily scriptable?
This is mostly how I work as well, and has the advantage that when I need to poke around on servers and appliances on which I do not have my vim setup, I can still use a lot of my regular “tricks” because they are shell-based.

Sure, sure, I do miss tpope’s surround and repeat plugins, but I have shell muscle memory and am happy(ish).

IMHO, of course, YMMV. :-)

PeterWhittaker··on Why are religious teens happier than their secular peers?
“I wish I was a believer I'd spend less time in being sad”

North Winds Blowing, The Stranglers

PeterWhittaker··on Empathy for the user having sex with your software
Yes, master.
PeterWhittaker··on lldap: Light LDAP Implementation
Hmm, shouldn’t it be lSLAPD or LDSA? After all, it is an LDAP server, not lighter weight protocol!
PeterWhittaker··on Known carcinogen is showing up in wildfire ash, researchers are worried (2023)
Well, naturally, in the sense that naturally occurring chromium was converted to its very dangerous hexavalent state by the intense heat of the fire(s).

The that this hexavalent chromium is ultimately of natural origin and not man made does not make this any less of a concern.

PeterWhittaker··on Importance of plate tectonics for evolution and extraterrestrial civilizations
A possible solution to the Fermi Paradox, by the addition of two terms to the Drake Equation, one representing the probability of planets with sufficient land mass and oceans and one representing the probability of more than half a billion years of tectonic activity.

The work is based on the observations that a) life as we understand it needs oceans to start, that b) sufficient land mass is required for life to evolve to complex, large multicellular organisms, and that c) prolonged periods of tectonic activity appear to catalyze the evolution of large complex multicellular organisms.

PeterWhittaker··on [dead]
Enshittification explained with bad AI clickbait.
PeterWhittaker··on Ask HN: What's (in your opinion) the best authentication method for web apps?
Also well documented are attacks against stores of hashed passwords, esp. pre-built dictionary attacks.

There are more ways to do that wrong than right.

Of course, that is irrelevant to my point: even if you do store them all properly, you are still going to get attacked.

Don’t give people such terrible advice unless you also tell them how to protect themselves.

PeterWhittaker··on Ask HN: What's (in your opinion) the best authentication method for web apps?
If you accept id+password, either you are storing them, in which case you are a target (prepare to be boarded), or someone else is. If someone else is, you might as well use OAuth, and allow a choice of provider, but the integration effort is non-trivial (but far less than protecting your site against those looking to breach your hoard of stored treasure, other people’s passwords).

The other alternative is to support TOTP and let people use whatever authenticator they want.

PeterWhittaker··on Jeffrey Snover and the Making of PowerShell
Others have provided better answers than I could have, as I don’t remember clearly enough.

What I do remember is that until I understood what I was trying to do and why (mostly error handling around edge cases, all specific to the app), I couldn’t really grok the various object management calls, but that once I’d done a few rounds of PoCing and RTFMing, everything fell into place.

PeterWhittaker··on Jeffrey Snover and the Making of PowerShell
> I have this web page saved up in case I ever need to convince anyone of this... http://mywiki.wooledge.org/BashPitfalls

This is a great list of pitfalls, absolutely, but they are more an argument for integrating shellcheck into your IDE than avoiding bash, IMHO!

I know, I know, possible religious war, but I find that bash+shellcheck is far more often the right toolset than switching languages to avoid the pitfalls.

The immense power and expressiveness and immediacy of bash makes so many programs and so much prototype->PoC->MVP progression so easy and effortless that it is worthwhile having tooling to catch the worst of the warts.

PeterWhittaker··on Jeffrey Snover and the Making of PowerShell
I started my career with a X term hosted on a SunOS pizza box, have written thousands of scripts, more than a few in the KLoC count.

Several years ago, I had to write a complex unattended robust data transfer system in PowerShell. (I know, I know, without more info these “requirements” beg many questions, but they are all out of scope for this reply.)

I enjoyed the experience so much I switched all my shells, on MacOS (my DD) and on Linux (my most common work environments) to PWSH.

What I liked most about it was the power of passing objects in pipelines, and being able to extract/manipulate some of the properties of an object in the first filter and still have access to others, along with those of objects created by that first filter, in filters later in the pipeline.

Immensely powerful.

The consistency of commands, of error handling, and of object properties was also very nice.

Eventually, as the nature of work changed I switched all shells back to bash, as the older muscle memory asserted itself. PWSH as a shell made sense when I was working and thinking so much in that space, but when I left it, it was more effortful to think in PWSH than to resume bash.

There are times I miss it. There is nothing else in the shell space that comes close, or at least not close enough to justify the effort of switching.

PeterWhittaker··on [dead]
Well, that was logically empty nothing burger.
PeterWhittaker··on Why not parse `ls` and what to do instead
grep -q and you won’t need the redirect of stdout.
PeterWhittaker··on Git Branches: Intuition and Reality
I just reread my take on branches and relearned some stuff I’d forgotten: https://peter-whittaker.com/obligatory-grokking-git-post

Warning, all text, no diagrams....

← PreviousPage 7 of 34Next →