skysight-inc/HackerNews huggingface dataset:
> Why do you create a branch via the "git checkout" command?

git checkout -b foo

is just a shortcut for

git branch foo
git checkout foo

> Why do you delete tags using "git tag -d" but delete stashes using "git stash drop"?

That is inconsistent. One has an interface of `git <thing> <options-to-manage-thing>` and the other `git <thing> <subcommand-actions-for-thing>`. I imagine what happened is the former was the original and was probably thought to be sufficient, but then it wasn't for `stash` and the latter was introduced for more flexibility. The inconsistency is probably from backwards compatibility.

It might be worth noting that, at least as far as I know, git was like the first to use or at least popularize subcommands. It'd be understandable if they didn't include support for sub-sub-commands from the get-go.

> If you want to blow away local uncommitted changes, you can use "git reset", "git reset --hard" or "git checkout (file)" - which (I think) all do totally different things.

git-reset is mainly about resetting the branch, index, and/or working tree to a given ref. git-checkout is mainly about checking out a ref, setting HEAD and syncing the working tree to it. They're different things with an overlap. I would say that's not really inconsistent. It would only appear so when one only learns specific patterns of commands for subsets of their function, like "blow away local uncommitted changes", which in this case fits in their overlap.
I know what you mean (deleting a branch in a remote is a very unintuitive syntax to me at first glance, especially), but these are perhaps not the best examples:

> Why do you create a branch via the "git checkout" command?

That's a shortcut for "git branch (name)", then "git checkout (name)". Or the newer "switch" which is more obvious.

> Why do you delete tags using "git tag -d" but delete stashes using "git stash drop"?

Because the stash is more like a stack, and tags are not, so "drop" without a parameter is a valid and very usual command. Yes, it feels inconsistent, but allowing "git stash -d" without a parameter would probably not be better.

> If you want to blow away local uncommitted changes, you can use "git reset", "git reset --hard" or "git checkout (file)" - which (I think) all do totally different things.

These do all do different things, so that's why they all exist. "git restore (file)" was introduced a few years ago (with "switch", mentioned earlier) to make the last one more obvious, since that's indeed always been an uncomfortable syntax for a core operation.

Git's a very powerful tool, originally aimed at a very complex code base run by experts, and was written very quickly as an emergency replacement for BitWarden. This rushed development and target audience does show through even today, but it's being annealed over time. Nevertheless, it's so good at what it does that it's taken out nearly every other VCS by just existing (ok, and the network effects of GitHub, but they choose it for a reason too).
The reflog also won't help you recover things you manually delete before you `git add` them. Or that were outside of the git repo. Or that you written on a piece of paper that you threw away.

To someone who has a right mental model of git, all of these should be just as obvious. If you didn't stage your things, they were never in your repo.
How would it work with userspace memory allocators?
I agree, and would add that this is exactly what the OP is saying when it talks about this being a communication issue. Saying "a branch is just a ref" is the right attitude for talking to git and making it do what you want it to do, but it's the wrong attitude when you are writing or talking about code, in which case branches are the reification of the processes by which your code evolves.
What are some codebases from which beginners can learn to write good code?
Peter Norvig in his book "Paradigms of Artifical Intelligence Programming" says in the preface:

" All too often, the teaching of computer programming consists of explaining the
syntax of the chosen language, showing the student a 10-line program, and then
asking the student to write programs. In this book, we take the approach that the
best way to learn to write is to read (and conversely, a good way to improve reading
skills is to write). After the briefest of introductions to Lisp, we start right off with complex programs and ask the reader to understand and make small modifications
to these programs.

The premise of this book is that you can only write something useful and inter-
esting when you both understand what makes good writing and have something
interesting to say."

Suppose a beginner who has taken an introductory programming or CS course using a language (for simplicity and generality say Python). Now they want to know how to solve variety of problems using that language and write good code.

What codebases should they read? What kind of projects should they start writing? By projects I don't always mean gluing together apis with minimal work to build an app. There should be significant work to do from scratch even if they use a few apis for some parts of the project.

Do you have something specific in mind for such understandable codebases or walkthrough blogs/videos?

For projects, I think in the starting there should be some handholding/guidance. Are there any such resource?
I suppose you are aware that the Nuclear Regulatory Commission exits?
Some create job security though ivory tower structures. A surreal masterpiece conceived while failing to cure their schizophrenia by licking hallucinogenic frogs while on LSD.

Others in small firms sometimes notice a "team" is not beneficial... especially if some have seniority, rotten intent, and a string of prior failed launches.

