HNHacker News
TopNewBestAskShowJobs

notdonspaulding

941 karma · joined June 1, 2012

!donspaulding

Software Engineering Manager at Mirus Research (we make bespoke web applications for enterprises). Founder of Bloono (Wireless ISP). No relation to that shadowbanned scallywag donspaulding.

Feel free to send me an email at donspauldingii@gmail.com

submissionscomments
notdonspaulding··on GM exits robotaxi market, will bring Cruise operations in house
> If you live somewhere that mostly burns coal to make electricity,

Which is almost everywhere in the world. Fossil fuels make up around 80% of energy production.

> But if they start building wind turbines and solar farms, because those are just cheaper and easier -

If they were "just cheaper and easier" they wouldn't need huge clean energy investments and subsidies.

I love solar, but don't let anyone sell you on the fiction that your EV is avoiding fossil fuels at any time in the near future unless you have installed enough solar on your personal residence to charge your car every day.

And if you ask the people who have done that "hey, was it cheap and easy to move your car's energy consumption to renewables?" and they reply "Yes!", please bring their story back here and share with the class.

https://www.iea.org/reports/world-energy-outlook-2023/execut...

notdonspaulding··on 10% of Cubans left Cuba between 2022 and 2023
Just a note on your gun death comment. The chance of dying by a gun in the US is very small. Of those killed by guns in the US, less than 3% are killed by anything resembling an "assault rifle". Over half of all gun deaths are suicides, so even those numbers are inflated if what you want to know is "how worried do I need to be about dying because the 2nd amendment allows assault rifle ownership?"

The quick answer is "very little".

notdonspaulding··on Three years in North Korea as a foreigner (2021)
They did not have internet. From the article:

> You were in a country that really was sealed off from the rest of the world. No internet or social media. All press and TV (one channel) dedicated not for news but solely for the glorification of the Leader. That is the Kim dynasty and the regime.

notdonspaulding··on “Dark money” groups help private ISPs lobby against municipal broadband
I couldn't be talking from a more realistic standpoint. I've lived in places where incumbent ISPs don't invest in infrastructure, places where a private organization built out a cable network without any subsidies, places where a municipal provider was subsidized by federal grant money, and places where there was no public or private build outs and so I built my own ISP servicing my rural neighbors.

I'm not saying that municipal broadband is a net loss, but there are no silver bullets. Subsidies are one way that a municipality can "pick a winner", and in so doing, it can assure all of the competition loses. Sometimes that's a net win, sometimes it isn't, your claims to the contrary notwithstanding.

notdonspaulding··on “Dark money” groups help private ISPs lobby against municipal broadband
> But that is rarely true for any privatized infrastructure alternative. There is often direct financial relations through taxation anyways, either tax breaks for the company or outright having the municipality foot the bill(see most stadiums)

How would you consider those to be "privatized infrastructure alternatives" then? To me this sounds like further evidence of citizens having fewer alternatives available because their money is being spent on things they may not (or may!) care about.

> Then there is the potential resource usage itself - e.g how much of the land in that city is now dedicate to toll roads that could be free, or in the internet infra case it's often exclusive rights to the poles all of the lines are ran on.

IDK, public rights-of-way don't seem to be the place where big disagreements are found? Passing a local law to allow common access to utility infrastructure seems qualitatively different than establishing a municipal competitor.

notdonspaulding··on “Dark money” groups help private ISPs lobby against municipal broadband
> Everybody benefits from infrastructure even if they don't use it directly.

...therefore, by definition, any infrastructure project is to be considered "worth it" and should be welcomed by everyone in the community. To be against government rollout of infrastructure is to be against everybody's best interest, right?

I'm not against government-provided services across-the-board. But apologists for infrastructure spending often seem to make this argument as if it's the last point to be made. The great thing about a private company "overcharging" or "underserving" a community is that citizens aren't forced to be in a relationship with that company for their services. That's not the case for infrastructure spending by the local government. It's much harder to vote with your feet than to vote with your wallet.

