HNHacker News
TopNewBestAskShowJobs

quacker

803 karma · joined January 13, 2011

submissionscomments
quacker··on Git Rebase for the Terrified
Using git history as documentation is hacky. A majority of feature branch commit messages aren't useful ("fix test case X", "fix typo", etc), especially when you are accepting external contributions. IF I wanted to use git history as a form of documentation (I don't. I want real documentation pages), I'd want the history curated into meaningful commits with descriptive commit messages, and squash merging is a great way to achieve that. Git bisect is not the only thing I do with git history after all.

And if I'm using GitHub/Gitlab, I have pull requests that I can look back on which basically retain everything I want from a feature branch and more (like peer review discussion, links to passing CI tests, etc). Using the Github squash merge approach, every commit in the main branch refers back to a pull request, which makes this super nice.

quacker··on Git Rebase for the Terrified
Right, but they are referring to configuration on a GitHub repository that can make squash merge automatic for all pull request merges.

e.g. When clicking the big green "Merge pull request" button, it will automatically squash and merge the PR branch in.

So then I don't need to remind or wait for contributors to do a squash merge before merging in their changes. (Or worse, forget to squash merge and then I need to fix up main).

quacker··on Git Rebase for the Terrified
Rebasing replays your commits on top of the current main branch, as if you’d just created your branch today. The result is a clean, linear history that’s easier to review and bisect when tracking down bugs.

The article discusses why contributors should rebase their feature branches (pull request).

The reason they give is for clean git history on main.

The more important reason is ensure the PR branch actually works if merged into current main. If I add my change onto main, does it then build, pass all tests, etc? What if my PR branch is old, and new commits have been added onto main that I don't have in my PR branch? Then I can merge and break main. That's why you need to update your PR branch to include the newer commits from main (and the "update" could be a rebase or a merge from main or possibly something else).

The downside of requiring contributors to rebase their PR branch is (1) people are confused about rebase and (2) if your repository has many contributors and frequent merges into main, then contributors will need to frequently rebase their PR branch, and each rebase their PR checks need to re-run, which can be time consuming.

My preference with Github is to squash merge into main[1] to keep clean git history on main. And to use merge queue[2], which effectively creates a temp branch of main+PR, runs your CI checks, and then the PR merge succeeds into main only if checks pass on the temp branch. This approach keeps super clean history on main, where every commit includes a specific PR number, and more importantly minimizes friction for contributors by reducing frequent PR rebases on large/busy repos. And it ensures main is never broken (as far as your CI checks can catch issues). There's also basically no downside for very small repos either.

1. https://docs.github.com/en/repositories/configuring-branches...

2. https://docs.github.com/en/repositories/configuring-branches...

quacker··on Go.sum is not a lockfile
You can still do vendoring with Go modules, using the `go mod vendor` command.
quacker··on Slack has raised our charges by $195k per year
Yes it does. They don’t have to pay $200k/yr + $50k immediately, and don’t have to spend the time, effort, and money on self-hosting and migrating away.
quacker··on We shouldn't have needed lockfiles
This entire article is a strawman. It fails to even understand the basic important problem lock files try to address.

Sure, I can deterministically resolve the same X.Y.Z versions of packages according to whatever algorithm I like.

But literally everything is mutable (read: can be compromised). Package managers, bytes flying over the network, build servers - all mutable. A published version of a package can be overwritten. Some package managers allow authors to overwrite existing versions.

That means no guarantee of reproducibility. I build again the next day, and I may not download the same code for the same X.Y.Z version of a package. Or my local cached packages may have changed.

So I need checksums on packages. Then I can prove I have the exact same code in those packages. And if I have checksums on packages, I have a lock file.

> lockfiles are an absolutely unnecessary concept that complicates things without a good reason

What is even the complication? The lock file is autogenerated on a successful build and I commit it. It's trivial to use. It's literally all benefit and no downside.

quacker··on We shouldn't have needed lockfiles
> Gradle suffers the same exact issue by default, because it inherits it from Maven

It's not the exact same issue because Gradle and Maven have different conflict resolution:

Maven dependency conflict resolution works with a shortest path, which is impacted by declaration ordering. Gradle does full conflict resolution, selecting the highest version of a dependency found in the graph.

from https://gradle.org/maven-and-gradle/

quacker··on Uber's Shower Gate Scandal
She’s in HR not finance, and wasn’t an executive at the time. It’s extremely unlikely she had anything to do with the failure of Washington Mutual.
quacker··on What if we made advertising illegal?
But when I go to Instagram, I go to look at my friends posts, or at whoever I follow. I don’t go to look at products/ads.