Finally, one realizes it doesn't matter, as you're billing by the hour. A grim apathy replaces ambition, as one starts to fantasize about being a plumber. =)
The article makes no sense. Credit card company denied the charge and sent a text asking was that you, Yes or No. So then, the dots do not connect. All he had to do was text "No" in response. Instead, the family convenes and they decide to waste time with some chatbot on the original site and after to try to call humans at the credit card company ("cardistas")? Meanwhile, the Yes/No times out or something and charges go through. I don't get that; if they suspect it wasn't you, why wouldn't they give that reply all the time in the world? In all my experiences with Visa people being suspicious about activity, they freeze things until they get a hold of you.
This was a poorly written blog post by framing this particular situation as a "problem". It becomes a problem when someone acts inside a team or professional organization like this but the article is about single developer projects. There can be many good reasons why code quality doesn't matter in such instances but framing it from the start as a problem is more akin to clickbait. I would expect higher quality content on HN getting upvoted.
Try again with Vite and useReducer and prepare to have your socks blown off.
The last one is called "radiation hormesis", the opposing theory in which there is no safe level of ionizing radiation is "linear-no-threshold" (focusing only on the "no threshold" part). The middle ground is a threshold model in which low levels are hypothesized to do nothing for or against one's health.

- https://en.wikipedia.org/wiki/Radiation_hormesis

- https://en.wikipedia.org/wiki/Linear_no-threshold_model
Sorry, did you mean encryption ransomware? Or DDOS bot swarms? Or crypto mining hijackers? Or corporate sabotage? Or….

Because I think the answer is all of us.

Also, the targets of state level actors are using the same software as the rest of us. If ours is insecure, theirs is too. Have you seen the list of Open Source vulnerabilities the US Gov has not patched?
Yes, chat GPT excels at comprehending and explaining things that have a consistent structure, restructuring, and and synthesising variations. If you keep it in its lane, it’s an excellent tool.

It’s really really bad at counting though. For example, try asking it to produce a line of 40 asterisks.
The original ternary "fixes" the cases where `x` is "wrong" (e.g., is not a string - `x.length` does not fail, but evaluates to false, and thus you still get `<empty>`).

This even more terser code will fail if `x.toUpperCase()` fails with an exception (such as when x is not a string).
I went and dug up the primary source: it's https://www.youtube.com/watch?v=K6TnAn7qV1s, and the objectionable bit starts around the 13 minute mark.

While it's annoying that some of the media are refusing to quote him in full or link to his video, the context doesn't add much. He quoted a poll about the demographics of who agrees with https://en.wikipedia.org/wiki/It%27s_okay_to_be_white (which is both an innocuous statement and a white supremacist campaign to troll the media into complaining about said statement), then said some frankly ridiculous things about how he no longer (?) identifies as black. He did actually call black Americans a hate group, for some reason.

Overall he appears to have gone insane and I'm not surprised papers are dropping him now. It's not just some ambiguously-racist statements where he's saying it's okay to be white, but also a lot of bizarre and erratic behaviour that must make him a PR nightmare to work with.
I know about SLIT, but from my research most allergists don't mix in enough to make it comparable to shots. From studies I read you need 30-100x the dose of shots taken in monthly aggregate for it to be comparable. For example Odactra which is fda approved for dust mites is 30x the concentration of a monthly maintenance dose. I am allergic to almost everything, so I imagine it will be too costly to treat properly

Also it is much less regulated as its not fda approved, so the quality you are getting is less certain than shots. I would not be surprised if the majority of SLIT use cases in the US are placebo due to cost constraints outside of the fda approved tablets covered by insurance. Yes studies is one thing and its shown clearly that its comparable, but you need the right concentrations

TBH I am skeptical of startups that operate in this type of environment as theres not enough oversight. For me to be comfortable it would need to be very transparent what is going into the mix

source: https://fairfieldcountyallergy.com/whats-the-story-on-allerg... "Sublingual immunotherapy is not currently covered by health insurance companies in the United States because it is ineffective as it is done here"
Access Path Selection in a Relational Database Management System (1979) [pdf]
Canonical paper on SQL query optimization. By Patricia Selinger. The dynamic programming algorithm for determining join order proposed in this paper still forms the basis for most of the query optimizers used in modern relational systems.
CMU’s Software Engineering for Startups course
This misses the forest for the trees IMO. You have to look at “what problem does CMake try and solve”, and the answer is basically “generating build files for toolchains across a varied set of operating systems and environments”.

Now do I think CMake is perfect? No, certainly not. But syntax is the least of the issues with it. And it’s an enormous improvement on autotools in allowing you to improve portability of your build to Windows for e.g. - and worth saying that this was true before VS added CMake support.
Ah, pipe dreams =)
Interesting, thanks for the pointer!
Sorry, a slightly offtopic question: who drew the mascot? :)
This is pretty cool.

I wonder what's the best way to have the presentation in a single file instead of using multiple files to switch between slides.

My first approach would be to start each slide with something like

# Slide 1

Switching slides then can be done with a keyboard alias that searches for the next/previous instance of "^# Slide [0-9]".