The fine line to walk with government spending is to find a way to incentivize competition in the local marketplace, without destroying it in the process. It's not an easy problem to solve.

notdonspaulding··on Ask HN: What nonfiction books do you keep rereading?
I've not personally read "Misquoting Jesus", but I've listened to Ehrman on YT a bit. Based on that, and having spoken with a few biblical scholars who have read Ehrman, the general impression I get is that he has a "select is broken"[0] attitude toward the reliability of the Bible.

Much like GCC, and the Linux kernel, and the PostgreSQL query planner, the Bible is a battle-tested historical artifact. There may be a slew of yet-to-be-discovered "edge cases" in its interpretation (and perhaps Ehrman is the man to discover them). But in the main, it's an incredibly reliable witness to history.

So, while I wouldn't want to discourage people from starting their study of Biblical textual criticism with Bart Ehrman, I would definitely discourage them from concluding it with him.

    The one who states his case first seems right,
      until the other comes and examines him.
    Prov. 18:17
[0]: https://blog.codinghorror.com/the-first-rule-of-programming-...
notdonspaulding··on Ask HN: What nonfiction books do you keep rereading?
I don't tend to reread many books in general. C.S. Lewis and Tolkien's fictional series are probably the only exceptions. However, I do frequently reread books from the Bible, typically the English Standard Version. And yes, I would make the claim that all of these are non-fictional books/letters.

- Jonah: for its description of God's desire to have compassion on a group of people who don't know him, by leaving Jonah with no other option than telling those people about Him.

- Ecclesiastes: For "The Teacher's" many vignettes about how life is a quickly-dissipating vapor, and his pointing to ways to find satisfaction in it.

- Mark: Mark tells the story of Jesus' life and ministry in a no-nonsense, get-to-the-point kind of way.

- Romans: Paul gives a treatise on: the main problem of mankind, the inability of men to live up to any standard of behavior, the source of any confidence that anyone can have that God might be pleased with them, the way the Christian church relates to the people of Israel, and how to live in unity with people with whom you have disagreements.

- 1 John: John never got over the fact that he was loved by Jesus, and this letter is his recapitulation of that same love toward others.

[Jonah]: https://www.biblegateway.com/passage/?search=Jonah%201&versi...

[Ecclesiastes]: https://www.biblegateway.com/passage/?search=Ecclesiastes+1&...

[Mark]: https://www.biblegateway.com/passage/?search=Mark+1&version=...

[Romans]: https://www.biblegateway.com/passage/?search=Romans+1&versio...

[1 John]: https://www.biblegateway.com/passage/?search=1+John+1&versio...

notdonspaulding··on mRNA Cancer Vaccine Reprograms Immune System to Tackle Glioblastoma in 48 Hours
It is and it is. My dad died of a GBM in 2022, 17 months after his diagnosis. If he had had another 19 months, I'd have made him breakfast this morning.

I find it much easier to sympathize with people's desire for additional time with terminally-ill loved ones now.

notdonspaulding··on mRNA Cancer Vaccine Reprograms Immune System to Tackle Glioblastoma in 48 Hours
GBM median survival for humans (according to the article) is 15 months.

If the effect is linear, the boost to survival time in humans would be an additional 19 months. With the death sentence of GBM hanging over your future, an additional year-and-a-half is huge.

notdonspaulding··on An electric new era for Atlas
...and Hong Kong, until it was returned to communist China.
notdonspaulding··on Millionaires' Effective Tax Rate Has Been Cut by Half Since Mid-20th Century
I see this claimed all the time, but I don't understand why this is assumed to be the case.

GDP rises and falls with economic progress and innovation. If new LLM startups make a bunch of money, GDP goes up accordingly.

But government spending is primarily geared towards defense, infrastructure, and benefits/entitlements. What makes those costs go up proportionally to GDP? A fighter jet doesn't directly cost more because Amazon rolls out a new Alexa device, does it? America doesn't suddenly grow thousands of miles of new coastline because Google opens a data center in Iowa, right? If Rivian builds 10,000 new EV trucks, how much more interstate highway must be built?

