Ben Cohen

thwart leader

Ben Cohenairspeedswift
2025-05-15

Scheduling a 4pm Friday meeting is the “driving up the right turn lane because it's empty then merging back in” of calendaring.

Ben Cohenairspeedswift
2025-05-03

@mikeash i'm sorry for not BUYING A NEW CAR to match my cabling

Ben Cohenairspeedswift
2025-05-03

For unknown reasons, all USB A to C cables must have CHONK around the C end that means they don't fit through phone cases.

Ben Cohenairspeedswift
2025-04-26

Original paper here, very readable and worth your time: pic.plover.com/knuth-GOTO.pdf

One thing not in there that I would add is that often that 3% causing a problem is not where the hot path is _supposed_ to be. i.e. you have a performance bug. But the advice is the same. Find the place where your program is taking the time, then fix it. It's just that, after you fix it, it might move somewhere else because it shouldn't have been there in the first place. Eventually the 3% is where it belongs.

Ben Cohenairspeedswift
2025-04-26

Here's the quote in context. It's really good advice! But it's clear about how you absolutely need to spend time on that 3%.

The key is you should get your project into a state where you can continuously identify that 3% whenever you're written some more code.The sooner you know where that code is the better, because that can guide to to making sure that’s fast.

This also help you catch problems before you've written so much code that fixing it is going to take ages.

A screenshot of an old computer science paper. It has been OCRd but is clearly a high quality scan of a printout.

There is no doubt that the grail of effi-
ciency leads to abuse. Programmers waste
enormous amounts of time thinking about,
or worrying about, the speed of noncritical
parts of their programs, and these attempts
at efficieney actually have a strong negative
impact when debugging and maintenance are
considered. We should forget about small
efficiencies, say about 97% of the time: pre-
mature optimization is the root of all evil.
Yet we should not pass up our opportuni-
ties in that critical 3%. A good programmer
will not be lulled into complacency by such
reasoning, he will be wise to look carefully
at the critical code; but only after that code
has been identified. It is often a mistake to
make a priori judgments about what parts
of a program are really critical, since the
universal experience of programmers who
have been using measurement tools has been
that their intuitive guesses fail. After work-
ing with such tools for seven years, I've be-
come convinced that all compilers written
from now on should be designed to provide
all programmers with feedback indicating
what parts of their programs are costing
the most; indeed, this feedback should be
supplied automatically unless it has been
specifically turned off.
Ben Cohenairspeedswift
2025-04-26

misunderstanding the "premature optimization is the root of all evil" quote to mean "wait until you're done before thinking about performance” is a huge problem for the programming profession

Ben Cohenairspeedswift
2025-04-25

@schwa sunny, you say…

A photo of an overcast morning in Cupertino in April. The shot is framed by trees. The clouds are grey but not looking likely to rain. A large curved office building is in the distance.
Ben Cohenairspeedswift
2025-04-25

@maxd @ole @mattiem they're both “is a”, just in slightly different ways

Ben Cohenairspeedswift
2025-04-25

@ole @mattiem no, i'm rabidly the opposite. no space before the colon

Why anyone thinks let a: B doesn't get a space, but extension B : P does get a space completely eludes me. They're both the same operator and should be spaced the same.

If people wrote let a : B, it would at least be consistent (but nobody does that because eww)

Ben Cohenairspeedswift
2025-04-24

This proposal would be a really useful addition to string interpolation. But I can never pass up an opportunity to stan an Either type instead.

forums.swift.org/t/se-0477-def

Ben Cohenairspeedswift
2025-04-22

What if playgrounds, but on the command line… an idea for a "swift play" command from @chrismiles

forums.swift.org/t/playground-

Ben Cohenairspeedswift
2025-04-22

I am once again begging pasta manufacturers to dedicate half the surface of their packaging to the cooking time.

Ben Cohenairspeedswift
2025-04-21

@rmondello sorry that 3d pie chart needed a content warning

Ben Cohenairspeedswift
2025-04-21

Sunday scaries

Graph of the 1 week price of the US Dollar ISE futures. It plunged Sunday night from 99.78 down to 98.19.
Ben Cohenairspeedswift
2025-04-20

His dissent is literally that they didn’t let him delay them until after the plane took off.

SUPREME COURT OF THE UNITED STATES
No. 24A1007
A.A.R.P., ET AL. v. DONALD J. TRUMP, PRESIDENT
OF THE UNITED STATES, ET AL.
ON APPLICATION FOR INJUNCTION
[April 19, 2025]
JUSTICE ALITO, with whom JUSTICE THOMAS joins, dis-
senting.
Shortly after midnight yesterday, the Court hastily and
prematurely granted unprecedented emergency relief. Pro-
ceeding under the All Writs Act, 28 U.S. C. §1651, the
Court ordered "'t]he Government" not to remove a "putative
class of detainees" until this Court issues a superseding or-
der. 604 U.S. _ (2025). Although the order does not de-
fine the "putative class," it appears that the Court means
all members of the class that the habeas petitioners sought
to have certified, namely, "[a]ll noncitizens in custody in the
Northern District of Texas who were, are, or will be subject
to the March 2025 Presidential Proclamation entitled 'In-
vocation of the Alien Enemies Act Regarding the Invasion
of the United States by Tren De Aragua' and/or its imple-
mentation."* Motion for Class Certification in No. 1:25 cv-
59 (ND Tex., Apr. 16, 2025), ECF Doc. 3, p. 1. And although
the Court does not specify what it means by "[t]he Govern-
ment," it appears that the term is intended to embrace all
the named defendants, including the President. Cf. Fed.
Rule Civ. Proc. 65(d) (2).
Ben Cohenairspeedswift
2025-04-19

Normally, the Supreme Court order would start with the throat-clearing “The application presented to Justice Alito and by him referred to the Court” but the wording on the deportation injunction is unusual, starting “There is before the court an application” which implies Alito was deliberately stalling to aid the illegal deportation attempt, and the other justices intervened.

lawyersgunsmoneyblog.com/2025/

Ben Cohenairspeedswift
2025-04-19

@jrose @olafurw “when did you start the project?” “oh, you know, twelve”

Ben Cohenairspeedswift
2025-04-17

It is hilarious how stupid the calculation for the Dow index is and yet it remains a thing.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst