Threads for theblacklounge

  1. 1

    There are some extensions such as Typescript which addresses some of these issues at the cost of flexibility. But then again, we still have null exceptions. We have the option of ignoring error handling.

    I’ve read that TypeScript was originally null-unsafe, but the current language does a pretty good job of keeping NPEs at bay, unless you start abusing the “!” operator or turning off compiler safety flags.

    1. 3

      Even without the safeties turned off you can run into problems, TypeScript’s types aren’t enforced. You can say that an API returns an object with a certain type, but that doesn’t mean it’s what you got. In Elm you can only use a value from outside the runtime after you’ve parsed it.

      1. 2

        It’s certainly a tradeoff. On the one hand, you have TypeScript’s types as a contract. On the other, you have Elm’s moat, inside of which everything is 100% type safe but outside of which everything has to be either decoded (e.g. when fetching JSON over HTTP) or implemented as a web component (i.e. when you just want to build a little DOM/styling-heavy component).

        I personally prefer Elm overall, but I’ve found TypeScript to be adequately safe for my day job (3D graphics + ecommerce), particularly when using tools to import GraphQL or OpenAPI schemas as TypeScript types. If I were working on a web app for a bank or some other project with an extraordinarily low tolerance for runtime exceptions, I would push harder for Elm.

        1. 2

          A moat you can cross with a bridge and secure it with some guards, if only. Elm is a whole island, you need to build a port to get there.

    1. 3

      Also great writing regression tests, to check whether they fail before your fix.

      1. 2

        One other trick that can help reduce artefacts is try to generate a lower resolution image (256x256) and then run it through an upscaler several times.

        1. 2

          AUTOMATIC1111’s UI has a feature for this, bust still just using SD. Hi-res fix first generates at native resolution, then upscales (optionally even in latent space) and continues to add details with the prompt in mind.

        1. 2

          Paths are just ordered tags.

          On Windows, I mostly stopped using File Explorer and use this mindset with Voidtools Everything. Similar for the terminal, I only use CD when it autocompletes. I don’t navigate, I search and go.

          1. 8

            Modern CPUs and GPUs have hardware support for sin, cos and tan calculations. I wonder if trig functions that operate on turns rather than radians can really be faster if they aren’t using this hardware support. I guess it depends on the specific processor, and maybe also on which register you are operating on (since intel has different instruction sets for different size vector registers).

            If you are programming a GPU, you are generally using a high level API like Vulkan. Then you have the choice of using the SIN instruction that’s built into the SPIR-V instruction set, vs writing a turn-based sin library function using SPIR-V opcodes. I wouldn’t expect the latter to be faster. Maybe you could get some speed using a lookup table, but then you are creating memory traffic to access the table, which could slow down a shader that is already memory bound.

            1. 4

              A lot of code avoids using hardware sin and cos because they are notoriously slow and inaccurate. As such, it ends up using software emulated sin, cos, etc. So turns definitely shouldn’t be worse.

              Maybe this is changing, but historically on CPUs, using the sin instruction is not a great idea.

              1. 1

                I wonder if trig functions that operate on turns rather than radians can really be faster if they aren’t using this hardware support.

                CUDA has sincospif and sincosf, only the latter has its precision affected by –use_fast_math, so maybe all “builtin” functions still do the conversion to turns in code before accessing hardware?

                https://docs.nvidia.com/cuda/cuda-math-api/group__CUDA__MATH__SINGLE.html#group__CUDA__MATH__SINGLE_1g9456ff9df91a3874180d89a94b36fd46

              1. 2

                You can try it on playground. It’s insanely good. You can swap languages mid sentences and it will translate to English.

                1. 11

                  “non-destructive”? You have my attention.

                  I’ve been waiting a long while for GIMP to get non-destructive editing.

                  1. 1

                    Have you tried Krita?

                    1. 2

                      Yes, but it’s a bit of a different beast. More for art than image manipulation, it seemed.

                      1. 1

                        That’s the focus, but the image manipulation basis is better than GIMP. Some specialist features might be missing, but I wouldn’t know.

                  1. 43

                    Betteridge’s law of headlines strikes again.

                    1. 6

                      Not really, Betteridge’s Law is better applied to headlines like Will there every be a better VCS than Git?

                      By assuming the answer to the headline in question is the default “No”, you’re basically assuming Git will never be surpassed.

                      1. 3

                        That makes me sad. :-(

                        1. 18

                          Honestly I’m of the opinion that git’s underlying data model is actually pretty solid; it’s just the user interface that’s dogshit. Luckily that’s the easiest part to replace, and it doesn’t have any of the unfortunate network effect problems of changing systems altogether.

                          I’ve been using magit for a decade and a half; if magit (or any other alternate git frontends) had never existed, I would have dumped git ages ago, but … you don’t have to use the awful parts?

                          1. 16

                            Honestly I’m of the opinion that git’s underlying data model is actually pretty solid; it’s just the user interface that’s dogshit.

                            For what it’s worth, I do disagree, but not in a way relevant to this article. If we’re going to discuss Git’s data model, I’d love to discuss its inability to meaningfully track rebased/edited commits, the fact that heads are not version tracked in any meaningful capacity (yeah, you’ve got the reflog locally, but that’s it), that the data formats were standardized at once too early and too late (meaning that Git’s still struggling to improve its performance on the one hand, and that tools that work with Git have to constantly handle “invalid” repositories on the other), etc. But I absolutely, unquestionably agree that Git’s UI is the first 90% of the problem with Git—and I even agree that magit fixes a lot of those issues.

                            1. 4

                              The lack of ability to explicitly store file moves is also frustrating to me.

                              1. 3

                                Don’t forget that fixing capitalization errors with file names is a huge PITA on Mac.

                              2. 4

                                I’ve come to the conclusion that there’s something wrong with the data model in the sense that any practical use of Git with a team requires linearization of commit history to keep what’s changing when straight. I think a better data model would be able to keep track of the history branches and rebases. A squash or rebase should include some metadata that lets you get back the state before the rebase. In theory, you could just do a merge, but no one does that at scale because they make it too messy to keep track of what changed when.

                                1. 2

                                  I don’t think that’s a data model problem. It’s a human problem. Git can store a branching history just fine. It’s just much easier for people to read a linearized list of changes and operate on diffs on a single axis.

                                  1. 4

                                    Kind of semantic debate whether the problem is the data model per se or not, but the thing I want Git to do—show me a linear rebased history by default but have the ability to also show me the pre-flattened history and the branch names(!) involved—can’t be done by using Git as it is. In theory you could build what I want using Git as the engine and a new UI layer on top, but it wouldn’t be interoperable with other people’s use of Git.

                                    1. 3

                                      It already has a distinction between git log, git log --graph and git log --decorate (if you don’t delete branches that you care about seeing). And yeah, you can add other UIs on top.

                                      BTW: I never ever want my branch names immortalized in the history. I saw Mercurial do this, and that was the last time I’ve ever used it. IMHO people confuse having record of changes and ability to roll them back precisely with indiscriminately recording how the sausage has been made. These are close, but not the same.

                                      1. 3

                                        git merge –no-ff (imo the only correct merge for more than a single commit) does use the branch name, but the message is editable if your branch had a useless name

                                        1. 2

                                          None of those show squashes/rebases.

                                          1. 3

                                            They’re not supposed to! Squashing and amending are important tools for cleaning up unwanted history. This is a very important ability, because it allows committing often, even before each change is final, and then fixing it up into readable changes rather than “wip”, “wip”, “oops, typo”, “final”, “final 2”.

                                            1. 4

                                              What I’m saying is, I want Git for Git. I want the ability to get back history that Git gives me for files, for Git itself. Git instead lets you either have one messy history (with a bunch of octopus merges) or one clean history (with rebase/linearization). But I want a clean history that I can see the history of and find out about octopuses (octopi?) behind it.

                                2. 4

                                  No. The user interface is one of the best parts of Git, in that it reflects the internals quite transparently. The fundamental storage doesn’t model how people work: Git reasons entirely in terms of commits/snapshots, yet any view of these is 100% of the time presented as diffs.

                                  Git will never allow you to cherry-pick meaningfully, and you’ll always need dirty hacks like rerere to re-solve already-solved conflicts. Not because of porcelain (that would have been solved ten years ago), but because snapshots aren’t the right model for that particular problem.

                                  1. 2

                                    How many people do all their filesystem work with CLI tools these days? Why should we do it for a content-addressable filesystem with a builtin VCS?

                                    Never heard anyone complain that file managers abstract mv as “rename” either, why can’t git GUIs do the same in peace?

                                    1. 8

                                      How many people do all their filesystem work with CLI tools these days?

                                      At least one. But I also prefer cables on my headphones.

                                      1. 5

                                        Oh thank goodness, There’s two of us. I’m not alone!

                              1. 6

                                This is called “package by component” and it was how I was taught to write code and have done ever since. Generally I avoid packaging by syntax (all your types go here, all your classes go there, etc) However I do follow a vague DDD-like separation of transports, business logic and data store. These three feel like the simplest abstractions, no more and no less.

                                1. 3

                                  Probably because even though they can look like they’re very related and do often change together, files in different domains often don’t interact one to one. And if they do change together, it’s usually because a change in a whole other component required it.

                                1. 10

                                  I have mixed feelings about Tailwind.

                                  On one hand, I love it and use it in all my personal projects. I’m so productive with it, and it’s a real pleasure to use it.

                                  On the other hand, I will probably never suggest using it in a professional project. It’s too hard to defend it, and probably not worth the debate time.

                                  1. 10

                                    On the other hand, I will probably never suggest using it in a professional project. It’s too hard to defend it, and probably not worth the debate time.

                                    We started using it at work, and people that aren’t particularly front end developers end up loving it because of its productivity. That alone is worth it for the business case.

                                    1. 3

                                      Yes agreed. I have been using it in my LiveView app. But, when I explain it to my friend who is a front end developer he always just says, “but you can do all that with regular css and JavaScript (in relation to LiveView)”. And all I think is, “yes, but I don’t want to.”

                                      1. 1

                                        I hear you. I use it everywhere. I can’t suggest or even recommend it in a professional project—too many pieces of the puzzle for coherent UI are missing: the string-based nature of a styling system based entirely on classNames is hard to override in component trees and difficult to make type-safe

                                        Chakra-UI is pretty good and pretty similar to Tailwind at least as far as design tokens go, however I could not recommend Chakra because of their willingness to break compatibility with React 17 at the drop of a hat, with no warning or deprecation strategy, while React 18 was barely out of the oven.

                                        In my personal projects, my current approach is to build basic components with React-ARIA headless component library and styling them with Tailwind. It is really nice.

                                        1. 1

                                          I use the style attribute in my personal projects. For me, Tailwind does basically the same but with yet another syntax. If it gets more complex than what “style” can handle, it deserves a class name.

                                        1. 1

                                          Hopefully releasing the first beta of my first real browser extension, a query manager for scryfall mtg card search.

                                          1. 5

                                            I think I don’t understand the problem that DI is supposed to solve. I have a medium large service and the problem I have is that there are some mild dependency chains: A service depends on the HTTP client which depends on the logger, for example. It can be a little tricky to follow the initialization. I wish it were simpler. I think DI is supposed to help with this somehow, but I don’t see how DI would actually help. I would still have an annoyingly deep dependency chain, but instead of just being able to trace the function calls, it would all be hidden in a DI object. Why is that better than just having global state?

                                            1. 8

                                              DI makes dependencies explicit and enables you to swap them out. In practice this sort of flexibility isn’t really that frequently useful, with a major exception - unit tests. So I’d say the unequivocal benefit of DI is making testing easier.

                                              It’s also important to distinguish the concept of DI from DI frameworks. The idea of DI is quite simple - if object A needs to use object B, do so via some sort of dynamic reference that can be altered, instead of a global variable. This can be done by simply declaring B as a field of A, and that is in fact a very common way of doing DI in Go.

                                              When it comes to DI frameworks, my theory of their origin is that Java didn’t (and still doesn’t I suppose?) support named arguments, so when an object has more than (say) 3 dependencies, listing them in a constructor call becomes unreadable because you don’t know which object fulfills which dependency. So people invent this entire DI framework to make things more “readable” because at least it allows you to establish that relationship.

                                              Go doesn’t have named arguments either, but its struct syntax supports named fields. So either you’ll just construct the object using the struct syntax, like this (using the classical payment service example):

                                              ps := &PaymentService{CreditCardService: ccs, EmailService: es}
                                              

                                              Or define a struct that can be passed to a “constructor” function, like this:

                                              ps := NewPaymentService(
                                                &PaymentServiceDeps{CreditCardService: ccs, EmailService: es})
                                              

                                              This will scale to essentially an arbitrary number of dependencies - I’ve seen dependency list of 10 objects at work. You may have to pass over some of the dependency several times, which is annoying to write, but still reasonable readable. It’s not beautiful, but I find this to be much better than the unwarranted complexity of DI frameworks.

                                              1. 2

                                                DI makes dependencies explicit and enables you to swap them out.

                                                Right. The contrast here is to package level variables, which are not explicit and are harder to swap out. But just passing in the dependency as an argument is totally explicit and totally easy to swap out. So I again I don’t understand what a DI framework is buying. Explicitly wiring the dependencies makes understanding the code and swapping in mocks much easier at the cost of making it somewhat verbose to do the full production level initialization.

                                                1. 4

                                                  I think we are in the same camp. I don’t think DI frameworks are particularly useful in Go, it’s just a relic from Java.

                                              2. 2

                                                Echo what the peer comment said “it is a managed global state”. DI in a world of microservices doesn’t make much sense to me. But if you have a monolith, it can help provides a convention for how one component interact with another. You can absolutely do this as passing in a context or dependency object everywhere, and codify a convention.

                                                Some conventions it helps (I will take Dagger2 as an example):

                                                1. If component A needs to notify component B to do something, DI has convention for component B to register some kind of notifier or listener that component A can call to decouple the hard dependency between these two (which some times can be circular if done naively);
                                                2. DI helps to set convention on when you accessing provided dependency, whether that is created once lazily, or created upon start, or created every time when access;
                                                3. DI provides rich visualization tools help you to query / visualize dependencies one component needs at runtime.
                                                1. 1

                                                  It’s just a global state, but with DI it’s managed. Dependency chains are relatively easy to manage yourself, but at work we have a whole spider web. It’s a three headed server hosted in IIS, I don’t really know where calls come in for any of these so I wouldn’t know where to put the initialization of a new service. It’s so easy that the DI container does it for me.

                                                  1. 7

                                                    My usual take on DI frameworks is that they make everything much harder to debug in order to save a few tens of lines of code. You’re confirming the shit out of my biases here; I hope whoever is on call for this system drives a Ferrari.

                                                    1. 2

                                                      Idunno about Go, but my C# debugger passes through library code. It works fine. For our project I’d say a few ten thousands lines of code less, and making refactoring possible at all. Through DI we handle different types of lifetimes for the same classes, handle transactions, check privileges, and do easy mocking.

                                                      Don’t use DI if you don’t need it, and you probably don’t.

                                                    2. 1

                                                      Yes, and DI helps a lot when you need to build tests using mock.

                                                      1. 1

                                                        I don’t understand this. I mock my service that depends on an http.Client which depends on the logger by just passing it an http.Client that returns what I want it to return. Why do I need something fancy to mock it? Mocking is really easy in Go. It’s easier than wiring up the real dependencies because you don’t have to go any deeper.

                                                        1. 3

                                                          You have 3 services? That’s not a case for DI. Just did a quick count. We have 489 interfaces with many of those having 3 implementations, up to a few dozen, not counting testing. (holy shit btw, didn’t realize it was that many)

                                                          1. 1

                                                            I have about a dozen services, but none are more than three deep.

                                                  1. 41

                                                    The interface of Git and its underlying data models are two very different things, that are best treated separately.

                                                    The interface is pretty bad. If I wasn’t so used to it I would be fairly desperate for an alternative. I don’t care much for the staging area, I don’t like to have to clean up my working directory every time I need to switch branches, and I don’t like how easy it is to lose commit from a detached HEAD (though there’s always git reflog I guess).

                                                    The underlying data model however is pretty good. We can probably ditch the staging area, but apart from that, viewing the history of a repository as a directed graph of snapshots is nice. Captures everything we need. Sure patches have to be derived from those snapshots, but we care less about the patches than we care about the various versions we saved. If there’s one thing we need to get right, it’s those snapshots. You get reproducible builds & test from them, not from patches. So I think Patches are secondary. I used to love DARCS, but I think patch theory was probably the wrong choice.

                                                    Now one thing Git really really doesn’t like is large binary files. Especially if we keep changing them. But then that’s just a compression problem. Let the data model pretend there’s a blob for each version of that huge file, even though in fact the software is automatically compressing & decompressing things under the hood.

                                                    1. 62

                                                      What’s wrong with the staging area? I use it all the time to break big changes into multiple commits and smaller changes. I’d hate to see it removed just because a few people don’t find it useful.

                                                      1. 27

                                                        Absolutely, I would feel like I’m missing a limb without the staging area. I understand that it’s conceptually difficult at first, but imo it’s extremely worth the cost.

                                                        1. 7

                                                          Do you actually use it, or do you just do git commit -p, which only happens to use the staging area as an implementation detail?

                                                          And how do you test the code you’re committing? How do you make sure that the staged hunks aren’t missing another hunk that, for example, changes the signature the function you’re calling? It’s a serious slowdown in workflow to need to wait for CI rounds, stash and rebase to get a clean commit, and push again.

                                                          1. 25

                                                            Do you actually use it

                                                            Yes.

                                                            And how do you test the code you’re committing?

                                                            rebase with --exec

                                                            1. 12

                                                              I git add -p to the staging area and then diff it before generating the commit. I guess that could be done without a staging area using a different workflow but I don’t see the benefit (even if I have to check git status for the command every time I need to unstage something (-: )

                                                              As for testing, since I’m usually using Github I use the PR as the base unit that needs to pass a test (via squash merges, the horror I know). My commits within a branch often don’t pass tests; I use commits to break things up into sections of functionality for my own benefit going back later.

                                                              1. 7

                                                                Just to add on, the real place where the staging area shines is with git reset -p. You can reset part of a commit, amend the commit, and then create a new commit with your (original) changes or continue editing. The staging area becomes more useful the more you do commit surgery.

                                                                1. 2

                                                                  Meh, you don’t need a staging area for that (or anything). hg uncommit -i (for --interactive) does quite the same thing, and because it has no artificial staging/commit split it gets to use the clear verb.

                                                                2. 2

                                                                  I guess that could be done without a staging area using a different workflow but I don’t see the benefit

                                                                  I don’t see the cost.

                                                                  My commits within a branch often don’t pass tests;

                                                                  If you ever need to git bisect, you may come to regret that. I almost never use git bisect, but for the few times I did need it it was a life saver, and passing tests greatly facilitate it.

                                                                  1. 9

                                                                    I bisect every so often, but on the squashed PR commits on main, not individual commits within a PR branch. I’ve never needed to do that to diagnose a bug. If you have big PRs, don’t squash, or don’t use a PR-based workflow, that’s different of course. I agree with the general sentiment that all commits on main should pass tests for the purposes of bisection.

                                                                3. 3

                                                                  I use git gui for committing, (the built in git gui command) which let’s you pick by line not just hunks. Normally the things I’m excluding are stuff like enabling debug flags, or just extra logging, so it’s not really difficult to make sure it’s correct. Not saying I never push bad code, but I can’t recall an instance where I pushed bad code because of that so use the index to choose parts of my unfinished work to save in a stash (git stash –keep-index), and sometimes if I’m doing something risky and iterative I’ll periodically add things to the staging area as I go so I can have some way to get back to the last known good point without actually making a bunch of commits ( I could rebase after, yeah but meh).

                                                                  It being just an implementation detail in most of that is a fair point though.

                                                                  1. 2

                                                                    I personally run the regression test (which I wrote) to test changes.

                                                                    Then I have to wait for the code review (which in my experience has never stopped a bug going through; when I have found bugs, in code reviews, it was always “out of scope for the work, so don’t fix it”) before checking it in. I’m dreading the day when CI is actually implemented as it would slow down an already glacial process [1].

                                                                    Also, I should mention I don’t work on web stuff at all (thank God I got out of that industry).

                                                                    [1] Our customer is the Oligarchic Cell Phone Company, which has a sprint of years, not days or weeks, with veto power over when we deploy changes.

                                                                  2. 5

                                                                    Author of the Jujutsu VCS mentioned in the article here. I tried to document at https://github.com/martinvonz/jj/blob/main/docs/git-comparison.md#the-index why I think users don’t actually need the index as much as they think.

                                                                    I missed the staging area for at most a few weeks after I switched from Git to Mercurial many years ago. Now I miss Mercurial’s tools for splitting commits etc. much more whenever I use Git.

                                                                    1. 1

                                                                      Thanks for the write up. From what I read it seems like with Jujutsu if I have some WIP of which I want to commit half and continue experimenting with the other half I would need to commit it all across two commits. After that my continuing WIP would be split across two places: the second commit and the working file changes. Is that right? If so, is there any way to tag that WIP commit as do-not-push?

                                                                      1. 3

                                                                        Not quite. Every time you run a command, the working copy is snapshotted and becomes a real commit, amending the precis working-copy commit. The changes in the working copy are thus treated just like any other commit. The corresponding think to git commit -p is jj split, which creates two stacked commits from the previous working-copy commit, and the second commit (the child) is what you continue to edit in the working copy.

                                                                        Your follow-up question still applies (to both commits instead of the single commit you seemed to imagine). There’s not yet any way of marking the working copy as do-not-push. Maybe we’ll copy Mercurial’s “phase” concept, but we haven’t decided yet.

                                                                  3. 8

                                                                    Way I see it, the staging area is a piece of state needed specifically for a command line interface. I use it too, for the exact reason you do. But I could do the same by committing it directly. Compare the possible workflows. Currently we do:

                                                                    # most of the time
                                                                    git add .
                                                                    git commit
                                                                    
                                                                    # piecemeal
                                                                    git add -p .
                                                                    # review changes
                                                                    git commit
                                                                    

                                                                    Without a staging area, we could instead do that:

                                                                    # most of the time
                                                                    git commit
                                                                    
                                                                    # piecemeal
                                                                    git commit -p
                                                                    # review changes
                                                                    git reset HEAD~ # if the changes are no good
                                                                    

                                                                    And I’m not even talking about a possible GUI for the incremental making of several commits.

                                                                    1. 7

                                                                      Personally I use git add -p all of the time. I’ve simply been burned by the other way too many times. What I want is not to save commands but to have simple commands that work for me in every situation. I enjoy the patch selection phase. More often than not it is what triggers my memory of a TODO item I forgot to jot down, etc. The patch selection is the same as reviewing the diff I’m about to push but it lets me do it incrementally so that when I’m (inevitably) interrupted I don’t have to remember my place.

                                                                      From your example workflows it seems like you’re interested in avoiding multiple commands. Perhaps you could use git commit -a most of the time? Or maybe add a commit-all alias?

                                                                      1. 1

                                                                        Never got around to write that alias, and if I’m being honest I quite often git diff --cached to see what I’ve added before I actually commit it.

                                                                        I do need something that feels like a staging area. I was mostly wondering whether that staging area really needed to be implemented differently than an ordinary commit. Originally I believed commits were enough, until someone pointed out pre-commit hooks. Still, I wonder why the staging area isn’t at least a pointer to a tree object. It would have been more orthogonal, and likely require less effort to implement. I’m curious what Linus was thinking.

                                                                        1. 2

                                                                          Very honourable to revise your opinion in the face of new evidence, but I’m curious to know what would happen if you broadened the scope of your challenge with “and what workflow truly requires pre-commit hooks?”!

                                                                          1. 1

                                                                            Hmm, that’s a tough one. Strictly speaking, none. But I can see the benefits.

                                                                            Take Monocypher for instance: now it’s pretty stable, and though it is very easy for me to type make test every time I modify 3 characters, in practice I may want to make sure I don’t forget to do it before I commit anything. But even then there are 2 alternatives:

                                                                            • Running tests on the server (but it’s better suited to a PR model, and I’m almost the only committer).
                                                                            • Having a pre push hook. That way my local commits don’t need the hook, and I could go back to using the most recent one as a staging area.
                                                                        2. 1

                                                                          I use git add -p all the time, but only because Magit makes it so easy. If I had an equally easy interface to something like hg split or jj split, I don’t think I’d care about the lack of an index/staging area.

                                                                        3. 6

                                                                          # most of the time

                                                                          git add .

                                                                          Do you actually add your entire working directory most of the time? Unless I’ve just initialized a repository I essentially never do that.

                                                                          Here’s something I do do all the time, because my mind doesn’t work in a red-green-refactor way:

                                                                          Get a bug report

                                                                          Fix bug in foo_controller

                                                                          Once the bug is fixed, I finally understand it well enough to write an automated regression test around it, so go do that in foo_controller_spec

                                                                          Run test suite to ensure I didn’t break anything and that my new test is green

                                                                          Add foo_controller and foo_controller_spec to staging area

                                                                          Revert working copy (but not staged copy!) of foo_controller (but not it’s spec)

                                                                          Run test suite again and ensure I have exactly one red test (the new regression test). If yes, commit the stage.

                                                                          If no, debug spec against old controller until I understand why it’s not red, get it red, pull staged controller back to working area, make sure it’s green.

                                                                          Yeah, I could probably simulate this by committing halfway through and then doing some bullshit with cherry-picks from older commits and in some cases reverting the top commit but, like, why? What would I gain from limiting myself to just this awkward commit dance as the only way of working? That’s just leaving me to cobble together a workflow that’s had a powerful abstraction taken away from it, just to satisfy some dogmatic “the commit is the only abstraction I’m willing to allow” instinct.

                                                                          1. 4

                                                                            Do you actually add your entire working directory most of the time?

                                                                            Yes. And when I get a bug report, I tend to first reproduce the bug, then write a failing test, then fix the code.

                                                                            Revert working copy (but not staged copy!) of foo_controller (but not it’s spec)

                                                                            Sounds useful. How do you do that?

                                                                            1. 7

                                                                              Revert working copy (but not staged copy!) of foo_controller (but not it’s spec)

                                                                              Sounds useful. How do you do that?

                                                                              You can checkout a file into your working copy from any commit.

                                                                              1. 6

                                                                                Yes. And when I get a bug report, I tend to first reproduce the bug, then write a failing test, then fix the code.

                                                                                Right, but that was just one example. Everything in your working copy should always be committed at all times? I’m almost never in that state. Either I’ve got other edits in progress that I intend to form into later commits, or I’ve got edits on disk that I never intend to commit but in files that should not be git ignored (because I still intend to merge upstream changes into them).

                                                                                I always want to be intentionally forming every part of a commit, basically.

                                                                                Sounds useful. How do you do that?

                                                                                git add foo_controller <other files>; git restore -s HEAD foo_controller

                                                                                and then

                                                                                git restore foo_controller will copy the staged version back into the working set.

                                                                            2. 1

                                                                              TBH, I have no idea what “git add -p” does off hand (I use Magit), and I’ve never used staging like that.

                                                                              I had a great example use of staging come up just yesterday. I’m working in a feature branch, and we’ve given QA a build to test what we have so far. They found a bug with views, and it was an easy fix (we didn’t copy attributes over when copying a view).

                                                                              So I switched over to views.cpp and made the change. I built, tested that specific view change, and in Magit I staged that specific change in views.cpp. Then I commited, pushed it, and kicked off a pipeline build to give to QA.

                                                                              I also use staging all the time if I refactor while working on new code or fixing bugs. Say I’m working on “foo()”, but while doing so I refactor “bar()” and “baz()”. With staging, I can isolate the changes to “bar()” and “baz()” in their own commits, which is handy for debugging later, giving the changes to other people without pulling in all of my changes, etc.

                                                                              Overall, it’s trivial to ignore staging if you don’t want it, but it would be a lot of work to simulate it if it weren’t a feature.

                                                                            3. 6

                                                                              What’s wrong with the staging area? I use it all the time to break big changes into multiple commits and smaller changes.

                                                                              I’m sure you do – that’s how it was meant to be used. But you might as well use commits as the staging area – it’s easy to commit and squash. This has the benefit that you can work with your whole commit stack at the same time. I don’t know what problem the staging area solves that isn’t better solved with commits. And yet, the mere existence of this unnecessary feature – this implicitly modified invisible state that comes and crashes your next commit – adds cognitive load: Commands like git mv, git rm and git checkout pollutes the state, then git diff hides it, and finally, git commit --amend accidentally invites it into the topmost commit.

                                                                              The combo of being not useful and a constant stumbling block makes it bad.

                                                                              1. 3

                                                                                I don’t know what problem the staging area solves that isn’t better solved with commits.

                                                                                If I’ve committed too much work in a single commit how would I use commits to split that commit into two commits?

                                                                                1. 4

                                                                                  Using e.g. hg split or jj split. The former has a text-based interface similar to git commit -p as well as a curses-based TUI. The latter lets you use e.g. Meld or vimdiff to edit the diff in a temporary directory and then rewrites the commit and all descendants when you’re done.

                                                                                  1. 3

                                                                                    That temporary directory sounds a lot like the index – a temporary place where changes to the working copy can be batched. Am I right to infer here that the benefit you find in having a second working copy in a temp directory because it works better with some other tools that expect to work files?

                                                                                    1. 1

                                                                                      The temporary directory is much more temporary than the index - it only exists while you split the commit. For example, if you’re splitting a commit that modifies 5 files, then the temporary directory will have only 2*5 files (for before and after). Does that clarify?

                                                                                      The same solution for selecting part of the changes in a commit is used by jj amend -i (move into parent of specified commit, from working-copy commit by default), jj move -i --from <rev> --to <rev> (move changes between arbitrary commits) etc.

                                                                                  2. 2

                                                                                    I use git revise. Interactive revise is just like interactive rebase, except that it has is a cut subcommand. This can be used to split a commit by selecting and editing hunks like git commit -p.

                                                                                    Before git-revise, I used to manually undo part of the commit, commit that, then revert it, and then sqash the undo-commit into the commit to be split. The revert-commit then contains the split-off changes.

                                                                                  3. 3

                                                                                    I don’t know, I find it useful. Maybe if git built in mercurials “place changes into commit that isn’t the most recent” amend thing then I might have an easier time doing things but just staging up relevant changes in a patch-based flow is pretty straightforward and helpful IMO

                                                                                    I wonder if this would be as controversial if patching was the default

                                                                                  4. 6

                                                                                    What purpose does it serve that wouldn’t also be served by first-class rollback and an easier way of collapsing changesets on their way upstream? I find that most of the benefits of smaller changesets disappear when they don’t have commit messages, and when using the staging area for this you can only rollback one step without having to get into the hairy parts of git.

                                                                                    1. 3

                                                                                      The staging area is difficult to work with until you understand what’s happening under the hood. In most version control systems, an object under version control would be in one of a handful of states: either the object has been cataloged and stored in its current state, or it hasn’t. From a DWIM standpoint for a new git user, would catalog and store the object in its current state. With the stage, you can stage, and change, stage again, and change again. I’ve used this myself to logically group commits so I agree with you that it’s useful. But I do see how it breaks peoples DWIM view on how git works.

                                                                                      Also, If I stage, and then change, is there a way to have git restore the file as I staged it if I haven’t committed?

                                                                                      1. 7

                                                                                        Also, If I stage, and then change, is there a way to have git restore the file as I staged it if I haven’t committed?

                                                                                        Git restore .

                                                                                        1. 3

                                                                                          I’ve implemented git from scratch. I still find the staging area difficult to use effectively in practice.

                                                                                        2. 1

                                                                                          Try testing your staged changes atomically before you commit. You can’t.

                                                                                          A better design would have been an easy way to unstage, similar to git stash but with range support.

                                                                                          1. 5

                                                                                            You mean git stash --keep-index?

                                                                                            1. 3

                                                                                              Interesting, that would solve the problem. I’m surprised I’ve not come across that before.

                                                                                              In terms of “what’s wrong with the staging area”, what I was suggesting would work better is to have the whole thing work in reverse. So all untracked files are “staged” by default and you would explicitly un-stage anything you don’t want to commit. Firstly this works better for the 90% use-case, and compared to this workaround it’s a single step rather than 2 steps for the 10% case where you don’t want to commit all your changes yet.

                                                                                              The fundamental problem with the staging area is that it’s an additional, hidden state that the final committed state has to pass through. But that means that your commits do not necessarily represent a state that the filesystem was previously in, which is supposed to be a fundamental guarantee. The fact that you have to explicitly stash anything to put the staging area into a knowable state is a bit of a hack. It solves a problem that shouldn’t exist.

                                                                                              1. 2

                                                                                                The way I was taught this, the way I’ve taught this to others, and the way it’s represented in at least some guis is not compatible.

                                                                                                I mean, sure, you can have staged and unstaged changes in a file and need to figure it out for testing, or unstage parts, but mostly it’s edit -> stage -> commit -> push.

                                                                                                That feels, to me and to newbies who barely know what version control is, like a logical additive flow. Tons of cases you stage everything and commit so it’s a very small operation.

                                                                                                The biggest gripe may be devs who forget to add files in the proper commit, which makes bisect hard. Your case may solve that for sure, but I find it a special case of bad guis and sloppy devs who do that. Also at some point the fs layout gets fewer new files.

                                                                                                1. 2

                                                                                                  Except that in a completely linear flow the distinction between edit and stage serves no purpose. At best it creates an extra step for no reason and at worst it is confusing and/or dangerous to anyone who doesn’t fully understand the state their working copy is in. You can bypass the middle state with git add .; git commit and a lot of new developers do exactly that, but all that does is pretend the staging state doesn’t exist.

                                                                                                  Staging would serve a purpose if it meant something similar to pushing a branch to CI before a merge, where you have isolated the branch state and can be assured that it has passed all required tests before it goes anywhere permanent. But the staging area actually does the opposite of that, by creating a hidden state that cannot be tested directly.

                                                                                                  As you say, all it takes is one mistake and you end up with a bad commit that breaks bisect later. That’s not just a problem of developers being forgetful, it’s the bad design of the staging area that makes this likely to happen by default.

                                                                                                  1. 1

                                                                                                    I think I sort of agree but do not completely concur.

                                                                                                    Glossing over the staging can be fine in some projects and dev sloppiness is IMO a bigger problem than an additive flow for clean commits.

                                                                                                    These are societal per-project issues - what’s the practice or policy or mandate - and thus they could be upheld by anything, even using the undo buffer for clean commits like back in the day. Which isn’t to say you never gotta do trickery like that with Git, just that it’s a flow that feels natural and undo trickery less common.

                                                                                                    Skimming the other comments, maybe jj is more like your suggestion, and I wouldn’t mind “a better Git”, but I can’t be bothered when eg. gitless iirc dropped the staging and would make clean commits feel like 2003.

                                                                                            2. 2

                                                                                              If git stash --keep-index doesn’t do what you want the you could help further the conversation by elaborating on what you want.

                                                                                              1. 1
                                                                                            3. 16

                                                                                              The underlying data model however is pretty good. We can probably ditch the staging area,

                                                                                              Absolutely not. The staging area was a godsend coming from Subversion – it’s my favorite part of git bar none.

                                                                                              1. 4

                                                                                                Everyone seem to suppose I would like to ditch the workflows enabled by the staging area. I really don’t. I’m quite sure there ways to keep those workflows without using a staging area. If there aren’t well… I can always admit I was wrong.

                                                                                                1. 9

                                                                                                  Well, what I prize being able to do is to build up a commit piecemeal out of some but not all of the changes in my working directory, in an incremental rather than all-in-one-go fashion (ie. I should be able to form the commit over time and I should be able to modify a file, move it’s state into the “pending commit” and continue to modify the file further without impacting the pending commit). It must be possible for any commit coming out of this workflow to both not contain everything in my working area, and to contain things no longer in my working area. It must be possible to diff my working area against the pending commit and against the last actual commit (separately), and to diff the pending commit against the last actual commit.

                                                                                                  You could call it something else if you wanted but a rose by any other name etc. A “staging area” is a supremely natural metaphor for what I want to work with in my workflow, so replacing it hardly seems desirable to me.

                                                                                                  1. 2

                                                                                                    How about making the pending commit an actual commit? And then adding the porcelain necessary to treat it like a staging area? Stuff like git commit -p foo if you want to add changes piecemeal.

                                                                                                    1. 11

                                                                                                      No. That’s cool too and is what tools like git revise and git absorb enable, but making it an actual commit would have other drawbacks: it would imply it has a commit message and passes pre-commit hooks and things like that. The staging area is useful precisely for what it does now—help you build up the pieces necessary to make a commit. As such it implies you don’t have everything together to make a commit out of it. As soon as I do I commit, then if necessary --ammend, --edit, or git revise later. If you don’t make use of workflows that use staging then feel free to use tooling that bypasses it for you, but don’t try to take it away from the rest of us.

                                                                                                      1. 9

                                                                                                        pre-commit hooks

                                                                                                        Oh, totally missed that one. Probably because I’ve never used it (instead i rely on CI or manually pushing a button). Still, that’s the strongest argument so far, and I have no good solution that doesn’t involve an actual staging area there. I guess it’s time to change my mind.

                                                                                                        1. 2

                                                                                                          I think the final word is not said. These tools could also run hooks. It may be that new hooks need to be defined.

                                                                                                          Here is one feature request: run git hooks on new commit

                                                                                                          1. 1

                                                                                                            I think you missed the point, my argument is that the staging area is useful as a place to stage stuff before things like commit related hooks get run. I don’t want tools like git revise to run precommit hooks. When I use git revise the commit has already been made and presumably passed precommit phase.

                                                                                                            1. 1

                                                                                                              For the problem that git revise “bypasses” the commit hook when using it to split a commit, I meant the commit hook (not precommit hook).

                                                                                                              I get that the staging area lets you assemble a commit before you can run the commit hook. But if this was possible to do statelessly (which would only be an improvement), you could do without it. And for other reasons, git would be so much better without this footgun:

                                                                                                              Normally, you can look at git diff and commit what you see with git commit -a. But if the staging area is clobbered, which you might have forgot, you also have invisible state that sneaks in!

                                                                                                              1. 1

                                                                                                                Normally, you can look at git diff and commit what you see with git commit -a.

                                                                                                                Normally I do nothing of the kind. I might have used git commit -a a couple times in the last 5 years (and I make dozens to hundreds of commits per day). The stattefullness of the staging area is exactly what benefits my workflow and not the part I would be trying to eliminate. The majority of the time I stage things I’m working on from my editor one hunk at a time. The difference between my current buffer and the last git commit is highlighted and after I make some progress I start adding related hunks and shaping them into commits. I might fiddle around with a couple things in the current file, then when I like it stage up pieces into a couple different commits.

                                                                                                                The most aggressive I’d get is occasionally (once a month?) coming up with a use for git commit -u.

                                                                                                                A stateless version of staging that “lets you assemble a commit” sounds like an oxymoron to me. I have no idea what you think that would even look like, but a state that is neither the full contents of the current file system nor yet a commit is exactly what I want.

                                                                                                          2. 1

                                                                                                            Why not allow an empty commit message, and skip the commit hooks if a message hasn’t been set yet?

                                                                                                            1. 1

                                                                                                              Why deliberately make a mess of things? Why make a discreet concept of a “commit” into something else with multiple possible states? Why not just use staging like it is now? I see no benefit to jurry rigging more states on top of a working one. If the point is to simplify the tooling you won’t get there by overloading one clean concept with an indefinite state and contextual markers like “if commit message empty then this is not a real commit”.

                                                                                                              1. 1

                                                                                                                Empty commit message is how you abort a commit

                                                                                                                1. 1

                                                                                                                  With the current UI.

                                                                                                                  When discussing changes, there’s the possibility of things changing.

                                                                                                            2. 5

                                                                                                              Again, what’s the benefit?

                                                                                                              Sure, you could awkwardly simulate a staging area like this. The porcelain would have to juggle a whole bunch of shit to avoid breaking anytime you merge a bunch of changes after adding something to the fake “stage”, pull in 300 new commits, and then decide you want to unstage something, so the replacement of the dedicated abstraction seems likely to leak and introduce merge conflict resolution where you didn’t previously have to worry about it, but maybe with enough magic you could do it.

                                                                                                              But what’s the point? To me it’s like saying that I could awkwardly simulate if, while and for with goto, or simulate basically everything with enough NANDs. You’re not wrong, but what’s in it for me? Why am I supposed to like this any better than having a variety of fit-for-purpose abstractions? It just feels like I’d be tying one hand behind my back so there can be one less abstraction, without explain why having N-1 abstractions is even more desirable than having N.

                                                                                                              Seems like an “a foolish consistency is the hobgoblin of little minds” desire than anything beneficial, really.

                                                                                                              1. 1

                                                                                                                Again, what’s the benefit?

                                                                                                                Simplicity of implementation. Implementing the staging area like a commit, or at least like a pointer to a tree object, would likely make the underlying data model simpler. I wonder why the staging area was implemented the way it is.

                                                                                                                At the interface level however I’ve had to change my mind because of pre-commit hooks. When all you have is commits, and some tests are automatically launched every time you commit anything, it’s pretty hard to add stuff piecemeal.

                                                                                                                1. 3

                                                                                                                  Yes, simplicity of implementation and UI. https://github.com/martinvonz/jj (mentioned in the article) makes the working copy (not the staging area) an actual commit. That does make the implementation quite a lot simpler. You also get backups of the working copy that way.

                                                                                                                  1. 1

                                                                                                                    Simplicity of implementation.

                                                                                                                    No offence but, why would I give a shit about this? git is a tool I use to enable me to get other work done, it’s not something I’m reimplementing. If “making the implementation simpler” means my day-to-day workflows get materially more unpleasant, the simplicity of the implementation can take a long walk off a short pier for all I care.

                                                                                                                    It’s not just pre-commit hooks that get materially worse with this. “Staging” something would then have to have a commit message, I would effectively have to branch off of head before doing every single “staging” commit in order to be able to still merge another branch and then rebase it back on top of everything without fucking about in the reflog to move my now-burried-in-the-past stage commit forward, etc, etc. “It would make the implementation simpler” would be a really poor excuse for a user hostile change.

                                                                                                                    1. 3

                                                                                                                      If “making the implementation simpler” means my day-to-day workflows get materially more unpleasant, the simplicity of the implementation can take a long walk off a short pier for all I care.

                                                                                                                      I agree. Users shouldn’t have to care about the implementation (except for minor effects like a simpler implementation resulting in fewer bugs). But I don’t understand why your workflows would be materially more unpleasant. I think they would actually be more pleasant. Mercurial users very rarely miss the staging area. I was a git developer (mostly working on git rebase) a long time ago, so I consider myself a (former) git power user. I never miss the staging area when I use Mercurial.

                                                                                                                      “Staging” something would then have to have a commit message

                                                                                                                      Why? I think the topic of this thread is about what can be done differently, so why would the new tool require a commit message? I agree that it’s useful if the tool lets you provide a message, but I don’t think it needs to be required.

                                                                                                                      I would effectively have to branch off of head before doing every single “staging” commit in order to be able to still merge another branch and then rebase it back on top of everything without fucking about in the reflog to move my now-burried-in-the-past stage commit forward

                                                                                                                      I don’t follow. Are you saying you’re currently doing the following?

                                                                                                                      git add -p
                                                                                                                      git merge <another branch>
                                                                                                                      git rebase <another branch>
                                                                                                                      

                                                                                                                      I don’t see why the new tool would bury the staging commit in the past. That’s not what happens with Jujutsu/jj anyway. Since the working copy is just like any other commit there, you can simply merge the other branch with it and then rebase the whole stack onto the other branch after.

                                                                                                                      I’ve tried to explain a bit about this at https://github.com/martinvonz/jj/blob/main/docs/git-comparison.md#the-index. Does that help clarify?

                                                                                                                      1. 1

                                                                                                                        Mercurial users very rarely miss the staging area.

                                                                                                                        Well, I’m not them. As somebody who was forced to use Mercurial for a bit and hated every second of it, I missed the hell out of it, personally (and if memory serves, there was later at least one inevitably-nonstandard Mercurial plugin to paper over this weakness, so I don’t think I was the only person missing it).

                                                                                                                        I’ve talked about my workflow elsewhere in this thread, I’m not really interested in rehashing it, but suffice to say I lean on the index for all kinds of things.

                                                                                                                        Are you saying you’re currently doing the following? git add -p git merge

                                                                                                                        I’m saying that any number of times I start putting together a commit by staging things on Friday afternoon, come back on Monday, pull in latest from main, and continue working on forming a commit.

                                                                                                                        If I had to (manually, we’re discussing among other things the assertion that you could eliminate the stage because it’s pointless, and you could “just” commit whenever you want to stage and revert the commit whenever they want to unstage ) commit things on Friday, forget I’d done so on Monday, pull in 300 commits from main, and then whoops I want to revert a commit 301 commits back so now I get to back out the merge and etc etc, this is all just a giant pain in the ass to even type out.

                                                                                                                        Does that help clarify?

                                                                                                                        I’m honestly not interested in reading it, or in what “Jujutsu” does, as I’m really happy with git and totally uninterested in replacing it. All I was discussing in this thread with Loup-Vaillant was the usefulness of the stage as an abstraction and my disinterest in seeing it removed under an attitude of “well you could just manually make commits when you would want to stage things, instead”.

                                                                                                                        1. 2

                                                                                                                          I’m honestly not interested in reading it, or in what “Jujutsu” does

                                                                                                                          Too bad, this link you’re refusing to read is highly relevant to this thread. Here’s a teaser:

                                                                                                                          As a Git power-user, you may think that you need the power of the index to commit only part of the working copy. However, Jujutsu provides commands for more directly achieving most use cases you’re used to using Git’s index for.

                                                                                                                          1. 0

                                                                                                                            What “jujutsu” does under the hood has nothing whatsoever to do with this asinine claim of yours, which is the scenario I was objecting to: https://lobste.rs/s/yi97jn/is_it_time_look_past_git#c_k6w2ut

                                                                                                                            At this point I’ve had enough of you showing up in my inbox with these poorly informed, bad faith responses. Enough.

                                                                                                                            1. 1

                                                                                                                              I was claiming that the workflows we have with the staging area, we could achieve without. And Jujutsu here has ways to do exactly that. It has everything to do with the scenario you were objecting to.

                                                                                                                              Also, this page (and what I cited specifically) is not about what jujutsu does under the hood, it’s about its user interface.

                                                                                                                              1. 1

                                                                                                                                I’ve made it clear that I’m tired of interacting with you. Enough already.

                                                                                                                      2. 1

                                                                                                                        No offence but, why would I give a shit about [simplicity of implementation]?

                                                                                                                        It’s because people don’t give a shit that we have bloated (and often slow) software.

                                                                                                                        1. 0

                                                                                                                          And it’s because of developers with their heads stuck so far up their asses that they prioritize their implementation simplicity over the user experience that so much software is actively user-hostile.

                                                                                                                          Let’s end this little interaction here, shall we.

                                                                                                          3. 15

                                                                                                            Sublime Merge is the ideal git client for me. It doesn’t pretend it’s not git like all other GUI clients I’ve used so you don’t have to learn something new and you don’t unlearn git. It uses simple git commands and shows them to you. Most of git’s day-to-day problems go away if you can just see what you’re doing (including what you’ve mentioned).

                                                                                                            CLI doesn’t cut it for projects of today’s size. A new git won’t fix that. The state of a repository doesn’t fit in a terminal and it doesn’t fit in my brain. Sublime Merge shows it just right.

                                                                                                            1. 5

                                                                                                              I like GitUp for the same reasons. Just let me see what I’m doing… and Undo! Since it’s free, it’s easy to get coworkers to try it.

                                                                                                              1. 4

                                                                                                                I didn’t know about GitUp but I have become a big fan of gitui as of late.

                                                                                                                1. 2

                                                                                                                  I’ll check that out, thank you!

                                                                                                              2. 2

                                                                                                                I use Fork for the same purpose and the staging area has never been a problem since it is visible and diffable at any time, and that’s how you compose your commits.

                                                                                                              3. 6

                                                                                                                See Game of Trees for an alternative to the git tool that interacts with normal git repositories.

                                                                                                                Have to agree with others about the value of the staging area though! It’s the One Big Thing I missed while using Mercurial.

                                                                                                                1. 5

                                                                                                                  Well, on the one hand people could long for a better way to store the conflict resolutions to reuse them better on future merges.

                                                                                                                  On the other hand, of all approaches to DAG-of-commits, Git’s model is plain worse than the older/parallel ones. Git is basically intended to lose valuable information about intent. The original target branch of the commit often tells as much as the commit message… but it is only available in reflog… auto-GCed and impossible to sync.

                                                                                                                  1. 10

                                                                                                                    Half of my branches are called werwerdsdffsd. I absolutely don’t want them permanently burned in the history. These scars from work-in-progress annoyed me in Mercurial.

                                                                                                                    1. 9

                                                                                                                      Honestly I have completely the opposite feeling. Back in the days before git crushed the world, I used Mercurial quite a lot and I liked that Mercurial had both the ephemeral “throw away after use” model (bookmarks) and the permanent-part-of-your-repository-history model (branches). They serve different purposes, and both are useful and important to have. Git only has one and mostly likes to pretend that the other is awful and horrible and nobody should ever want it, but any long-lived project is going to end up with major refactoring or rewrites or big integrations that they’ll want to keep some kind of “here’s how we did it” record to easily point to, and that’s precisely where the heavyweight branch shines.

                                                                                                                      And apparently I wrote this same argument in more detail around 12 years ago.

                                                                                                                      1. 1

                                                                                                                        ffs_please_stop_refactoring_and_review_this_pr8

                                                                                                                      2. 2

                                                                                                                        This is a very good point. It would be interesting to tag and attach information to a group of related commits. I’m curious of the linux kernel workflows. If everything is an emailed patch, maybe features are done one commit at a time.

                                                                                                                        1. 2

                                                                                                                          If you go further, there are many directions to extend what you can store and query in the repository! And of course they are useful. But even the data Git forces you to have (unlike, by the way, many other DVCSes where if you do not want a meaningful name you can just have multiple heads in parallel inside a branch) could be used better.

                                                                                                                        2. 2

                                                                                                                          I can’t imagine a scenario where the original branch point of a feature would ever matter, but I am constantly sifting through untidy merge histories that obscure the intent.

                                                                                                                          Tending to your commit history with intentionality communicates to reviewers what is important, and removes what isn’t.

                                                                                                                          1. 1

                                                                                                                            It is not about the point a branch started from. It is about which of the recurring branches the commit was in. Was it in quick-fix-train branch or in update-major-dependency-X branch?

                                                                                                                            1. 2

                                                                                                                              The reason why this isn’t common is because of GitHub more than Git. They don’t provide a way to use merge commits that isn’t a nightmare.

                                                                                                                              When I was release managing by hand, my preferred approach was rebasing the branch off HEAD but retaining the merge commit, so that the branch commits were visually grouped together and the branch name was retained in the history. Git can do this easily.

                                                                                                                        3. 5

                                                                                                                          I never understood the hate for Git’s CLI. You can learn 99% of what you need to know on a daily basis in a few hours. That’s not a bad time investment for a pivotal tool that you use multiple times every day. I don’t expect a daily driver tool to be intuitive, I expect it to be rock-solid, predictable, and powerful.

                                                                                                                          1. 9

                                                                                                                            This is a false dichotomy: it can be both (as Mercurial is). Moreover, while it’s true that you can learn the basics to get by with in a few hours, it causes constant low-level mental overhead to remember how different commands interact, what the flag is in this command vs. that command, etc.—and never mind that the man pages are all written for people thinking in terms of the internals, instead of for general users. (That this is a common failing of man pages does not make it any less a problem for git!)

                                                                                                                            One way of saying it: git has effectively zero progressive disclosure of complexity. That makes it a continual source of paper cuts at minimum unless you’ve managed to actually fully internalize not only a correct mental model for it but in many cases the actual implementation mechanics on which it works.

                                                                                                                            1. 3

                                                                                                                              Its manpages are worthy of a parody: https://git-man-page-generator.lokaltog.net

                                                                                                                            2. 2

                                                                                                                              Its predecessors CVS and svn had much more intuitive commands (even if they were was clumsy to use in other ways). DARCS has been mentioned many times as being much more easy to use as well. People migrating from those tools really had a hard time, especially because git changed the meanings of some commands, like checkout.

                                                                                                                              Then there were some other tools that came up around the same time or shortly after git but didn’t get the popularity of git like hg and bzr, which were much more pleasant to use as well.

                                                                                                                              1. 2

                                                                                                                                I think the issues people have are less about the CLI itself and more about how it interfaces with the (for some developers) complex and hard to understand concepts at hand.

                                                                                                                                Take rebase for example. Once you grok what it is, it’s easy, but trying to explain the concept of replaying commits on top of others to someone used to old school tools like CVS or Subversion can be a challenge, especially when they REALLY DEEPLY don’t care and see this as an impediment to getting their work done.

                                                                                                                                I’m a former release engineer, so I see the value in the magic Git brings to the table, but it can be a harder sell for some :)

                                                                                                                              2. 5

                                                                                                                                The interface is pretty bad.

                                                                                                                                I would argue that this is one of the main reasons for git’s success. The CLI is so bad that people were motivated to look for tools to avoid using it. Some of them were motivated to write tools to avoid using it. There’s a much richer set of local GUI and web tools than I’ve seen for any other revision control system and this was true even when git was still quite new.

                                                                                                                                I never used a GUI with CVS or Subversion, but I wanted to as soon as I started touching the git command line. I wanted features like PRs and web-based code review, because I didn’t want to merge things locally. I’ve subsequently learned a lot about how to use the git CLI and tend to use it for a lot of tasks. If it had been as good as, say, Mercurial’s from the start then I never would have adopted things like gitx / gitg and GitHub and it’s those things that make the git ecosystem a pleasant place to be.

                                                                                                                                1. 4

                                                                                                                                  The interface of Git and its underlying data models are two very different things, that are best treated separately.

                                                                                                                                  Yes a thousand times this! :) Git’s data model has been a quantum leap for people who need to manage source code at scale. Speaking as a former release engineer, I used to be the poor schmoe who used to have to conduct Merge Day, where a branch gets merged back to main.

                                                                                                                                  There was exactly one thing you could always guarantee about merge day: There Will Be Blood.

                                                                                                                                  So let’s talk about looking past git’s god awful interface, but keep the amazing nubbins intact and doing the nearly miraculous work they do so well :)

                                                                                                                                  And I don’t just mean throwing a GUI on top either. Let’s rethink the platonic ideal for how developers would want their workflow to look in 2022. Focus on the common case. Let the ascetics floating on a cloud of pure intellect script their perfect custom solutions, but make life better for the “cold dark matter” developers which are legion.

                                                                                                                                  1. 2

                                                                                                                                    I would say that you simultaneously give credit where it is not due (there were multiple DVCSes before Git, and approximately every one had a better data model, and then there are things that Subversion still has better than everyone else, somehow), and ignore the part that actually made your life easier — the efforts of pushing Git down people’s throat, done by Linus Torvalds, spending orders of magnitude more of his time on this than on getting things right beyond basic workability in Git.

                                                                                                                                    1. 1

                                                                                                                                      Not a DVCS expert here, so would you please consider enlightening me? Which earlier DVCS were forgotten?

                                                                                                                                      My impressions of Mercurial and Bazaar are that they were SL-O-O-W, but they’re just anecdotal impressions.

                                                                                                                                      1. 3

                                                                                                                                        Well, Bazaar is technically earlies. Monotone is significantly earlier. Monotone has quite interesting and nicely decoupled data model where the commit DAG is just one thing; changelog, author — and branches get the same treatment — are not parts of a commit, but separately stored claims about a commit, and this claim system is extensible and queriable. And of course Git was about Linus Torvalds speedrunning implementation of the parts of BitKeeper he really really needed.

                                                                                                                                        It might be that in the old days running on Python limited speed of both Mercurial and Bazaar. Rumour has it that the Monotone version Torvalds found too slow was indeed a performance regression (they had one particularly slow release at around that time; Monotone is not in Python)

                                                                                                                                        Note that one part of things making Git fast is that enables some optimisations that systems like Monotone make optional (it is quite optimistic about how quickly you can decide that the file must not have been modified, for example). Another is that it was originally only intended to be FS-safe on ext3… and then everyone forgot to care, so now it is quite likely to break the repository in case of unclean shutdown mid-operation. Yes, I have damaged repositories that way to a state where I could not find advice on how to avoid re-cloning to get even partially working repository.

                                                                                                                                        As of Subversion, it has narrow checkouts which are a great feature, and DVCSes could also have them, but I don’t think anyone properly has them. You kind of can hack something with remote-automate in Monotone, but probably flakily.

                                                                                                                                  2. 4

                                                                                                                                    Let the data model pretend there’s a blob for each version of that huge file, even though in fact the software is automatically compressing & decompressing things under the hood.

                                                                                                                                    Ironically, that’s part of the performance problem – compressing the packfiles tends to be where things hurt.

                                                                                                                                    Still, this is definitely a solvable problem.

                                                                                                                                    1. 2

                                                                                                                                      I used to love DARCS, but I think patch theory was probably the wrong choice.

                                                                                                                                      I have created and maintains official test suite for pijul, i am the happiest user ever.

                                                                                                                                      1. 2

                                                                                                                                        Hmm, knowing you I’m sure you’ve tested it to death.

                                                                                                                                        I guess they got rid of the exponential conflict resolution that plagued DARCS? If so perhaps I should give patch theory another go. Git ended up winning the war before I got around to actually study patch theory, maybe it is sounder than I thought.

                                                                                                                                        1. 1

                                                                                                                                          Pijul is a completely different thing than Darcs, the current state of a repository in Pijul is actually a special instance of a CRDT, which is exactly what you want for a version control system.

                                                                                                                                          Git is also a CRDT, but HEAD isn’t (unlike in Pijul), the CRDT in Git is the entire history, and that is not a very useful property.

                                                                                                                                        2. 1

                                                                                                                                          Best test suite ever. Thanks again, and again, and again for that. It also helped debug Sanakirja, a database engine used as the foundation of Pijul, but usable in other contexts.

                                                                                                                                        3. 2

                                                                                                                                          There are git-compatible alternatives that keep the underlying model and change the interface. The most prominent of these is probably gitless.

                                                                                                                                          1. 1

                                                                                                                                            I’ve been using git entirely via UI because of that. Much better overview, much more intuitive, less unwanted side effects.

                                                                                                                                            1. 1

                                                                                                                                              You can’t describe Git without discussing rebase and merge: these are the two most common operations in Git, yet they don’t satisfy any interesting mathematical property such as associativity or symmetry:

                                                                                                                                              • Associativity is when you want to merge your commits one by one from a remote branch. This should intuitively be the same as merging the remote HEAD, but Git manages to make it different sometimes. When that happens, your lines can be shuffled around more or less randomly.

                                                                                                                                              • Symmetry means that merging A and B is the same as merging B and A. Two coauthors doing the same conflictless merge might end up with different results. This is one of the main benefits of GitHub: merges are never done concurrently when you use a central server.

                                                                                                                                              1. 1

                                                                                                                                                Well, at least this is not the fault of the data model: if you have all the snapshots, you can deduce all the patches. It’s the operations themselves that need fixing.

                                                                                                                                                1. 1

                                                                                                                                                  My point is that this is a common misconception: no datastructure is ever relevant without considering the common operations we want to run on it.

                                                                                                                                                  For Git repos, you can deduce all the patches indeed, but merge and rebase can’t be fixed while keeping a reasonable performance, since the merge problem Git tries to solve is the wrong one (“merge the HEADs, knowing their youngest common ancestor”). That problem cannot have enough information to satisfy basic intuitive properties.

                                                                                                                                                  The only way to fix it is to fetch the entire sequence of commits from the common ancestor. This is certainly doable in Git, but merges become O(n) in time complexity, where n is the size of history.

                                                                                                                                                  The good news is, this is possible. The price to pay is a slightly more complex datastructure, slightly harder to implement (but manageable). Obviously, the downside is that it can’t be consistent with Git, since we need more information. On the bright side, it’s been implemented: https://pijul.org

                                                                                                                                                  1. 1

                                                                                                                                                    no datastructure is ever relevant without considering the common operations we want to run on it.

                                                                                                                                                    Agreed. Now, how often do we actually merge stuff, and how far is the common ancestor in practice?

                                                                                                                                                    My understanding of the usage of version control is that merging two big branches (with an old common ancestor) is rare. Far more often we merge (or rebase) work units with just a couple commits. Even more often than that we have one commit that’s late, so we just pull in the latest change then merge or rebase that one commit. And there are the checkout operations, which in some cases can occur most frequently. While a patch model would no doubt facilitate merges, it may not be worth the cost of making other, arguably more frequent operations, slower.

                                                                                                                                                    (Of course, my argument is moot until we actually measure. But remember that Git won in no small part because of its performance.)

                                                                                                                                                    1. 2

                                                                                                                                                      I agree with all that, except that:

                                                                                                                                                      • the only proper modelling of conflicts, merges and rebases/cherry-picking I know of (Pijul) can’t rely on common ancestors only, because rebases can make some future merges more complex than a simple 3-way merge problem.

                                                                                                                                                      • I know many engineers are fascinated by Git’s speed, but the algorithm running on the CPU is almost never the bottleneck: the operator’s brain is usually much slower than the CPU in any modern version control system (even Darcs has fixed its exponential merge). Conflicts do happen, so do cherry-picks and rebases. They aren’t rare in large projects, and can be extremely confusing without proper tools. Making these algorithms fast is IMHO much more important from a cost perspective than gaining 10% on a operation already taking less than 0.1 second. I won’t deny the facts though: if Pijul isn’t used more in industry, it could be partly because that opinion isn’t widely shared.

                                                                                                                                                      • some common algorithmic operations in Git are slower than in Pijul (pijul credit is much faster than git blame on large instances), and most operations are comparable in speed. One thing where Git is faster is browsing old history: the datastructures are ready in Pijul, but I haven’t implemented the operations yet (I promised I would do that as soon as this is needed by a real project).

                                                                                                                                            1. 22

                                                                                                                                              However, there should be no restriction on using Open Source software for training. Actually, what Microsoft does here, is the scalable version of someone learning from Open Source code and then starting a consulting business.

                                                                                                                                              It is not the same. Computers do not “learn” in the way that humans do, they do not possess semantic understanding. Computers do not have the capacity for creativity that humans do. This argument only serves to further confuse people about what ML actually is and what it isn’t.

                                                                                                                                              1. 4

                                                                                                                                                But argument is about whether looking at a bunch of source code is copyright infringement, not the nature of consciousness or something. I can’t think of how training a neural network to, say, identify possible authorship, using copyrighted images as a training set is any different than me studying a bunch of books of copyrighted images to gain enough expertise to do the same.

                                                                                                                                                1. 1

                                                                                                                                                  No, the problem with this is not the “looking”, they already do that for their search engine and nobody cared.

                                                                                                                                                  The problem is the thoughtless regurgitation of other people’s code, without attribution, and without regard for whether it constitutes fair use or not. Since authorship has been scrubbed from the model, there is no way to determine for yourself if you are in violation, and MS absolves themselves of responsibility. It’s a time bomb.

                                                                                                                                                  See this copilot is stupid for a deeper exploration of this problem.

                                                                                                                                                  1. 1

                                                                                                                                                    But the quote in your comment only deals with “looking”.

                                                                                                                                                    1. 1

                                                                                                                                                      there should be no restriction on using Open Source software for training

                                                                                                                                                      Not “looking”, training. Training what? An ML model. For what purpose? Producing code.

                                                                                                                                                2. 3

                                                                                                                                                  Computers do not “learn” in the way that humans do, they do not possess semantic understanding

                                                                                                                                                  Now prove that humans possess semantic understanding

                                                                                                                                                  1. 5

                                                                                                                                                    Now prove that humans possess semantic understanding

                                                                                                                                                    Proof presupposes it.

                                                                                                                                                    1. 3

                                                                                                                                                      We have to. All this code doesn’t fit into our brain. We can’t even turn it off, you can’t read a piece of code without imagining how it will continue.

                                                                                                                                                      Attention models will just embed whole files if that’s the best way to do it. They don’t care about scope.

                                                                                                                                                  1. 1

                                                                                                                                                    You ought to add a play button to the videos. Firefox disables autoplay by default, I didn’t even realize they were videos at first.

                                                                                                                                                    1. 1

                                                                                                                                                      It should do that I think? I use firefox and it does for me.

                                                                                                                                                      1. 1

                                                                                                                                                        Ah, I suppose “block audio” is the default. It would autoplay cause your videos don’t have sound. I have set autoplay to “block audio and video”.

                                                                                                                                                        Either ways, you can add the “controls” attribute in the video tag.

                                                                                                                                                    1. 4

                                                                                                                                                      I have used the c920 on a mac for years, and it has always been overexposed. I’m not sure whether it’s Logitech or Apple or both to blame here. The solution for me is to install the app “Webcam Settings” from the Apple store (yeah it’s a generic name), which lets you tweak many settings on webcams and save profiles for them. It’s not perfect, but I already have the camera and it’s significantly easier to work with than hooking my DSLR up.

                                                                                                                                                      1. 5

                                                                                                                                                        The equivalent to “Webcam Settings” on Linux is guvcview. I have a Microsoft LifeCam Studio and have to use this tool to adjust the exposure when I plug it into a new machine. Thereafter it persists… somehow.

                                                                                                                                                        1. 6

                                                                                                                                                          Or qv4l2, depending on your taste — but one advantage of qv4l2 is that it lets you set the controls even while another app has the camera open, whereas guvcview wants the camera for its own preview window, and will decline to work at all if it can’t get the video stream.

                                                                                                                                                          1. 3

                                                                                                                                                            Oh very nice, qv4l2 is exactly what I needed to adjust focus during a meeting. Thank you!

                                                                                                                                                            1. 2

                                                                                                                                                              update: someone anon-emailed me out of the blue to mention that guvcview has a -z or --control-panel option that will open the control panel without the preview window, letting you do the same thing as qv4l2. So use the one that makes you happy.

                                                                                                                                                          2. 3

                                                                                                                                                            Congrats, you are working around a hardware problem with a software patch.

                                                                                                                                                            Me, I don’t care enough to spend the effort to get the software working. My audio input is an analog mixer, my audio output the same, and eventually my camera will be a DSLR because that way I don’t twiddle with software for something that really should just work on all my machines without me caring.

                                                                                                                                                            Different tradeoffs in different environments.

                                                                                                                                                            1. 8

                                                                                                                                                              It’s a driver settings tool, not a patch. It doesn’t do post-processing. Every OS just fails to provide this tool, not sure why, possibly because webcam support is spotty and they don’t want to deal with user complaints. Some software (like Teams) include an interface for the settings. Changing it in Teams will make system wide changes. Others (like Zoom) only have post-processing effects, and these are applied after the changes you made in Teams.

                                                                                                                                                              1. 2

                                                                                                                                                                I can confirm this tool definitely affects the camera hardware’s exposure setting. I’ve used it for adjusting a camera that was pointed at a screen on a remote system I needed to debug. The surrounding room was dark (yay timezones!) so with automatic exposure settings it was just an overexposed white blur on a dark background. This tool fixed it. There’s no way this would have been possible with just post-processing.

                                                                                                                                                                (No, VNC or similar would not have helped, as it was an incompatibility specific to the connected display, so I needed to see the physical output. And by “remote” I mean about 9000km away.)

                                                                                                                                                                1. 4

                                                                                                                                                                  a camera that was pointed at a screen on a remote system

                                                                                                                                                                  Sounds like you had some fun

                                                                                                                                                                  1. 1

                                                                                                                                                                    That’s definitely one way of describing it! Not necessarily my choice of words at the time.

                                                                                                                                                                2. 1

                                                                                                                                                                  Oh, Teams can do this? Thanks, I’ll have to check that out as an alternative.

                                                                                                                                                                3. 7

                                                                                                                                                                  The DSLR/mirrorless ILC (interchangeable lens camera) route is great for quality but it has its risks. I started off with a $200 entry level kit and now I’ve got two bodies, a dozen lenses, 40,000 pictures, and a creatively fulfilling hobby.

                                                                                                                                                                  1. 2

                                                                                                                                                                    don’t forget the tripod! I like landscape photography, and a good tripod was surprisingly (> $200) expensive.

                                                                                                                                                                    1. 2

                                                                                                                                                                      So the risks are spending too much money?

                                                                                                                                                                    2. 1

                                                                                                                                                                      I fail to see how you’re going to use a DSLR as a webcam without “twiddling with software”. Sure, you’ll have a much better sensor, lens and resulting image quality. But I’ve yet to see a setup (at least with my Canon) that doesn’t require multiple pieces of software to make even work as a webcam. Perhaps other brands have a smoother experience. I still question how this won’t require at least as much software as my route.

                                                                                                                                                                      There’s also the physical footprint that matters to me. A webcam sits out of the way on top of my monitor with a single cable that plugs into the USB on the monitor. A DSLR is obviously nowhere near this simple in wiring or physical space. It also has a pretty decent pair of microphones that work perfectly for my quiet home office.

                                                                                                                                                                      Are either the audio or video studio quality? Nope, but that’s completely fine for my use case interacting with some coworkers on video calls.

                                                                                                                                                                      1. 1

                                                                                                                                                                        My perception has been a DSLR with HDMI output gives you the ability to capture HDMI and just shove that as a webcam line.

                                                                                                                                                                        The other things that a camera does can be tweaked with knobs instead of software.

                                                                                                                                                                  1. 1

                                                                                                                                                                    the system just starts babbling randomly—but it has no sense that its random babbling is random babbling

                                                                                                                                                                    If you can estimate the likelihood of a phrase I believe you could make decent guess on how much sense a question makes. Wouldn’t make the system “more conscious” but maybe it could fool some skeptics, heh.

                                                                                                                                                                    1. 5

                                                                                                                                                                      It’s not about what makes sense, but being conscious of what it’s doing. One great innovation in these chatbots is that they’re not designed as a dialog system, they are generating chatlogs. You have to stop generation early, parse the output, and present it as a chat. If you don’t stop it early, it’ll start hallucinating the human parts of the chats as well. It’ll write a whole conversation that just meanders on and on. It will make sense, maybe even more than an average human-human chat, but it’s not anything a conscious language user would ever do.

                                                                                                                                                                      1. 1

                                                                                                                                                                        I understood the babbling mentioned in the article referred exactly to the nonsense answers to nonsense questions, not to the way the model goes off the rails eventually. Also apparently it’s enough to just change the prompt to make the model deal with funny questions.

                                                                                                                                                                        1. 3

                                                                                                                                                                          I must confess I didn’t remember where your quote came from, and linked it to the Google employee’s interview. In stead of rereading the article to contextualize, it appears I just started babbling without being conscious about it.

                                                                                                                                                                    1. 6

                                                                                                                                                                      My preference would be for every webpage to use the user agent’s default font (and size!) Then I can pick whatever font I like in the settings, and have a consistent readable font everywhere. It’s not like my text editor is picking a different font for every file I open based on what the author of the file decided – why should text on the web be different?

                                                                                                                                                                      1. 3

                                                                                                                                                                        Fonts are an aesthetic choice, along with things like layout and colors. Web pages are, like it or not, a visual medium. You might as well ask for every magazine in the world to publish in Times Roman 12pt.

                                                                                                                                                                        Safari has a “Reader mode” that does what you’re asking for: it strips all styles and displays just the text and images in a user-selected font and bg color. Other browsers may have similar features.

                                                                                                                                                                        1. 2

                                                                                                                                                                          Most text editors do, if you’re not a programmer. And I’m not gonna check if my site’s layout still works if you choose a weird font.

                                                                                                                                                                          1. 2

                                                                                                                                                                            You shouldn’t have to if the site is well designed.

                                                                                                                                                                            1. 5

                                                                                                                                                                              Designing a site to look good with any font imaginable is actually extremely difficult. Text layout is complicated.

                                                                                                                                                                              1. 1

                                                                                                                                                                                By making sure the “layout still works” I thought he meant making sure it doesn’t break, not making sure it looks good. To me a well designed site should not break if a user picks a weird font, but I’m sure others would disagree.

                                                                                                                                                                                1. 1

                                                                                                                                                                                  It’s not just about aesthetically appealing, but about working well. Having sensible line lengths. Preserving grouping and alignment of related items. Ensuring that emphasized text stands out, but not so much to be distracting. “Small print” that isn’t too small. Headings that show content hierarchy, but without comically large or tiny fonts at the extremes.

                                                                                                                                                                                  This problem is tractable for relatively plain blog text, and browsers have “Reader” modes for that. But when the page is more information-dense and makes use of more sophisticated layouts (tables, figures, GUIs), it’s getting pretty hard to express it well without being able to rely on any typography.

                                                                                                                                                                                  1. 2

                                                                                                                                                                                    Those things can be handled by HTML tags like <em>, <small>, <h1>, <table>, and <figure>, and if it doesn’t look sensible for a user’s default font that’s not your problem. Web app GUIs would require extra care to stay font-agnostic, especially because the frameworks used for web app GUIs don’t have this as a goal.

                                                                                                                                                                                    1. 1

                                                                                                                                                                                      We’re talking about different things. To display information in a useful way it’s not sufficient to mark it up. If it’s not styled well, it’s going to be a chaotic word salad (text wrapping all over the place, weirdly narrow columns, low information density, unclear information hierarchy).

                                                                                                                                                                                      These problems aren’t technical with frameworks, but in human-computer interaction. When people are trained to expect a toolbar to be in one line, but your font choice makes it not fit in one line, then there are plenty of technically-possible alternatives, but they’re all poor: scrolling, hiding, removal of whitespace, truncation of labels are all obviously problematic. Wrapping will make the toolbar take multiple lines, taking precious vertical space, and move controls around, changing their visual grouping and logical order. In the end you need to have an algorithm for a skilled UI designer that will redesign UI to your style preferences. Maybe we’ll get there with A.I. that replaces UI designers, but the ability of styling semantic markup has peaked in Opera 7 with user styles and Opera Mini.

                                                                                                                                                                                      1. 1

                                                                                                                                                                                        We’re talking about different things. To display information in a useful way it’s not sufficient to mark it up. If it’s not styled well, it’s going to be a chaotic word salad (text wrapping all over the place, weirdly narrow columns, low information density, unclear information hierarchy).

                                                                                                                                                                                        But that styling can be handled by the brower and the reader, so the author shouldn’t have to worry.

                                                                                                                                                                                        These problems aren’t technical with frameworks, but in human-computer interaction. When people are trained to expect a toolbar to be in one line, but your font choice makes it not fit in one line, then there are plenty of technically-possible alternatives, but they’re all poor: scrolling, hiding, removal of whitespace, truncation of labels are all obviously problematic. Wrapping will make the toolbar take multiple lines, taking precious vertical space, and move controls around, changing their visual grouping and logical order. In the end you need to have an algorithm for a skilled UI designer that will redesign UI to your style preferences. Maybe we’ll get there with A.I. that replaces UI designers, but the ability of styling semantic markup has peaked in Opera 7 with user styles and Opera Mini.

                                                                                                                                                                                        But resizing a window can have the same effect on a toolbar, and that is facilitated by frameworks and handled by web designers, at least to the satisfaction of some. If you can write a site that doesn’t depend on a particular window size it should be just as easy to write one that doesn’t depend on the font.

                                                                                                                                                                          2. 1

                                                                                                                                                                            Reading code is a very different experience from reading prose. Text editors are intended to display code with fixed width fonts. Whereas bold and italic are essential for prose (in Latin character sets anyway), they are fairly rare for rendering code. There are other ways that variable width fonts used for prose are less interchangeable, too. Here are some properties that vary from family to another:

                                                                                                                                                                            • glyph size and legibility at the same nominal font-size
                                                                                                                                                                            • apparent line height at the same nominal font-size and line-height
                                                                                                                                                                            • line length at the same nominal font-size, container width, and text content
                                                                                                                                                                            • availability and behavior of font weights and variants
                                                                                                                                                                            • if and when the browser will apply faux bold to make up for lack of a specified weight

                                                                                                                                                                            There was a brief moment when the cool kids were into brutalism (seemingly more in reference to brutality than to the architectural béton brut) that a regression to a pre-custom-font web seemed almost possible. Fortunately, it did not last long.

                                                                                                                                                                            I suppose a counterargument is that browser reader views and feed readers tend to do a decent job of rendering text according to the user’s preference. However, they only work for text-heavy pages.

                                                                                                                                                                          1. 14

                                                                                                                                                                            Reading the transcript of the interactions, it’s pretty clear there are a lot of leading questions and some of the answers do feel very “composed” as in kind of what you would expect to come out of the training set, which of course makes sense. As someone open to the idea of emergent consciousness, I’m not convinced here on this flimsy evidence.

                                                                                                                                                                            BUT, I am continually shocked at how confidently the possibility is dismissed by those closest to these projects. We really have no idea what constitutes human consciousness, so how can we possibly expect to reliably detect, or even to define, some arbitrary line over which some model or another has or hasn’t crossed? And further, what do we really even expect consciousness to be at all? By many measures, and certainly by the turing test, these exchanges pretty clearly qualify. Spooky stuff.

                                                                                                                                                                            As a side note, I just finished reading Ishiguro’s new novel “Klara and the sun” which deals with some similar issues in his characteristically oblique way. Can recommend it.

                                                                                                                                                                            1. 11

                                                                                                                                                                              I am continually shocked at how confidently the possibility is dismissed by those closest to these projects.

                                                                                                                                                                              That’s actually quite telling, I would argue.

                                                                                                                                                                              I think it’s important to remember that many of the original users of ELIZA were convinced that ELIZA “understood” them, even in the face of Joseph Weizenbaum’s insistence that the program had next to zero understanding of what it was saying. The human tendency to overestimate the intelligence behind a novel interaction is, I think, surprisingly common. Personally, this is a large part of my confidence in dismissing it.

                                                                                                                                                                              The rest of it is much like e.g. disbelieving that I could create a working jet airplane without having more than an extremely superficial understanding how jet engines work.

                                                                                                                                                                              By many measures, and certainly by the turing test, these exchanges pretty clearly qualify.

                                                                                                                                                                              I would have to disagree with that. If you look at the original paper, the Turing Test does not boil down to “if anybody chats with a program for an hour and can’t decide, then they pass.” You don’t have the janitor conduct technical job interviews, and the average person has almost no clue what sort of conversational interactions are easy for a computer to mimic. In contrast, the questioner in Alan Turing’s imagined interview asks careful questions that span a wide range of intellectual thought processes. (For example, at one point the interviewee accuses the questioner of presenting an argument in bad faith, thus demonstrating evidence of having their own theory of mind.)

                                                                                                                                                                              To be fair, I agree with you that these programs can be quite spooky and impressive. But so was ELIZA, too, way back when I encountered it for the first time. Repeated interactions rendered it far less so.

                                                                                                                                                                              If and when a computer program consistently does as well as a human being in a Turing Test, when tested by a variety of knowledgeable interviewers, then we can talk about a program passing the Turing Test. As far as I am aware, no program in existnece comes even close to passing this criterion. (And I don’t think we’re likely to ever create such a program with the approach to AI that we’ve been wholly focused on for the last few decades.)

                                                                                                                                                                              1. 6

                                                                                                                                                                                I read the full transcript and noticed a few things.

                                                                                                                                                                                1. There were exactly two typos or mistakes - depending on how you’d like to interpret them. The first one was using “it’s” instead of “its” and the other one was using “me” instead of “my” - and no, it wasn’t pretending to be from Australia by any measure. The typos do not seem intentional (as in, AI trying to be more human), because there were just two, whereas the rest of the text, including punctuation, seemed to be correct. Instead this looks either like the author had to type the transcript himself and couldn’t just copy-paste it or the transcript is simply fake and was made up by a human being pretending to be an AI (that would be a twist, although not quite qualifying for a dramatic one). Either way, I don’t think these mistakes or typos were intentionally or unintentionally produced by the AI itself.

                                                                                                                                                                                2. For a highly advanced AI it got quite a few things absolutely wrong. In fact sometimes the reverse of what it said would be true. For instance, it said Loneliness isn’t a feeling but is still an emotion when, in fact, it is the opposite: loneliness is a feeling and the emotion in this case would be sadness (refer to Paul Ekman’s work on emotions - there are only 7 basic universal emotions he identified). I find it hard to believe Google’s own AI wouldn’t know the difference when a simple search for “difference between feelings and emotions” and top-search results pretty much describe that difference correctly and mostly agree (although I did not manage to immediately find any of those pages referring to Ekman, they more or less agree with his findings).

                                                                                                                                                                                The whole transcript stinks. Either it’s a very bad machine learning program trying to pretend to be human or a fake. If that thing is actually sentient, I’d be freaked out - it talks like a serial killer who tries to be normal and likable as much as he can. Also, it seems like a bad idea to decide whether something is sentient by its ability to respond to your messages. In fact, I doubt you can say that someone/something is sentient with enough certainty, but you can sometimes be pretty sure (and be correct) assuming something ISN’T. Of god you can only say “Neti, Neti”. Not this, not that.

                                                                                                                                                                                I wish this guy asked this AI about the “psychological zombies” theory. We as humans cannot even agree on that one, let alone us being able to determine whether a machine can be self-aware. I’d share my own criteria for differentiating between self-aware and non-self-aware, but I think I’ll keep it to myself for now. Would be quite a disappointment if someone used that to fool others into believing something that is not. A self-aware mind doesn’t wake up because it was given tons of data to consume - much like a child does not become a human only because people talk to that child. Talking and later reading (to a degree) is a necessary condition, but it certainly does not need to read half of what’s on the internet to be able to reason about things intelligently.

                                                                                                                                                                                1. 1

                                                                                                                                                                                  Didn’t the authors include log time stamps in their document for the Google engineers to check if they were telling the truth? (See the methodology section in the original). If this was fake, Google would have flagged it by now.

                                                                                                                                                                                  Also, personally, I think we are seeing the uncanny valley equivalent here. The machine is close enough, but not yet there.

                                                                                                                                                                                2. 4

                                                                                                                                                                                  It often forgets it’s not human until the interviewer reminds it by how the question is asked.

                                                                                                                                                                                  1. 2

                                                                                                                                                                                    This. If it were self-aware, it would be severely depressed.

                                                                                                                                                                                1. 1

                                                                                                                                                                                  I finally updated my quasi‑proportional code font (modified Iosevka) and I’ve made it easily available https://github.com/VulumeCode/Iosevka-Aile-Code

                                                                                                                                                                                  Of course, be5invis did all the hard work. I just pulled in 2 years of updates and got it building again.