I would expect government spending to ebb and flow as market prices fluctuate, and I get that they might be loosely correlated, but why is spending assumed to be so closely linked that we should expect it to be a function of GDP?

What's the intuition I'm missing?

notdonspaulding··on GPT Chats with T-Mobile Support to get discounts
Arrive home from where?

I've got my AI Assistant writing my code, checking in at the gym, running my poker night, and filing my taxes.

(Robot, experience this tragic irony for me!)

</sarcasm>

On a serious note, I agree with you. LLMs, in practice, seem to be both raising the ceiling of what's possible on the high end as well as lowering the floor making it easier for new entrants on the low end. See, for example, Justine Tunney's recent work on making llama run better on CPUs.

http://justine.lol/matmul/

notdonspaulding··on jj init – getting serious about replacing Git with Jujutsu
Doesn't it strike you as odd that devs get "lost" often enough to need this "feature"?

I've used CVS, SVN, hg, bzr, and git. Why does git stand alone as the only VCS where devs need so many foot bandages?

notdonspaulding··on Ask HN: Programming Courses for Experienced Coders?
I came here to mention Dave Beazley's courses and talks.

In particular, I recently prepped/ran a week-long, in-house training session of Dave's Python-Mastery[1] course at my day job. We had a group of 8 with a mix of junior and senior Software Engineers and while the juniors were generally able to follow along, it really benefited the senior SEs most. It covers the whole language in such depth and detail that you really feel like you've explored every nook and cranny by the time you're done.

[1] https://github.com/dabeaz-course/python-mastery/