If I open a product catalog, I do that to purposefully look at products.

quacker··on argp: GNU-style command line argument parser for Go
In what way is reflection nasty?

What compile-time validation do I actually lose by using struct tags for CLI arg parsing?

quacker··on macOS Tips and Tricks (2022)
I'm on Sonoma (14.5). In System Settings > Siri & Spotlight,

1. I can deselect some pre-defined categories that Spotlight searches

2. I can click the "Spotlight Privacy..." button (at the very bottom right). Then I can add folders for it to ignore.

(My preference is for Spotlight to ignore almost everything, so that it isn't indexing stuff and eating CPU on this old Macbook Air. I only have it scan Applications, Calculator, and System Settings. I have it specifically ignore my entire home directory which is where all my git repos are.)

quacker··on Apple Invites
As if there was no bullying in any other age? Is Apple's walled garden really the source of this bullying? Teenagers can bully each other about anything.
quacker··on The Origins of Wokeness
Reminder to flag the submission if you think it’s inappropriate for HN.

IMO, it doesn’t belong here.

quacker··on 41% of Employers Worldwide Say They'll Reduce Staff by 2030 Due to AI
Agreed. I finally tried Github Copilot for a bit at work. It felt like babysitting a bad developer. I have no confidence in the correctness of the code it produces, so everything requires careful review. Sometimes it spits out very broken code on non trivial tasks.

I’m still figuring out if/how it can make me more productive. First impression is it’s more a drain on productivity than not.

quacker··on The paper passport's days are numbered
How is this any different a concern than losing your physical passport while traveling?
quacker··on The paper passport's days are numbered
In the US, it currently costs $165 in total for a passport book (new or renewal).[1]

That’s more than enough for a cheap android phone.

1. https://travel.state.gov/content/travel/en/passports/how-app...

quacker··on The paper passport's days are numbered
If being forgery-resistant is the argument for paper docs, a passport that identifies me using strong cryptography is just as forgery-resistant (likely more so). And we could do a cryptographic verification without a persistent internet connection. (Or can’t we?)
quacker··on Honeycrisp apples went from marvel to mediocre
Yes, I have Envy apples at my grocery stores in the US. Wikipedia says they are grown in Washington state here.

Envy apples are my favorite. They tend to be more expensive than Fuji, but are about the same price now.

quacker··on OK, I can partly explain the LLM chess weirdness now
I agree with you as far as the current state of LLMs, but I also feel like we humans have preconceived notions of “thought” and “reasoning”, and are a bit prideful of them.

We see the LLM sometimes do sort of well at a whole bunch of tasks. But it makes silly mistakes that seem obvious to us. We say, “Ah ha! So it can’t reason after all”.

Say LLMs get a bit better, to the point they can beat chess grandmasters 55% of the time. This is quite good. Low level chess players rarely ever beat grandmasters, after all. But, the LLM spits out illegal moves sometimes and sometimes blunders nonsensically. So we say, “Ah ha! So it can’t reason after all”.

But what would it matter if it can reason? Beating grandmasters 55% of the time would make it among the best chess players in the world.

For now, LLMs just aren’t that good. They are too error prone and inconsistent and nonsensical. But they are also sort weirdly capable at lots of things in strange inconsistent ways, and assuming they continue to improve, I think they will tend to defy our typical notions of human intelligence.

quacker··on Three ways to think about Go channels
> it's idiomatic in go to use short names like chan though

There's a linter which I like[1] that checks variable name length based on the scope of its usage.

The idea is a variable name can be short if it is used in a small lexical scope (e.g. a function parameter in a one-line function) because it won't affect readability much. But names should be descriptive if used in a larger scope (e.g. a constant used across a file).

1. https://github.com/blizzy78/varnamelen

quacker··on Apple Reportedly Suspends Work on Vision Pro 2
This is an unnecessarily derisive comment.

I know if I like the taste of a new dish without being a great chef. And so can people know if they (and their friends) will buy and use a $3k - or $1.5k - VR headset.

quacker··on Universities Have a Computer-Science Problem
I only skimmed the article, which seems to argue for a level of well-roundedness in computer science programs (coming from an author who dropped out of their CS program in favor of philosophy in the 90s).

I’d sympathize more with this if college was not so expensive. If you have the means, by all means spend the credit hours on whatever you like. But covering tuition is difficult for many students, and graduating even one semester early is a significant cost savings, and more so if you can start working and making money.

Instead of “random humanities” requirements, maybe actually prepare me for a job. Provide industry relevant courses, or apprenticeship / internship opportunities. Or leave me time to do school and a job concurrently to help cover tuition.

Let me be done with school, and afterward I’ll learn a language or philosophy or whatever I like in my free time.

quacker··on Reddit Files to Go Public, Reveals That It Paid CEO $193M Last Year
IANAL, but my understanding is the GDPR applies if they have users located in the EU, regardless of where the servers and company is located.

If Reddit wants to serve ads to users in the EU and store their info (email, ip, post content, etc), then the GDPR absolutely applies.

Enforcement is another question, but several US companies have been fined due to GDPR violations.

quacker··on Another Roman dodecahedron has been unearthed in England
It’s a good theory, but not obvious at all.

- It is not known that that the Romans used knitted clothing. Knitting was invented later.

- Knitting can be done with cheaper, easier to craft tools that are just as effective. Knitting doesn’t explain the cost and skill required to craft the dodecahedrons.

- There is no wear on these dodecahedrons that we’d normally expect from a well-used tool.

quacker··on CLI tool, written in Rust, to diff directory snapshots
I was surprised to not see a mention of `git diff` anywhere in the post.

Out of curiosity, I setup two directories where the second has a new file, a modified file, and a removed file compared to the first:

    $ tree dir1/ dir2/
    dir1/
    ├── empty.txt
    ├── modified.txt
    ├── remove-this.txt
    └── unchanged.txt
    dir2/
    ├── empty.txt
    ├── modified.txt
    ├── new-file.txt
    └── unchanged.txt
Then `git diff --name-status dir1 dir2` outputs the following, showing the changes by file name.

    $ git diff --name-status dir1 dir2
    M       dir1/modified.txt
    A       dir2/new-file.txt
    D       dir1/remove-this.txt
This also doesn't require running `git init` on the two directories either, so it's immediately usable out of the box.
quacker··on Delta Dental says data breach exposed info of 7M people
I’m not sure why you say this. Maybe I don’t understand what you mean.

I have Delta Dental through my employer’s benefits and it covers all the types of operations that I’d expect: preventive, endodontic, periodontic, orthodontic, prosthodontic, etc.

If I need a root canal, it’s covered by Delta Dental (up to a point, given the deductible). If I chip a tooth, and get an inlay or onlay, that is covered. Is this not insurance? Why not?

quacker··on Mass producing the most expensive rice cooker [video]
Ultimately, a rice cooker is a small luxury, but:

- A rice cooker frees up a burner on the stove, which is useful for those with small apartments or other situations where there are few or no burners available.

- Rice cookers are very consistent and virtually foolproof, even the cheap ones. Add water and rice, set it, and forget it. I can say I’ve over or under cooked rice on the stove at least a few times, but not once in a rice cooker.

- Decent rice cookers make far better rice than I’ve personally ever made on the stove (and I have cooked rice on the stove plenty).

- More expensive models keep rice hot (at a food-safe temperature) for hours, so you can prep well in advance of a meal. I put rice on to cook and can leave the house for hours without worrying about it, and have rice for the whole day in one batch, if needed.

- Rice cookers also cook other things and some handle different kinds of rice. Brown rice needs to be cooked significantly differently than white rice, for example.

quacker··on Why every microwave sucks these days
Yeah, of all the appliances in my own home, the microwave is the one I never complain about. I press the +30s button a few times, and the food is hot after a minute or two.

Yes, there are ten other buttons I never use. Yes, they could conceivably be “better” in small ways. Yes, modern ones can break like every other appliance does, but the ones from the 80s and 90s broke, too.

quacker··on Reorient GitHub pull requests around changesets
Agree. The better your team members, the less need there is for code review.

However, the approach of few/no code reviews doesn’t work for large open source projects that accept external contributions (the author of the post is mitchellh who is a founder of HashiCorp, which has/had several large open source projects).

quacker··on JEP Draft: String Templates (Final)
Except it’s more if I have text following a variable.

Try this:

    STR.”x=\{x} y=\{y} z=\{z}.”
Compared to:

    “x=“ + x + “ y=“ + y + “ z=“ + z + “.”

A string template incurs an overhead of 3 characters per variable (“\“, “{“, and “}”) plus the leading “STR.”, which is 4 characters. Concatenation incurs an overhead of 4 non-whitespace characters per variable (`”+` and `+”`), and that’s ignoring whitespace. If you have more than 3-4 variables, string templates are shorter.

The concatenation example is less readable as well. Have I included whitespace to exactly match the string template example? It’s a little hard to tell at a glance because I have to distinguish what is code whitespace and what’s included in the string.

← PreviousPage 2 of 11Next →