HNHacker News
TopNewBestAskShowJobs

cjensen

6,062 karma · joined September 29, 2011

submissionscomments
cjensen··on A 17-year-old teen refutes a mathematical conjecture proposed 40 years ago
The best thing about juniors is they don't know a problem is impossible, so they just do it.
cjensen··on Some bits on malloc(0) in C being allowed to return NULL
There are three reasonable choices: (a) return the null pointer (b) return a valid unique pointer and (c) abort().

The point of the original C Standard was to make rules about these things AND not break existing implementations. They recognized that (a) and (b) were in existing implementations and were reasonable, and they chose not to break the existing implementations when writing the standard.

This is similar to the extremely unfortunate definition of the NULL macro. There were two existing styles of implementation (bare literal 0 and (void *) 0) and the Standard allows either style. Which means the NULL macro is not entirely safe to use in portable code.

cjensen··on C: Simple Defer, Ready to Use
Obviously first two strats don't work, so I would use the third.
cjensen··on C: Simple Defer, Ready to Use
I use a few strategies instead of goto:

(1) For simpler cases, wrap in do {} while (0) and break from the loop

(2) For multiple cleanups, use same technique combined with checks to see if the cleanup is required. E.g. if (f != null) fclose (f)

(3) put the rest of the stuff in another function so that the exit code must run on the way out.

In 35 years of coding C/C++, I've literally never resorted to goto. While convenient, this new defer command looks like the kind of accidental complexity that templates brought to C++. That is, it provides a simple feature meant to be solve simple problems in a simple way that accidentally allows architecture astronauts the ability to build elaborate footguns.

cjensen··on There's No Such Thing as Software Productivity (2012)
It's implied in the definition. Consider the units: a ratio should not have units. Lines of code per programmer per day would have weird units, for example, and could not be compared against number of windows installed per day for per car window installer. The only way for productivity to be useful is to normalize the inputs and outputs into money.
cjensen··on There's No Such Thing as Software Productivity (2012)
The output is measured with dollars, not lines of code. So are the inputs.

It's a perfectly cromulent measure so long as we understand the limitations of the measure. For example, trying to measure the productivity of a day or a sprint? That's silly. Measure the output of a team which does not produce an entire product? Won't work because you'd have to figure out how to apportion the productivity.

cjensen··on Boeing overcharged the U.S. Air Force 8,000% above market for soap dispensers
The US has 222 C-17 Aircraft. A single C-17 costs over $300 million.

If you ask Boeing for soap dispenser parts for these, what should they cost? Boeing charged $149,072 for the dispensers. That's $671 per plane. Is that too much?

If you had to make these dispensers, make sure they conform to rules for aircraft parts and Air Force parts, provide formal responses to bids, etc., how much could you make them for?

It seems high to me. The article says 8000%, which is less than $10 per plane. So while it seems high, it's definitely not 8000% high.

cjensen··on Bluesky is currently gaining more than 1M users a day
It's a worse experience for posters for two major reasons: blocking is not as effective (blocked people can still read and respond), and there are too many weird scolds who yell at people for not adding content warnings for trivial things.

I don't post so it doesn't affect me directly. It affects where the people I follow choose to post.

cjensen··on A 94x speed improvement demonstrated using handwritten assembly
To clarify, it's 94x the performance of the naive C implementation in just one type of filter. On the same filter, the table posted to twitter shows SSSE3 at 40x and AVX2 at 67x. So maybe just a case where most users were using AVX/SSE and there was no reason to optimize the C.

But this is just one feature of FFmpeg. Usually the heaviest CPU user is encode and decode, which is not affected by this improvement.

It's interesting and good work, but the "94x" statement is misleading.

cjensen··on My most downvoted StackOverflow answer
You're being confused by one of the parts of C that is difficult for beginners to wrap their heads around, and is a trap from the unwary.

In C, there are arrays. If you use the identifier that names the array as a parameter to a function, it gets quietly converted to a pointer to the first item of the array and all array size information is lost.

So you can obtain the array size, but only if you are dealing with the identifier that directly names the array. If you attempt the same technique on a pointer to the array, bad things will happen.

cjensen··on My most downvoted StackOverflow answer
I don't understand. In the Meta the answer is used as an example of something that never gets deleted by the system. I don't see any anger about it -- just a discussion of a defect in the Stack Overflow system where unhelpful answers never get pruned.
cjensen··on Eating the Birds of America: Audubon's Culinary Reviews of America's Birds
In Audubon's time, the only way to accurately paint a bird in detail was to shoot it, examine it, then paint it. It's also why so many of his paintings are of birds in unnatural positions.

Even today, museums and universities sometimes pay for non-rare birds to be collected by shotgun. Collections are needed for certain types of comparative analysis when trying to sus out whether two birds are different species or just variety within a species.

cjensen··on Appeals court finds California’s “Age Appropriate Design Code” unconstitutional
By "Ruse," they mean the law's ruse of claiming to only regulate the conduct of design, when in actual fact the law clearly intends to regulate speech. It's a "ruse" to try to avoid a court noticing that the law obviously violates the First Amendment.
cjensen··on Don't blindly prefer `emplace_back` to `push_back` (2021)
Sometimes I think rvalue-references were a bad idea. Sure they improve efficiency for people using objects directly instead of through a pointer, but the amount of mental model added worries me that the average coder will have no real clue what rvalue references are. People really overestimate how much most coders understand.
cjensen··on gRPC: The Bad Parts
The generated C++ interfaces to gRPC are also filled with an incredible amount of indirection and unnecessary concepts. I'd say it's a "bad at writing complex things simply" culture rather than being Java-specific.
cjensen··on How the STL Uses Explicit
I don't know, but a hypothetical 'implicit' would mean converting all unmarked constructors into explicit constructors... which would have broken a lot of existing code.
cjensen··on Why blue animals are so rare
There are many birds which are blue, but none of them have blue pigments [1]. It's a light-scattering effect.