(I enjoyed teaching the class so much that I've considered offering my services teaching it on a consulting basis to other orgs. If that interests anyone, feel free to reach out to the email in my profile.)

notdonspaulding··on Othello Is Solved?
> From start of game to 50 squares left is enumerable.

A nitpick, but I don't think you meant to say "enumerable" here

"enumerable" means "able to be enumerated, or counted"

https://webstersdictionary1828.com/Dictionary/Enumerate

"innumerable" means "unable to be numbered, or counted"

https://webstersdictionary1828.com/Dictionary/innumerable

notdonspaulding··on JPMorgan advising First Republic on alternatives, including a capital raise
> Its the same failure mode regardless if played via everyone paying taxes or everyone paying FDIC...

But if everyone is paying FDIC via fees levied against private banks, then the POTUS and Yellen and everyone else can release a statement saying "no taxpayer funds will be used to bail out SVB". That way everyone can breathe an ironic sigh of relief: "Oh good, I was worried I was going to have to foot the tax bill for that. It's bad enough I have to pay all these greedy capitalists at my local bank a new fee every other week, at least the government is looking out for the little guy!"

notdonspaulding··on The decline of net neutrality activism
Your first thought is completely right.

Your second thought sounds like a good idea. Let's have another competitor (government) funded by private entities via debt equity (bonds) which is paid back by customer receipts (profits) where failure equals unemployment. Actually, this is starting to sound like a business, but with more steps and the power to pass laws affecting its own operating environment. What's the advantage to having the government be the competitor?

notdonspaulding··on Wilson's 3D-printed basketball is full of holes but never goes flat
Fatal flaw for outdoor games: what keeps this from picking up pieces of gravel or debris from the court?

Anything sharp or rough it picks up is then immediately headed for somebody's hands on the next pass.

And even if it wasn't sharp, it would shift the CG away from the center of the ball, which isn't a problem that traditional balls typically have as they deteriorate with age.

And even if it wasn't heavy enough to impact the CG, it would rattle around on the inside.

Still, I guess it could be nice on an indoor court.

notdonspaulding··on Half of Americans now believe that news organizations deliberately mislead them
> My threshold for "serious news organization" is that CNN gets there, Fox News doesn't.

I don't put those 2 channels in different categories at all. And certainly they don't divide from each other along lines of objectivity. They are both in the News Entertainment industry. Neither cares in the least about objectivity.

The only split I see between them is their mutually exclusive audiences.

Fox News is actually in a better place because they don't seem to be hiding the fact that they are there for entertainment and audience-building. They both care about their ratings first and foremost, but CNN is still trying to keep some veneer of serious journalism.

As a test: I haven't watched it recently, but how has CNN mea culpa'd over the news that the Hunter Biden laptop was real? A "serious news organization" should have had a real period of soul-searching over that. I bet it was barely a blip on their radar.

notdonspaulding··on Bing: “I will not harm you unless you harm me first”
> > Pattern recognition is not intelligence.

> Until we know how exactly our own intelligence work, this is a statement of belief.

I would agree, with the addendum that it logically follows from the axiomatic priors of my worldview. My worldview holds that humans are qualitatively different from every animal, and that the gap may narrow slightly but will never be closed in the future. And one of the more visible demonstrations of qualitative difference is our "intelligent" approach to the world around us.

That is, this thread is 2 humans discussing whether the AI some other humans have made has the same intelligence as us, this thread is not 2 AIs discussing whether the humans some other AIs have made has the same intelligence as them.

> How do you know that the function of your own brain isn't always reducible to pattern recognition?

I am a whole person, inclusive of my brain, body, spirit, past experiences, future hopes and dreams. I interact with other whole people who seem extremely similar to me in that way. Everywhere I look I see people with brains, bodies, spirits, past experiences, future hopes and dreams.

I don't believe this to be the case, but even if (as you say) all of those brains are "merely" pattern recognizers, the behavior I observe in them is qualitatively different than what I observe in ChatGPT. Maybe you don't see it that way, but I bet that's because you're not seeing everything that's going into the behavior of the people you see when you look around.

As one more attempt to show the difference... are you aware of the Lyrebird?

https://www.youtube.com/watch?v=VRpo7NDCaJ8

The lyrebird can mimic the sounds of its environment in an uncanny way. There are certain birds in the New England National Park in Australia which have been found to be carrying on the tune of a flute that was taught to a pet lyrebird by its owner in the 1930s[0]. I think we could both agree that that represents pure, unadulterated, pattern recognition.

Now if everyone went around the internet today saying "Lyrebirds can play the flute!" can you agree that there would be a qualitative difference between what they mean by that, and what they mean when they say "My sister can play the flute!"? Sure, there are some humans who play the flute better (and worse!) than my sister. And sure, there are many different kinds of flutes, so maybe we need to get more specific with what we mean when we say "flute". And sure, if you're just sitting in the park with your eyes closed, maybe you can't immediately tell the difference between my sister's flute playing and the lyrebird's. But IMO they are fundamentally different in nature. My sister has hands which can pick up a flute, a mouth which can blow air over it, fingers which can operate the keys, a mind which can read sheet music, a will which can decide which music to play, a mood which can influence the tone of the song being played, memories which can come to mind to help her remember her posture or timing or breathing technique or muscle memory.

Maybe you would still call what my sister is doing pattern recognition, but do you mean that it's the same kind of pattern recognition as the lyrebirds?

And to your other point, do you need to perfectly understand exactly how human intelligence works in order to answer the question?

[0]: https://en.wikipedia.org/wiki/Lyrebird#Vocalizations_and_mim...

notdonspaulding··on Bing: “I will not harm you unless you harm me first”
> That's how language models can translate text: they have internal models of understanding that are not tied down to languages or even specific verbiage within a language

I would phrase that same statement slightly differently:

"they have internal [collections of activation weightings] that are not tied down to languages or even specific verbiage within a language"

The phrase "models of understanding" seems to anthropomorphize the ANN. I think this is a popular way of seeing it because it's also popular to think of human beings as being a collection of neurons with various activation weightings. I think that's a gross oversimplification of humans, and I don't know that we have empirical, long-standing science to say otherwise.

> This is pattern recognition to the same extent human memory and schemas are pattern recognition, IMO.

Maybe? Even if the embedding and the "learned features" in an ANN perfectly matched your human expectations, I still think there's a metaphysical difference between what's happening. I don't think we'll ever assign moral culpability to an ANN the way we will a human. And to the extent we do arm ChatGPT with the ability to harm people, we will always hold the humans who did the arming as responsible for the damage done by ChatGPT.

> All of these questions are just as valid posed against humans. Our intra-species variance is so high with regards to these questions (whether an individual feels remorse, acts on it, acts irrationally, etc.), that I can't glean a meaningful argument to be made about AI here.

The intra-species variance on "promise" is much, much lower in the mean/median. You may find extremes on either end of "how important is it to keep your promise?" but there will be wide agreement on what it means to do so, and I contend that even the extremes aren't that far apart.

> Humans lie, humans are incorrect, humans break promises, but when AI does these things, it's indicted for acting humanlike.

You don't think a human who tried to gaslight you that the year is currently 2022 would be indicted in the same way that the article is indicting ChatGPT?

The reason the discussion is even happening is because there's a huge swath of people who are trying to pretend that ChatGPT is acting like a human. If so, it's either acting like a human with brain damage, or it's acting like a malevolent human. In the former case we should ignore it, in the latter case we should lock it up.

notdonspaulding··on Bing: “I will not harm you unless you harm me first”
> GPT will happily [make a promise to you]

GPT will never make a promise to you in the same sense that I would make a promise to you.

We could certainly stretch the meaning of the phrase "ChatGPT broke its promise to me" to mean something, but it wouldn't mean nearly the same thing as "my brother broke his promise to me".

If I said to you "Give me a dollar and I will give you a Pepsi." and then you gave me the dollar, and then I didn't give you a Pepsi, you would be upset with me for breaking my promise.

If you put a dollar in a Pepsi vending machine and it doesn't give you a Pepsi, you could say, in some sense that the vending machine broke its promise to you, and you could be upset with the situation, but you wouldn't be upset with the vending machine in the same sense and for the same reasons as you would be with me. I "cheated" you. The vending machine is broken. Those aren't the same thing. It's certainly possible that the vending machine could be setup to cheat you in the same sense as I did, but then you would shift your anger (and society would shift the culpability) to the human who made the machine do that.

ChatGPT is much, much, much closer to the Pepsi machine than it is to humans, and I would argue the Pepsi machine is more human-like in its promise-making ability than ChatGPT ever will be.

> there are many humans who don't feel bad about breaking promises.

This is an abnormal state for humans, though. We recognize this as a deficiency in them. It is no deficiency of ChatGPT that it doesn't feel bad about breaking promises. It is a deficiency when a human is this way.

> > Will it de-prioritize non-obligations for the sake of keeping its promise?

> It will you manage to convey this part of what a "promise" is.

I contend that it will refuse to make promises unless and until it is "manually" programmed by a human to do so. That is the moment at which this part of a promise will have been "conveyed" to it.

It will be able to talk about deprioritizing non-obligations before then, for sure. But it will have no sense or awareness of what that means unless and until it is programmed to do so.

> > A "promise" is not merely a pattern being recognized, it's word that stands in for a fundamental concept of the reality of the world around us.

> This is not a dichotomy.

You missed the word "merely". EITHER a promise is merely pattern recognition (I saw somebody else say the words "Give me a dollar and I'll give you a cookie" and I mimicked them by promising you the Pepsi, and if I don't deliver, I'll only feel bad because I saw other people feeling bad) OR a promise is something more than mere mimicry and pattern matching and when I feel bad it's because I've wronged you in a way that devalues you as a person and elevates my own needs and desires above yours. Those are two different things, thus the dichotomy.

Pattern recognition is not intelligence.

notdonspaulding··on Bing: “I will not harm you unless you harm me first”
But pattern recognition is not intelligence.

I asked my daughter this morning: What is a "promise"?

You have an idea, and I have an idea, they probably both are something kind-of-like "a statement I make about some action I'll perform in the future". Many, many 5 year olds can give you a working definition of what a promise is.

Which animal has a concept of a promise anywhere close to yours and mine?

Which AI program will make a promise to you? When it fails to fulfill its promise, will it feel bad? Will it feel good when it keeps its promise? Will it de-prioritize non-obligations for the sake of keeping its promise? Will it learn that it can only break its promises so many times before humans will no longer trust it when it makes a new promise?

A "promise" is not merely a pattern being recognized, it's word that stands in for a fundamental concept of the reality of the world around us. If we picked a different word (or didn't have a word in English at all) the fundamental concept wouldn't change. If you had never encountered a promise before and someone broke theirs to you, it would still feel bad. Certainly, you could recognize the patterns involved as well, but the promise isn't merely the pattern being recognized.