To avoid having the next slide visible at the bottom of the screen, one could put enought empty lines at the end of each slide. This would actually be a bit cumbersome. Maybe there is a better solution?

Another problem I see is margins. In a nice presentation, there is a good bit of margin around the content. Unfortunately, VIM has no concept of margin. And emulating it with newlines and spaces is very cumbersome. As you cannot easily change it.
Well, I don't have any specific examples off the top of my head, but it's not that unusual for a loanword to disappear from the language it was borrowed from and then wind up reintroduced in some form to the original language.
So does git, in fact, without a better explanation of what exactly you mean, I would say upstream making changes to the the clients code is the core useful property of a version control system.
Do you do these critics for hire? Very insightful!
in theory yes, in practice this morning again I tried the new version of VS and encountered dozens and dozens of compile errors in standards-confirming C++20 code (which works fine in gcc and clang), some for fairly basic C++20 stuff.
Except just like with C++ being a C superset at source code level, Circle is a C++ superset, no need to rewrite existing code, that is the big difference.
I'd argue git is confusing for many people because they don't understand the data model. The solution is to learn the basic data model instead of pretending that "a branch is a ref" is not true. Because it is true.
LLM:

Large language models (LLMs) are a subset of artificial intelligence that has been trained on vast quantities of text data to produce human-like responses to dialogue or other natural language inputs. LLMs are used to make AI “smarter” and can recognize, summarize, translate, predict and generate text and other content based on knowledge gained from massive datasets. LLMs have the promise of transforming domains through learned knowledge and their sizes have been increasing 10X every year for the last few years.

source: NeevaAI (What is an LLM in AI?)
Good thinking.

One of the things modern "computing practices" taught us is the myriad of ways things can go wrong, they were probably a bit more naive at that time

It's Murphy's law squared
Spotify Will Launch a TikTok-Esque, Vertically Swiped Feed
For me the killer feature is regexp search. It's a shame standard CTRL+F is doing just exact matching.
Targeting the usage is exactly what makes git confusing to people. You can start using git just by learning when to type "git add", "git commit", "git push" and "git pull" and you'll manage to collaborate somehow, but it will all fall apart the first time you stumble upon an unfamiliar situation. And because Git's UX isn't great, it's pretty hard to create a right mental model just by using it and inferring from the interface.

If you start by creating a mental model, the confusion goes away. Reminding people that "branch is just a ref" is just a way to push them towards less confusion.
> A number of theories suggest that cosmic inflation may be an effect of a false vacuum decaying into the true vacuum. The inflation itself may be the consequence of the Higgs field trapped in a false vacuum state.

Basically the Big Bang may be younger than the matter in the universe.
It sounds like how Cletus on the Simpsons talks - which may be because some of the backwoods accents in popular media are parodies of real accent isolates from remote areas in the near past. (present?)

https://www.youtube.com/watch?v=ZMKqRp3veL8
CMake isn't the only build tool in town, I hardly use it for example.
The same developers that came up with Limbo and Go, somehow there is a common trend on how they see language design and the alternatives.
https://archive.ph/i1iB9
“Sarah this is medicinal, leave me the fuck alone!”
The language is not ready yet, but interop is a core requirement for the project.
Also my exact setup! Have hundreds of tabs and in between Session Buddy and The Marvellous Suspender, I haven’t lost one yet.
Yes, I would tend to agree that delivering a tirade of ad hominem attacks does not qualify as providing a solid argument to a fellow man. =)

I hope Adams’ comes around eventually. Until then, we will always have the good old times:

https://dilbert.com/strip/1995-06-24
Similar concern here about the lack of snapshot files. Can "locally stored" captured data points be version controlled, even if it's some special Touca binary that makes no sense in GitHub?

I'm coming at this from a "how would I integrate this into my existing corporate setup" perspective. I'm concerned less about UX and more just how it works.

If I interact with Touca via a local client that doesn't to the Internet, and the actual data points are exchanged entirely via Git, that's a much easier sell than another server that I have to ask SREs to maintain. And being able to say "it's just Git + a local client" makes it easier to reason about concerns like "what if we switch to GitLab" or "how would this integrate into our own bespoke CI/deploy pipeline".
It’s bad at counting because counting relies on a stateful O(N) algorithm you run in your brain.

GPT is trained to reproduce human text, which tends to simply have the output of this O(N) counting process, but not the process itself. So GPT “thinks” it should be able to just spit out the number just like human text implies we do. It doesn’t know we are relying on an offline O(N) algorithm.

If you have it emit a numbered list of 40 elements, it will succeed, because producing a numbered list embeds the O(N) process and state into the text, which is the only thing it can see and reason about.
Staging is useful for gradually queuing up multi-file commits rather than listing them all in one command. It becomes even more useful with partial file commits.
MSVC tends to like to tick off checkmarks that the other compilers would be hesitant to check off. So yes, MSVC can claim to implement modules and co-routines and pretty much all of the standard library, but in actuality it does so in a way that is unreliable and full of bugs.