[1] https://blog.education.nationalgeographic.org/2016/05/09/the...

cjensen··on The biggest CRT ever made: Sony's PVM-4300
Be aware that this is not a TV. The PVM Series of monitors are professional video monitors that are not offered for sale to mere consumers. This is the kind of thing that would be installed in the control room of a TV station to display the station's final output.

20 years ago the small video company I worked for had a $30K Sony PVM monitor that was probably only 30-35 inches. So the $40K price in 1990 doesn't surprise me in the slightest.

The only thing interesting about this is "biggest CRT ever made" because it shows the limits of CRT technology.

cjensen··on Stonehenge Damaged by Protesters
The assumption that it will wash away in the rain rather than find its way into cracks and pits in the rock is an awfully big bet to make vs permanent damage to history.
cjensen··on FTC sues Adobe for hiding fees and inhibiting cancellations
Very interesting here is the charges against a pair of specific executives who are _not_ at all C-Suite level. Makes me wonder why them, specifically. E.g. could it have been something like emails between them suggesting the illegal activity, but no evidence they told anyone above them?
cjensen··on User is locked out every day when she goes to lunch
That's a design bug, not a user problem.

Why are zero-length passwords treated as login attempts for a user with a non-zero password? Why are a cluster of login attempts permitted in such quick succession? There's so many obvious fixes here for what is apparently a common issue.

cjensen··on Why "Structure and Interpretation of Computer Programs" matters (2011)
A funny thing to me is I took CS 50 in '85 or '86 (CS 50 and CS 55 were later split into the CS61X series), and instead of Scheme we used Logo for functional programming.... using Brian Harvey's textbook. He was not teaching the course that semester.

At least part of the goal of CS 50 at that time was to explicitly weed students. They didn't want undeclared students to waste a whole lot of time on CS only to find out they were not going to be accepted into CS. Instead, they went through one hard course to find out. Perhaps that explains why some of it was overwhelming to some students?

cjensen··on Embedded Swift [video]
I appreciate the effort, but this is a misguided idea.

This is not the first Embedded <LANG> attempted. For example, Embedded C++ [1] has been around for a couple of decades and is only used in a few weird places like Apple Device Drivers.

The problem is that if you are so very constrained that you can't afford to have dynamic memory that is reference counted, then you probably have so little memory and functionality that you may as well just use C as an advanced assembly language for the processor.

[1] https://en.wikipedia.org/wiki/Embedded_C%2B%2B

cjensen··on Satellite data show electromagnetic anomalies 19 days before Turkey earthquake
There's no "dogma" or "social consensus" here. The authors of the paper simply failed to do their homework adequately.

Earthquake Prediction is filled with cranks. To deal with the issue, there is a neutral set of criteria for "how to test a prediction theory" which involves making predictions in advance with a clear description of what types of events match the predictions and likelihood of event. Geologists can then compare a series of predictions and their outcomes to what would be expected based on historic patterns. Math then allows one to determine if the prediction theory is better than random guessing.

No predictions have yet been better than random guessing.

cjensen··on Satellite data show electromagnetic anomalies 19 days before Turkey earthquake
This is junk. They claim "anomalies" and fail to state the statistical odds of this anomaly occurring globally and the odds for this particular location. They also examine precisely one large earthquake rather than even considering looking at earthquakes in general.

"My cat walked across the keyboard right before the large earthquake" is not statistically significant.

cjensen··on U.S.-Saudi petrodollar pact ends after 50 years
Saudi Arabia lives in the same trap China does with respect to the dollar: they own so much dollar-denominated wealth that they have no interest in intentionally destroying the dollar. They may sensibly diversify going forward, but diversification is a long way from the kind of everything-must-go selloff of dollar assets that would be required to harm the value of the dollar.
cjensen··on 60 kHz (2022)
Inspired by, certainly. The founders were not ignorant and were aware of precedent.

But calling it "almost copied word-for-word" is not justifiable. On a trivial basis, it's literally not word-for-word in any way. On a more serious basis, there are significant changes in the laws, and enshrining something in an Act which can be changed by future Parliaments is a lot different that enshrining something into a Constitution which is much harder to change.

cjensen··on Steam's Last Stand
It's not solvable. Yes, temporary response is a thing. But if I'm driving around town but then go on a freeway then what? Does it always over-produce around town? Or does it take time to build the new head of steam needed for the freeway?

Also consider how complex a thing you are proposing vs a gas and electric simple solution of "more input gives more output now."

cjensen··on Steam's Last Stand
Steam has fundamental problems beyond engine startup time that are just not solvable. Gas engines can quickly switch from low-power to high-power, meaning that you can kick it up quickly to pass another car or maintain speed up a hill.

It's all tradeoffs, but responsiveness matters. And in terms of responsiveness steam < diesel < gas < electric. There's a reason both diesel and gas have long coexisted: sometimes you need more responsiveness, and sometimes more constant power. Steam was just too far from acceptable for high speed responsive output.

cjensen··on How Waymo outlasted the competition and made robo-taxis a real business
Camera vs Lidar+Camera is not a narrow question. Cameras lack sufficient dynamic range to work in many situations, and therefore cannot alone be used for a real self-driving solution where the driver naps.

Your example of needing to read a stop sign isn't a great example. At least in North America, a hexagonal sign is always a stop sign. A better example of your point would be a speed limit sign.

← PreviousPage 2 of 34Next →