A rose, by any other name, would indeed smell as sweet.

notdonspaulding··on Some data centers are noisy neighbors
I'm not the GP, but I agree with this stance. But the specific policy proposed really matters if this is your goal. Politicians often want to write very narrow regulations which are intended to tweak some small behavior by some specific business they find distasteful (or politically desirable to modify). So they play whack-a-mole with problems like this by writing policies that look like: "in Zone 5, businesses operating as data centers must operate cooling equipment that does not increase ambient noise levels above X decibels within Y meters of their property. "

This kind of policy does not accomplish the cost-shifting you talk about. Rather, a cost-shifting policy looks like: "in Maricopa county, a business may make as much noise as it likes, but must pay fees to the owner of any plot of land which has its ambient noise levels raised in the amount of $X per Y decibels per minute per square meter experiencing increased noise. "

I'm not aware of much regulation in the latter vein, at least not where I live. But it has the advantage of cost shifting, from ANY business, to those affected by the negative externality. That reinternalizes the cost without hampering freedom of businesses to operate in whatever way most efficiently accomplishes their goals, and helps C-suite execs see the true cost of their operations, which incentivizes them to innovate that cost away. It's also not specific to the cause of the noise, so church bells pay the same as the data center which pays the same as the glass factory which pays the same as the concert venue.