GCC and clang have those same features, but they avoid including them in their main distribution and instead have experimental/development forks that people can use, opting to include them only when they meet a much higher standard than Microsoft.
> Would my salary be higher if I become more productive? No

Absolutely yes!
It is the Java Virtual Machine for a reason, the language that gets designed in step with the platform is the one that gets day zero goodies, everyone else plays catch up.

Kotlin also decided to become a platform of its own, just like every guest language.

It is also the reason why despite my C rants, if there is no alternative, that is what I use.

I rather use the tools that ship in the box than adding additional layers to configure and debug.
Mob programming is such an asinine concept to me. It's like all the people saying holotropic breathwork cures cancer. It's just developer mysticism. There is no amount of himing and hawing that would get me to believe treating one guy, capable of his own expression, as a code-input robot while developers around him bark commands at him is actually productive. Each line of code is so expensive and the probability of any one of the people barking the code remembering how something works is pretty low. There is significant evidence the action of typing/writing something produces better memory.

It works when you're helping a junior. It's insulting to anyone else. Part of our jobs as programmers is to be able to tease apart another developers mental model and learn the abstraction. If you cannot do this the codebase is either unsaveable or you are. The only codebases I have been unable to untangle in my long career have been either written by contractors or by a pseudo-intellectual moron developer that believes they are the second coming of Turing. Everyone else's code is usually able to be parsed with some patience and a debugger for more complicated tasks. I even gasp use pencil and paper to keep track of code flow often.
Do they? I certainly had no intuitive notion of how version control would work before I learned git for the first time.
I basically do user studies on people using my modules and code. It’s so effective that I’m just perplexed that nobody else seems to want to do it.
Create unique copies of ebooks for sale on Amazon only. If these show up on the pirate sites then accuse Amazon of providing copyrighted material to pirate sites.
This might not be your issue, but if you haven’t tried that transition before, the first batch of errors is often because secondary header includes incidentally let your code work in those other toolchains despite you not including required headers yourself. It happens annoyingly often, but it’s not a flaw in the toolchain. The MS headers are just structured differently.
Every time this comes up I wonder why no one mentions qute and nyxt browsers which natively support those bindings and have much more minimal UI.
I used to be a vimium user at first, then tridactyl but both fell short and felt hacky and for roughly a year now I’ve been using qutebrowser which is miles better.
Clickable: https://www.homerow.app
I’ve always thought Firecracker would be great for CI runners.
That is a statement as useful as saying that science publications until 1955 may be last ones not contaminated by calculators.
I would start with reading another book. It is called "Code Complete: A Practical Handbook of Software Construction" by Steve Mcconnell[1]. Don't let the age of the book scare you. The advices given by this book is in large parts timeless and you will find if very inspiring and a great help to improve your code. At my former place of work, this book was given to all new coders (regardless of experience level) on their first day at work and their first task was to read it.

[1] https://www.amazon.co.uk/Code-Complete-Practical-Handbook-Co...
Just want to offer a counterpoint. I took a sabbatical last year after working continuously for nearly nine. I felt I had it, I deserved a break. I just wanted to quit and see what happens. First few weeks were great. I travelled a bit, worked on my personal website, wrote a lot of articles, but gradually I sunk into this loop of doing-nothingness. I started playing video games all day, or surfing the internet. For some people this might not be an issue, but as a person who has always thrived on challenging and creative work, malaise started hitting me very soon.

Despite having all the time in the world, my creative spirit sunk to an all time low. All the wonderful things I had planned were not happening.

I do think it was a great learning experience, but I want to offer some advice. If you're going to take one, here are a few things you should do:

1. Think of at least one major thing you would want to work on. This could be travelling, photography or your side-project. It could just be watching movies, too. I think humans like having a routine and have at least one thing to dedicate themselves to.

2. Don't plan too many things. I wanted to get fit, learn to draw, write, read and in the end, I quickly ended up doing nothing.

3. I think we tend to chalk up lot of mental health issues to our work. I don't deny this could be a possibility, but if your work isn't insanely demanding, you don't need to quit your job to fix those issues.

4. If you're planning to work on your project, you need to ask yourself why you can't do it now. Even with most demanding jobs, dedicating some time to a side pursuit isn't a hard ask.

I do plan to take another one, but instead of quitting when I am frustrated as hell, I will do it when my creative spirit is high, and I am feeling more positive about my life.
Mechanical Turk is an artificial intelligence. Just not the kind you imagine. Besides, counting cars is hard, have a human do it.
> is the reverse of a black hole, which can be entered only from the outside and from which energy-matter, light and information cannot escape

In this context, what do they mean by "information" that is not covered by matter-energy, or light?