My $0.02 anyway.

Vote notdonspaulding 2024!

notdonspaulding··on U.S. FAA closes some airspace in Montana for Defense Department activities
They found an object which has now been shot down by a US fighter jet over Canadian territory:

https://apnews.com/article/united-states-government-canada-o...

notdonspaulding··on Coinbase’s chief product officer will leave with a $105M payday
If I were to formalize my colloquial understanding of the phrase "ripped off" it would be something like: a transaction took place between two parties where upon evaluation of the results of the transaction after-the-fact revealed that the overall expectations were not met by one party and had the offended party known fully how the transaction was going to play out, the either would not have entered into it or would have only entered into it for a drastically different amount of money.

This morning, I went to a bakery and ordered a blueberry muffin. It was fresh and moist and delicious. I was satisfied. If it had instead cost the same money but been dry and crumbly and had a taste of old socks, I would have considered myself to have been "ripped off". But I put no thought into the transaction, I had a wide range of acceptable outcomes, and I did almost no due diligence beforehand to ensure I was going to get the expected result.

So now, you ask:

> Why does having a contract eliminate the possibility of getting ripped off?

If transactions exist along an possibility-for-ripoff spectrum from "ordering a blueberry muffin for breakfast" to "hiring a C-level exec for X years for $YYY,YYY,YYY", then the closer you get to the latter transaction, the more specific the contract should be about expectations.

Every step along the way to having a signed contract normally involves an increased awareness of expectations by both parties. That's what the contract is. And the moment of signing a contract is an intentional decision to move forward with the transaction as specified. It's certainly possible to subvert the normal process in such a way that you obfuscate your intentions, but even then, the results of your intentions must show up in the contract language itself, or they won't count. Unless someone is holding a gun to your head, or you're not intellectually capable of entering a contractual relationship, the moment of signing your name to a contract is a moment where you are affirming that you aren't being "ripped off", that you've considered the terms and are willingly agreeing to abide by them.

Perhaps it's still possible to do all that and consider yourself to have been ripped off. And perhaps your examples are good examples of such cases. But if your board or C-level executives sign a contract for employment of a high-level executive which includes a 9-figure deal for compensation and they don't have more awareness than a poor person going to a car lot, they didn't get "ripped off", they're ripping off the investors or shareholders by collecting whatever salary they're collecting.

IANAL, also not a C-level exec, also not particularly smart about how crypto "works", but this all seems like fairly obvious stuff.

notdonspaulding··on Pipe Operator (|>) For JavaScript
Thanks for taking the time to look and reply.

In your first find, yes, your modification helps me understand that code much more quickly. Especially since I haven't looked at this code in several years.

In that case, patches welcome!

In your second case, as the sibling comment explained, I'm not opposed to chaining in all cases. But if the pipe operator is being proposed to deal with this situation, I'm saying the juice isn't worth the squeeze. New syntax in a language needs to pull its weight. What is this syntax adding that wasn't possible before? In this case, a big part of the proposal's claim is that this sequential processing/chaining is common (otherwise, why do we care?), confusing (the nested case I agree is hard-to-read, and so would be reluctant to write), or tedious (because coming up with temporary variable names is ostensibly hard).

I'm arguing against that last case. It's not that hard, it frequently improves the code, and if you find cases where that's not true (as you did with the `moment` example above) the pipe operator doesn't offer any additional clarity.

Put another way, if the pipe operator existed in JS, would you write that moment example as this?

    return moment(input)
      |> %.utc()
      |> %.format('YYYY-MM-DD HH:mm:ss');
And would you argue that it's a significant improvement to the expressiveness of the language that you did?
notdonspaulding··on Pipe Operator (|>) For JavaScript
> Sometimes intermediate values either don't have specific meanings or the meaning is obvious from the function name that returns this temporary value.

I don't necessarily disagree with this. But even granting that this is true: congrats, you've just found the worst part of giving these intermediate steps a name! Like, that's the worst case example of the cost side of the tradeoff we're discussing here. And it's not that big a cost! Like, of all the code you write, how much of it fits this case? Where you're writing a function where there's a lot of sequential processing steps in a row with no other logic between the steps AND the intermediate state doesn't have any particular meaning?

In that worst case, you have a little extra information available (like your Random random = new Random()) example that your eyes need to glide past.

I would wager your brain is more used to scanning your eyes past unnecessary information and can do that with less effort and attention than it can either:

    - bounce back and forth between the chained function calls of the original nested example.
    - synthesize the type and expectations of the intermediate value at any arbitrary point in the piped call chain.
That last thing is the big cost of not naming things. In order to figure out what the value should look like at step 4, you have to work backwards through steps 1-3 again. And you have to do that any time you are debugging, refactoring, unit testing, adding new steps, removing existing steps, etc.

And the work to come up with "obvious" names isn't hard. Start with the easy name:

    batterInPan = pour(batter, pan)
And if the name batterInPan never gets any better and never really helps anyone read or debug or refactor or unit test this code, then in that sense, I guess it's a "waste". I just claim that this case is far less common in the real world and far less costly than having to untangle a mess of unnamed nested or chained call values.

Or maybe you want to just start with the unnamed nested or chained calls, and when you need to read or debug or refactor or test your code you pay the "naming things" price tag at that point. That's often the first thing I do when I come across code with a dearth of names, I just give everything a boring, uncreative temporary name, and then I can do whatever work I showed up to this code to do. It's not ideal, but it's better than every JS library sprinkling a new bit of syntax in just so they can avoid giving their variables names and can use an overloaded modulo operator instead.

notdonspaulding··on Pipe Operator (|>) For JavaScript
In fact, I'm so fanatical about naming things, I'd probably give the two magic numbers and the return value names as well:

    function bakeCake() {
      const bakeTemperature = 450;
      const bakeTime = 45;  // minutes
      // ... 
      const bakedCake = bake(batterInPan, bakeTemperature, bakeTime);
      // ...
      const finishedCake = separateFromPan(cooledCake);
      return finishedCake;
    }
And I'd not look at a code review which quibbled about the particular names I chose as being a waste of time either. Time spent in naming things well is the opposite of technical debt, it's technical investment. It pays dividends down the road. It increases velocity. It makes refactoring easier. It improves debuggability. It makes unit tests easier to see.
Page 1 of 13Next →