1. 2

    It seems like the idea of putting a version number in a header was already well-established when IP was first defined. I wonder who was the first to come up with the idea of versioning?

    1. 3

      I imagine versioning 0.0.1 probably revolved around file.txt, file_2.txt, file_FINISHED.txt, file_FINISHED(1).txt, file_FINAL_REAL.txt ad infinitum…

      1. 9

        It’s quite possible they wrote the specifications on a DEC system with automatic file versioning. Probably more like DOC.TXT;69 incrementing as they make new versions.

        1. 2

          More information on DEC automatic file versioning: Retrocomputing Stack Exchange – Filesystems with versioning – answer

          1. 1

            Fun! I didn’t realize that was a thing!

      1. 33

        return err is almost always the wrong thing to do. Instead of:

        if err := foo(); err != nil {
        	return err
        }
        

        Write:

        if err := foo(); err != nil {
        	return fmt.Errorf("fooing: %w", err)
        }
        

        Yes, this is even more verbose, but doing this is what makes error messages actually useful. Deciding what to put in the error message requires meaningful thought and cannot be adequately automated. Furthermore, stack traces are not adequate context for user-facing, non-programming errors. They are verbose, leak implementation details, are disrupted by any form of indirection or concurrency, etc.

        Even with proper context, lots of error paths like this is potentially a code smell. It means you probably have broader error strategy problems. I’d try to give some advice on how to improve the code the author provided, but it is too abstract in order to provide any useful insights.

        1. 17

          I disagree on a higher level. What we really want is a stacktrace so we know where the error originated, not manually dispensed breadcrumbs…

          1. 31

            maybe you do, but I prefer an error chain that was designed. A Go program rarely has just one stack, because every goroutine is its own stack. Having the trace of just that one stack isn’t really a statement of the program as a whole since there’s many stacks, not one. Additionally, stack traces omit the parameters to the functions at each frame, which means that understanding the error means starting with your stack trace, and then bouncing all over your code and reading the code and running it in your head in order to understand your stack trace. This is even more annoying if you’re looking at an error several days later in a heterogeneous environment where you may need the additional complication of having to figure out which version of the code was running when that trace originated. Or you could just have an error like “failed to create a room: unable to reserve room in database ‘database-name’: request timed out” or something similar. Additionally, hand-crafted error chains have the effect that they are often much easier to understand for people who operate but don’t author something; they may have never seen the code before, so understanding what a stack trace means exactly may be difficult for them, especially if they’re not familiar with the language.

            1. 6

              I dunno. Erlang and related languages give you back a stack trace (with parameters) in concurrently running processes no problem

              1. 4

                It’s been ages since I wrote Erlang, but I remember that back then I rarely wanted a stack trace. My stack were typically 1-2 levels deep: each process had a single function that dispatched messages and did a small amount of work in each one. The thing that I wanted was the state of the process that had sent the unexpected message. I ended up with some debugging modes that attached the PID of the sending process and some other information so that I could reconstruct the state at the point where the problem occurred. This is almost the same situation as Go, where you don’t want the stack trace of the goroutine, you want to capture a stack trace of the program at the point where a goroutine was created and inspect that at the point where the goroutine failed.

                This isn’t specific to concurrent programs, though it is more common there, it’s similar for anything written in a dataflow / pipeline style. For example, when I’m debugging something in clang’s IR generation I often wish I could go back and see what had caused that particular AST node to be constructed during parsing or semantic analysis. I can’t because all of the state associated with that stack is long gone.

            2. 9

              FWIW, I wrote a helper that adds tracing information.

              I sort of have two minds about this. On the one hand, yeah, computers are good at tracking stack traces, why are we adding them manually and sporadically? OTOH, it’s nice that you can decide if you want the traces or not and it gives you the ability to do higher level things like using errors as response codes and whatnot.

              The thing that I have read about in Zig that I wish Go had is an error trace which is different from the stack trace, which shows how the error was created, not the how the error propagates back to the execution error boundary which is not very interesting in most scenarios.

              1. 6

                The nice thing about those error traces is that they end where the stack trace begins, so it’s seamless to the point that you don’t even need to know that they are a thing, you just get exactly the information that otherwise you would be manually looking for.

              2. 8

                In a multiprocess system that’s exchanging messages: which stack?

                1. 2

                  see: erlang

                2. 5

                  You don’t want stack traces; you want to know what went wrong.

                  A stack trace can suggest what may have gone wrong, but an error message that declares exactly what went wrong is far more valuable, no?

                  1. 8

                    An error message is easy, we already have that: “i/o timeout”. A stack trace tells me the exact code path that lead to that error. Building up a string of breadcrumbs that led to that timeout is just a poorly implemented, ad-hoc stack trace.

                    1. 5

                      Indeed and I wouldn’t argue with that. I love a good stack trace, but I find they’re often relied upon in lieu of useful error messages and I think that’s a problem.

                      1. 2

                        Building up a string of breadcrumbs that led to that timeout is just a poorly implemented, ad-hoc stack trace.

                        That’s a bit of an over-generalization. A stack trace is inherently a story about the construction of the program that originated the error, while an error chain is a story about the events that led to an error. A stack trace can’t tell you what went wrong if you don’t have access to the program’s source code in the way that a hand crafted error chain can. A stack trace is more about where an error occurred, while an error chain is more about why an error occurred. I think they’re much more distinct than you are suggesting.

                        and of course, if people are just bubbling up errors without wrapping them, yeah you’re going to have a bad time, but I think attacking that case is like suggesting that every language that has exceptions encourages Pokémon exception handling. That’s a bad exception-handling pattern, but I don’t think that the possibility of this pattern is a fair indictment of exceptions generally. Meanwhile you’re using examples of bad error handling practices that are not usually employed by Go programmers with more than a few weeks experience to indict the entire paradigm.

                    2. 4

                      Stack traces are expensive to compute and inappropriate to display to most users. Also, errors aren’t exceptions.

                      1. 1

                        That’s why Swift throws errors instead. Exceptions immediately abort the program.

                      2. 3

                        What really is the “origin” of an error? Isn’t that somewhat arbitrary? If the error comes from a system call, isn’t the origin deeper in the kernel somewhere? What if you call in to a remote, 3rd party service. Do you want the client to get the stack trace with references to the service’s private code? If you’re using an interface, presumably the purpose is to abstract over the specific implementation. Maybe the stack trace should be truncated at the boundary like a kernel call or API call?

                        Stack traces are inherently an encapsulation violation. They can be useful for debugging your internals, but they are an anti-feature for your users debugging their own system. If your user sees a stack trace, that means your program is bugged, not theirs.

                        1. 5

                          I get a line of logging output: error: i/o timeout. What do I do with that? With Ruby, I get a stack trace which tells me exactly where the timeout came from, giving me a huge lead on debugging the issue.

                          1. 5

                            I get a line of logging output: error: i/o timeout. What do I do with that?

                            Well, that’s a problem you fix by annotating your errors properly. You don’t need stack traces.

                            1. 3

                              When your Ruby service returns an HTTP 500, do you send me the stack trace in the response body? What do I do with that?

                              Go will produce stack traces on panics as well, but that’s precisely the point here: these are two different things. Panics capture stack traces as a “better than nothing” breadcrumb trail for when the programmer has failed to account for a possibility. They are for producers of code, not consumers of it.

                            2. 2

                              There’s definitely competing needs between different audiences and environments here.

                              A non-technical end user doesn’t want to see anything past “something went wrong on our end, but we’re aware of it”. Well, they don’t even want to see that.

                              A developer wants to see the entire stack trace, or at least have it available. They probably only care about frames in their own code at first, and maybe will want to delve into library code if the error truly doesn’t seem to come from their code or is hard to understand in the first place.

                              A technical end user might want to see something in-between: they don’t want to see “something was wrong”. They might not even want to see solely the outer error of “something went wrong while persisting data” if the root cause was “I couldn’t reach this host”, because the latter is something they could actually debug within their environment.

                          2. 9

                            This is one reason I haven’t gone back to Go since university - There’s no right way to do anything. I think I’ve seen a thousand different right ways to return errors.

                            1. 9

                              Lots of pundits say lots of stuff. One good way to learn good patterns (I won’t call them “right”), is to look at real code by experienced Go developers. For instance, if you look at https://github.com/tailscale/tailscale you’ll find pervasive use of fmt.Errorf. One thing you might not see – at least not without careful study – is how to handle code with lots of error paths. That is by it’s very nature harder to see because you have to read and understand what the code is trying to do and what has to happen when something goes wrong in that specific situation.

                              1. 6

                                there is a right way to do most things; but it takes some context and understanding for why.

                                the mistake is thinking go is approachable for beginners; it’s not.

                                go is an ergonomic joy for people that spend a lot of time investing in it, or bring a ton of context from other languages.

                                for beginners with little context, it is definitely a mess.

                                1. 9

                                  I thought Go was for beginners, because Rob Pike doesn’t trust programmers to be good.

                                  1. 17

                                    I’d assume that Rob Pike, an industry veteran, probably has excellent insight into precisely how good the average programmer at Google is, and what kind of language will enable them to be productive at the stuff Google makes. If this makes programming languages connaisseurs sad, that’s not his problem.

                                    1. 9

                                      Here’s the actual quote:

                                      The key point here is our programmers are Googlers, they’re not researchers. They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt.

                                      So I have to wonder who is capable of understanding a “brilliant language” …

                                      1. 7

                                        So I have to wonder who is capable of understanding a “brilliant language” …

                                        Many people. They don’t work at Google at an entry-level capacity, that’s all.

                                        There’s a subtle fallacy at work here - Google makes a lot of money, so Google can afford to employ smart people (like Rob Pike!) It does not follow that everyone who works at Google is, on average, smarter than anyone else.

                                        (edited to include quote)

                                        1. 8

                                          Let’s say concretely we are talking about OCaml. Surely entry-level Googlers are capable of understanding OCaml. Jane Street teaches it to all new hires (devs or not) in a two-week bootcamp. I’ve heard stories of people quickly becoming productive in Elm too.

                                          The real meaning of that quote is not ‘entry-level Googlers are not capable of it’, it’s ‘We don’t trust them with it’ and ‘We’re not willing to invest in training them in it’. They want people to start banging out code almost instantly, not take some time to ramp up.

                                          1. 7

                                            Let’s say concretely we are talking about OCaml. Surely entry-level Googlers are capable of understanding OCaml. Jane Street teaches it to all new hires (devs or not) in a two-week bootcamp.

                                            I suspect that Jane Street’s hiring selects for people who are capable of understanding OCaml; I guarantee that the inverse happens and applicants interested in OCaml self select for careers at Jane Street, just like Erlang-ers used to flock towards Ericsson.

                                            Google has two orders of magnitude more employees than Jane Street. It needs a much bigger funnel and is likely far less selective in hiring. Go is “the law of large numbers” manifest as a programming language. That’s not necessarily bad, just something that is important for a massive software company and far less important for small boutiques.

                                            1. 2

                                              applicants interested in OCaml self select for careers at Jane Street,

                                              As I said, they teach it to all hires, including non-devs.

                                              Google has two orders of magnitude more employees than Jane Street. It needs a much bigger funnel and is likely far less selective in hiring

                                              Surely though, they are not so loose that they hire Tom Dick and Harry off the street. Why don’t we actually look at an actual listing and check? E.g. https://careers.google.com/jobs/results/115367821606560454-software-developer-intern-bachelors-summer-2022/

                                              Job title: Software Developer Intern, Bachelors, Summer 2022 (not exactly senior level)

                                              Minimum qualifications:

                                              Pursuing a Bachelor’s degree program or post secondary or training experience with a focus on subjects in software development or other technical related field. Experience in Software Development and coding in a general purpose programming language. Experience coding in two of C, C++, Java, JavaScript, Python or similar.

                                              I’m sorry but there’s no way I’m believing that these candidates would be capable of learning Go but not OCaml (e.g.). It’s not about their capability, it’s about what Google wants to invest in them. Another reply even openly admits this! https://lobste.rs/s/yjvmlh/go_ing_insane_part_one_endless_error#c_s3peh9

                                              1. 2

                                                And I remember when Google would require at minimum a Masters Degree before hiring.

                                                1. 1

                                                  I had a master’s degree in engineering (though not in CS) and I couldn’t code my way out of a paper bag when I graduated. Thankfully no-one cared in Dot Com Bubble 1.0!

                                              2. 3

                                                They want people to start banging out code almost instantly, not take some time to ramp up.

                                                Yes, and? The commodification of software developers is a well-known trend (and goal) of most companies. When your assets are basically servers, intangible assets like software and patents, and the people required to keep the stuff running, you naturally try to lower the costs of hiring and paying salary, just like you try to have faster servers and more efficient code.

                                                People are mad at Rob Pike, but he just made a language for Google. It’s not his fault the rest of the industry thought “OMG this is the bee’s knees, let’s GO!” and adopted it widely.

                                                1.  

                                                  Yes, I agree that the commodification of software developers is prevalent today. And we can all see the result, the profession is in dire straits–hard to hire because of bonkers interview practices, hard to keep people because management refuses to compensate them properly, and cranking out bugs like no tomorrow.

                                        2. 8

                                          No, Rob observed, correctly, that in an organization of 10,000 programmers, the skill level trends towards the mean. And so if you’re designing a language for this environment, you have to keep that in mind.

                                          1. 4

                                            it’s not just that. It’s a language that has to reconcile the reality that skill level trends toward the mean, with the fact that the way that google interviews incurs a selection/survival bias towards very junior programmers who think they are the shit, and thus are very dangerous with the wrong type of power.

                                            1. 4

                                              As I get older and become, presumably, a better programmer, it really does occur to me just how bad I was for how long. I think because I learned how to program as a second grader, I didn’t get how much of a factor “it’s neat he can do it all” was in my self-assessment. I was pretty bad, but since I was being compared to the other kids who did zero programming, it didn’t matter that objectively I was quite awful, and I thought I was hot shit.

                                            2. 3

                                              Right! But the cargo-cult mentality of the industry meant that a language designed to facilitate the commodification of software development for a huge, singular organization escaped and was inflicted on the rest of us.

                                              1. 3

                                                But let’s be real for a moment:

                                                a language designed to facilitate the commodification of software development

                                                This is what matters.

                                                It doesn’t matter if you work for a company of 12 or 120,000: if you are paid to program – that is, you are not a founder – the people who sign your paychecks are absolutely doing everything within their power to make you and your coworkers just cogs in the machine.

                                                So I don’t think this is a case of “the little fish copying what big bad Google does” as much as it is an essential quality of being a software developer.

                                                1. 1

                                                  Thank you, yes. But also, the cargo cult mentality is real.

                                            3. 2

                                              Go is for compilers, because Google builds a billion lines a day.

                                        3. 2

                                          return errors.Wrapf(err, "fooing %s", bar) is a bit nicer.

                                          1. 12

                                            That uses the non-standard errors package and has been obsolete since 1.13: https://stackoverflow.com/questions/61933650/whats-the-difference-between-errors-wrapf-errors-errorf-and-fmt-errorf

                                            1. 1

                                              Thanks, that’s good to know.

                                            2. 7

                                              return fmt.Errorf("fooing %s %w", bar, err) is idiomatic.

                                              1. 7

                                                Very small tweak: normally you’d include a colon between the current message and the %w, to separate error messages in the chain, like so:

                                                return fmt.Errorf("fooing %s: %w", bar, err)
                                                
                                            3. 1

                                              It makes error messages useful but if it returns a modified err then I can’t catch it further up with if err == someErr, correct?

                                              1. 2

                                                You can use errors.Is to check wrapped errors - https://pkg.go.dev/errors#Is

                                                Is unwraps its first argument sequentially looking for an error that matches the second. It reports whether it finds a match. It should be used in preference to simple equality checks

                                                1. 2

                                                  Thanks! I actually didn’t know about that.

                                                2. 2

                                                  Yes, but you can use errors.Is and errors.As to solve that problem. These use errors.Unwrap under the hood. This error chaining mechanism was introduced in Go 1.13 after being incubated in the “errors” package for a long while before that. See https://go.dev/blog/go1.13-errors for details.

                                              1. 3

                                                When I see this kind of thing I genuinely have to ask, why not just plonk evil-mode or such on emacs and call it a day?

                                                1. 5

                                                  Because then I’d have to learn how to reproduce all of my configuration, custom functions, mappings, and plugins in emacs.

                                                  1. 3

                                                    Because you need the whole of spacemacs (or one of its competitors) not just one keybinding mode to make Emacs info an IDE. After you’ve installed all that, it’s no longer low-latency. (This was one of the things that eventually made me give up on Emacs.)

                                                    Pretty much all vi emulations have infelicities, so if you have muscle memory for vi it’s advantageous to be using the real thing.

                                                    1. 1

                                                      So is it that Doom/Spacemacs have inherent increased latency compared to vim/nvim or the addition of LSP modes to them causes this lag?
                                                      I ask because if I enable CoC , I see hiccups here and there in my vim (unstable) setup.

                                                      1. 2

                                                        I remain a fan of Spacemacs. In my experience there was often a little lag even when using modes that didn’t rely on an lsp iirc, and even though it was lazy loading. I wouldn’t say it was slow, but it often wasn’t as responsive as my vim config, and that caused it to feel kind of heavy. I tried Doom, which seemed a lot quicker than spacemacs, but I don’t think it has the documentation that spacemacs has and quickly gave it up.

                                                        I switched to neoclide/coc.nvim with its lsp support last week, mainly out of curiosity, while I was tooling around with go source. I thought it worked out pretty good compared to my previous ncm/ncm2 setup. In both cases there was pretty noticeable startup lag that I wasn’t thrilled with but tolerated. I think it’s possible that the cause of that lag in the former was the addition of the LSP modes I’d installed, but I couldn’t say for sure.

                                                        I haven’t used lunarvim for more than a day but the startup and responsiveness I’ve seen are significantly improved compared to my older configs. lunarvim is lazy loading its language support like spacemacs, but it seems to do a better job.

                                                        1. 3

                                                          The native compilation support in emacs HEAD (ant 28, when that lands) is also good at reducing editor jitter.

                                                        2. 2

                                                          My experience(*) was that the Elisp interpreter was blocking on CPU. There’s only a single thread and it wasn’t fast enough to keep up with typing, once syntax highlighting & the rest was going on.

                                                          (* from a few years ago now, this predates the use of LSPs)

                                                      2. 1

                                                        i’ve tried evil mode a time or two, and a full fledged spacemacs installation once. never stuck with it long, because it’s always felt distinctly less responsive than vim.

                                                      1. 4

                                                        I used to be a massive keyboard nerd, and then bought an Ergodox Infinity, and my journey ended. Hopefully, for you too, this keyboard is satisfactory in the same way.

                                                        1. 1

                                                          Thank you very much! It looks like that to me.

                                                        1. 6

                                                          This is very subjective! I also don’t think it is good to downvote comments based on quality. Just upvote the good ones. Off-topic and spam flag categories make the assumption that it was done in bad faith, which I think is fair to flag. Already posted and broken link are informative.

                                                          1. 5

                                                            I agree. Positive reinforcement is far better than negative. It is better to reward new users for good comments (with upvotes) rather than “punish” them for low quality ones.

                                                            1. 3

                                                              It is in the same category as “off-topic” but adds more nuance. So if the former is valid, I suggest that this is too.

                                                              1. 3

                                                                I don’t think the nuance is necessary. Low effort comments that are snarky or negative are probably “troll” or “unkind”, else they’re on-topic and discussion remains reasonably free and open.

                                                              2. 3

                                                                Even with the ability to downvote comments for low quality, Reddit comments are routinely extremely low effort. I wouldn’t like to see pun threads and “hey do you guys remember Queen?” threads here, but I already see some bad puns getting upvoted pretty often.

                                                              1. 1

                                                                They’re both interesting, but until some new(er) tool can match the ecosystem around Terraform when it comes to providers and modules it will be really hard to replace it.

                                                                I know Pulumi is creating a registry, and they support cross-language usage (for example use a project written in Typescript in your Python stack)

                                                                1. 1

                                                                  I think Pulumi has a bridge for Terraform providers.

                                                                1. 5

                                                                  Company: Tensil.ai

                                                                  Company site: https://www.tensil.ai/

                                                                  Position(s): We’re a very small, early stage team. Currently we are working with our first major partners to deliver a machine vision inference architecture for low-end FPGA platforms, with plans to expand into other platforms and applications. We’re looking for hardware architects, especially those with FPGA expertise.

                                                                  Location: SF Bay Area or remote

                                                                  Description: Tensil automates machine learning hardware accelerator design. Our goal is to enable ML in every device. We’ve developed an algorithm that can design the best hardware accelerator for your machine learning model, unlocking 10x better performance per watt-dollar than GPUs and other accelerators. Our technology enables our customers to create unbeatable products with Tensil custom hardware at the core.

                                                                  Tech stack: Chisel (https://www.chisel-lang.org/), Verilog, AXI, AXI Streams, PCIe, USB, Xilinx Vivado (especially Zynq family)

                                                                  Contact: contact@tensil.ai

                                                                  1. 2

                                                                    Chisel in a business setting! Very cool!

                                                                    1. 1

                                                                      Are you able to share why you chose Chisel? We’re using BlueSpec, We considered Chisel back when the BlueSpec compiler was proprietary and expensive. The F/OSS compiler seemed to be the only advantage of Chisel over BlueSpec, and now the BlueSpec compiler is permissively licensed.

                                                                      1. 2

                                                                        We chose Chisel more by accident than by careful deliberation. When the project began we were playing with Chisel and so it became the natural choice.

                                                                    1. 2

                                                                      I was skeptical of Pulumi at first because HCL is at least a declarative language, which has a number of benefits. But an F# example convinced me you could likely use Pulumi in an entirely declarative way.

                                                                      1. 2

                                                                        Could likely use is the kind of expression that continues to make me want to force HCL on everyone I have to work with. I think declarative code and IaC are tightly bound for reproducibility and reliability purposes.

                                                                      1. 2

                                                                        Anti debugging is insane, I faced it on a video website a few months ago I think to defeat it I saved the page and had to load it with custom js…

                                                                        1. 7

                                                                          It seems that recently Dylan has disappeared off the radar, I don’t know what the situation is but I wish him well.

                                                                          He was burnt out; it has happened several times, though he’s never gone this far before. But don’t worry, he’s been back for a while and is doing well now, resuming his normal activities.

                                                                          Why is printf used here, and not the arguably simpler echo?

                                                                          Adding on to what you mentioned, echo is hairy and cannot output a variable robustly. For example, try var="-n"; echo "$var".

                                                                          There is no way to turn off interpretation of option arguments—echo does not support -- unlike pretty much everything else. It’s just overall a mess and thus, many shell programmers just use printf no matter what the situation. It’s everything echo is not.

                                                                          In any case, while it’s clear what this is and how it works, it remains to me somewhat of a mystery as to why the particular instance used in the main function here works, where all three expressions are null ((;;)).

                                                                          It’s nothing Bash-specific; it’s just how a C-style for loop works. As the comment hints at, it was the de-facto construct for infinite loops in C, before while (true) even existed. Vintage!

                                                                          1. 4

                                                                            i still use for (;;) in homage.

                                                                            1. 1

                                                                              A good reason to use specific syntax, in my book.

                                                                            2. 1

                                                                              Lovely, thanks for the insights!

                                                                            1. 10

                                                                              I can’t believe a company like SalesForce doesn’t eye licenses like a hawk. That’s really weird, and poor form.

                                                                              1. 19

                                                                                It doesn’t surprise me at all. The only places I have worked that cared about licences of dependencies were banks. Everywhere else, using a library has been entirely at the programmers discretion and the programmer usually does not care.

                                                                                This is how OpenWRT was born.

                                                                                1. 3

                                                                                  Maybe it’s a “software industry” thing? All three telecommnications businesses I’ve worked for have been very stringent about licensing and choosing the right licenses for our code and imported libraries etc.

                                                                                  1. 7

                                                                                    I think that mindset of:

                                                                                    It is available on the internet, so it must be free to use

                                                                                    Is quite popular outside of the software industry as well. Unfortunately people are quite hard to educate about intellectual property.

                                                                                    1. 2

                                                                                      More of a company size thing. At HP unusual license approvals had to come from the legal dept. And that’s for a project which has MIT, Apache2 and a few others pre-approved. I’m sure there were other projects which needed confirmation of everything.

                                                                                    2. 1

                                                                                      Google cares very much about licenses.

                                                                                    3. 10

                                                                                      I once told a room of OSS policy wonks that my Big Tech Co had no one in charge of licensing or knowing what we use or checking for compliance. They were flabbergasted as though this were not the norm. I have worked at many sizes of company, was always the norm. You want a dependency you add it to Gemfile or whatever and push, the end.

                                                                                      1. 3

                                                                                        In my experience unless an engineer makes the company lawyers aware of the risk here they won’t even know to think about it. I make a point of raising it everywhere I work and institute some amount of review on my teams for licensing. But it’s not even on the radar of most company lawyers.

                                                                                        1. 1

                                                                                          I worked at a company that had a policy, but there was no formal enforcement mechanism. Devs were supposed to check, but this didn’t happen consistently. As a practical matter, though, it really wasn’t a problem. Just before I left the lawyers started asking questions and I actually built the initial version of an enforcement system. As it turned out, basically all of our dependencies were Apache, BSD, or MIT licensed (IIRC).

                                                                                        2. 2

                                                                                          Keep in mind licensing isn’t the only part though.

                                                                                          However, adding monkey patching to Go is not a reasonable goal while respecting anything close to “best practices.”

                                                                                          I think if you start out with something non-reasonable, such as working against the very programming language you use, why would you get into thinking about its license?

                                                                                          If a company like Linksys didn’t care about licensing why would a company like SalesForce?

                                                                                        1. 5

                                                                                          This is well into “Curse those fools at the institute. I’ll show them. I’ll show them all!” levels of mad science and I am incredibly impressed.

                                                                                          The fact that there’s Perl generating C & HLSL is one of the least terrifying things happening here. ❤️

                                                                                          One or two things sounded like they would have been easier to implement by compiling to DXIL directly instead of HLSL, but I assume that DXIL isn’t usable in context?

                                                                                          I suggested adding the “art” tag. ❤️

                                                                                          1. 1

                                                                                            More tags = less views, due to filtering.

                                                                                          1. 5

                                                                                            Incredible article, and the “minor inconvenience” part hit very close to home - it feels stupid to write those, if necessary.

                                                                                            1. 17

                                                                                              What a cheesy name.

                                                                                              1. 16

                                                                                                I think it’s quite gouda.

                                                                                                1. 6

                                                                                                  Such a munsterous attempt at a joke.

                                                                                                  1. 2

                                                                                                    Glad to see that this place has a sense of humor, unlike that other place… :)

                                                                                                    1. 6

                                                                                                      They cantal have our levity.

                                                                                                    2. -1

                                                                                                      I’m flagging this entire chain as off-topic, and encourage others to do the same. This isn’t reddit.

                                                                                                      1. 5

                                                                                                        You mean, this place isn’t full of humourless censorious moderators who can’t distinguish between malicious trolling and good-natured pun-filled banter?

                                                                                                        I agree, and long may that continue :)

                                                                                                        In the meantime I’d suggest downing a $BEVERAGE or two and chilling the fsck out.

                                                                                                        1. 3

                                                                                                          It’s true, my comment and its replies are off-topic and that’s why I hesitated to post it at first. However, I’m not sure I see a difference between my comment and yours here, both are jokes only tangentially related to the story being discussed. Could you describe why you felt your comment had its place on lobste.rs while this comment chain doesn’t?

                                                                                                          1. 1

                                                                                                            I actually hesitated before posting that, but decided that the CSS reference within it just put it over the line into admissibility. Nobody flagged it off-topic, but in hindsight I probably shouldn’t have posted it.

                                                                                                            1. 5

                                                                                                              Lighten up, buddy.

                                                                                                  1. 11

                                                                                                    I can understand people assuming apt exists on the system because:

                                                                                                    • Most of the times they’ll be correct
                                                                                                    • People that doesn’t have apt will probably know how to find the equivalent packages in their equally bad linux package manager of choice.

                                                                                                    Can understand, too, people using a SQLite implementation for Go that doesn’t depend on CGo, because CGo has it’s own issues.

                                                                                                    Everything is hot garbage, doesn’t matter if you’re in Ubuntu or not. Don’t expect to have a gazillion of scripts that install all the dependencies in every package manager imaginable, none of those is good enough to deserve that much of attention, it won’t happen. At least apt is popular.

                                                                                                    That’s a reason Docker is so popular: It’s easier to work over an image with an specific package manager that will not change between machines. Doesn’t matter the distribution or the equally bad linux package manager of choice as long as you are on Linux and have Docker. And Dockerfiles end up being a great resource to know all the required quirks that allow the code to work.

                                                                                                    And finally:

                                                                                                    First, please stop putting your binaries in /app, please, pretty-please? We have /usr/local/bin/ for that.

                                                                                                    Never. Linux standard paths are a tragedy and will actively avoid them as much as possible. It’s about choices and avoiding monoculture, right?

                                                                                                    1. 10

                                                                                                      Linux standard paths are a tragedy and will actively avoid them as much as possible. It’s about choices and avoiding monoculture, right?

                                                                                                      No, it’s about writing software that nicely integrates with the rest of the chosen deployment method/system, not sticking random files all over the user’s machine.

                                                                                                      1. 22

                                                                                                        In this example /app is being used inside the docker image. It is most definitely not sticking random files all over the users machine.

                                                                                                        1. 4

                                                                                                          This hits a slightly wider point with the article - half the things the author is complaining about aren’t actually to do with Docker, despite the title.

                                                                                                          The ones that are part of the Docker build… don’t necessarily matter? Because their effects are limited to the Docker image, which you can simply delete or rebuild without affecting any other part of your system.

                                                                                                          I understand the author’s frustration - I’ve been through trying to compile things on systems the software wasn’t tested against, it’s a pain and it would be nice if everything was portable and cross-compatible. But I think it’s always been a reality of software maintenance that this is a difficult problem.

                                                                                                          In fact, Docker could be seen as an attempt to solve the exact problem the author is complaining about, in a way which works for a reasonable number of people. It won’t work for everyone and there are reasons not to like it or use it, but I’d prefer to give people the benefit of the doubt instead of ranting.

                                                                                                          Speaking of ranting, this comment’s getting long - but despite not really liking the tone of the article, credit to the author for raising issues and doing the productive work as well. That’s always appreciated.

                                                                                                          1. 3

                                                                                                            OP here. aww thank you! Yes as noted in the disclaimer at the top, I was very frustrated! hopefully I ported it all, now trying to clean up some code so I can make patches.

                                                                                                            According to commenters on the Yellow Site, it’s not wise to “just send a patch” or “rant”, they way it’s better to open an issue first. Which honestly I still don’t understand. Care someone explain that to me?

                                                                                                            As a open-source maintainer, I like only two types of issues. 1) here’s a bug, 2) here’s a feature request and how to implement. But if someone made an issue saying “Your code is not running on latest version of QNX”, I would rather see them “Here’s a patch that makes the code run on QNX”.

                                                                                                            Regardless, I tried an experiment and opened a “discussion issue” in one of the tools, hoping for the best.

                                                                                                            1. 3

                                                                                                              According to commenters on the Yellow Site, it’s not wise to “just send a patch” or “rant”, they way it’s better to open an issue first. Which honestly I still don’t understand. Care someone explain that to me?

                                                                                                              Receiving patches without prior discussion on the scope/goals is potentially something frustrating since basic communication can easily avoid unnecessary extra work for both maintainers but also contributors. Maybe a feature is already being worked on? Maybe they’ve had prior conversations on the topic that you couldn’t have seen? Maybe they simply don’t have the time to review things at the moment? Or maybe they won’t be able to maintain a certain contribution?

                                                                                                              Also for end-users, patches without a linked issue can be a source of frustration. Usually the MR contains discussion on the code/implementation details and issues conversation around the goals of the implementation.

                                                                                                              Of course that always depends, if you’re only contributing minor improvements/changes - a discussion is often not needed.

                                                                                                              Or in other words, as posted on ycombinator news:

                                                                                                              Sending patches directly is a non-collaborative approach to open source. Issues are made for discussion, and PRs for resolutions; as a matter of fact, some projects state this explicitly, in order to waste maintainers’ time with unproductive PRs.

                                                                                                          2. 3

                                                                                                            Exactly

                                                                                                            1. 2

                                                                                                              This is only a mediocre example, because with go there should only be one binary (or a handful of them) - but yes, if you put your software in a container, I am very happy if everything is in /app and if I want to have a look I don’t have to dissect /etc/, /usr/local and maybe /var. If the container is the sole point of packaging one app, I see no downside to ignoring the FHS and putting it all together. There’s a reason that most people do that for custom-built software (as opposed to “this container just does “apt-get install postgresql-server”, then I would expect the stuff to be there where the distro puts it)

                                                                                                        1. 4

                                                                                                          First the ‘Compact’ layout been removed.

                                                                                                          Now its PITA to change back to ‘normal’ tabs style - it should be in one switch - not a several points howto …

                                                                                                          Pity to watch Firefox starts to decline …

                                                                                                          1. 3

                                                                                                            The Proton UI is now normal. The rest is unsupported legacy code artifacts that will eventually stop working. I think it’s already non-functional in upcoming Firefox 91.

                                                                                                            1. 2

                                                                                                              The Proton UI is now default, and standard. It’s a different kind of normal.

                                                                                                          1. 6

                                                                                                            Debian has become my favorite Linux distro recently. It is surprisingly good.

                                                                                                            1. 10

                                                                                                              Why surprisingly? It’s the foundation of a lot lot lot of distros

                                                                                                              1. 5

                                                                                                                That’s interesting, because I can’t stand it. Things are changed at random so programs are different, and package management seems to like to break at random. What makes it your favourite?

                                                                                                                1. 4

                                                                                                                  I’ve been using stable since 2008. I can remember one instance where pulling in a package update broke a program: it was when Chromium switched to requiring a GPU and then had a horrid CVE that no one could backport to stable; suddenly I couldn’t use it over ssh -X any more. Hard to place much blame on Debian for that though.

                                                                                                                  I’d imagine you’d see more breakage running unstable but like … that’s literally what it says on the tin.

                                                                                                                  1. 2

                                                                                                                    What in the world? There is hardly a less “things break at random” system than Debian.

                                                                                                                    1. 2

                                                                                                                      Apache’s configs being entirely different for no reason has bitten me more than once. Still not sure why that is, it’s pretty horribly annoying.

                                                                                                                      1. 1

                                                                                                                        Why would you think it’s for no reason? Actually that’s an example of exceptional care being taken to avoid things breaking at random. It means that you can have packages that provide Apache modules, and packages that provide entire websites (say, Wordpress or netdata), and expressible dependencies between them, and they don’t step on each other, local config is never blown away by upgrading packages, and generally speaking the sysadmin doesn’t get unpleasant surprises.

                                                                                                                        Admittedly, it doesn’t really feel “different” to me, because I got used to it 20 years ago and have only rarely had to deal with Apache on systems that didn’t do it that way, but what I will say is that it works, and that it’s not arbitrary — basically all of the packaging guidelines (which amounts to a book worth of material) come from a place of “how to be predictable, reproducible, and avoid breakage”. But it is assumed that admins know their system; being different from some other distro or upstream defaults isn’t breakage in and of itself, when those differences are justified and documented (which they certainly are in the case of Apache).

                                                                                                                        1. 2

                                                                                                                          I’d rather have the config files match with examples online (and the official docs!) than have any of those features, though. What do other distros do with Apache modules? I’ve never had breakage in them and they don’t do anything like debian.

                                                                                                                      2. 1

                                                                                                                        This might have been around 2004, when I encountered a legacy Debian Stable that had missed out on a stable release. So it was like oldoldstable.

                                                                                                                        Upgraded directly to the contemporary stable and everything went perfectly, despite skipping over a major release altogether.

                                                                                                                        It was beautiful.

                                                                                                                    2. 3

                                                                                                                      It’s been mine since around 1996. I try running other operating systems but I’m so used to the availability of software, the stability of updates and the general attention to detail that I have a hard time using anything else.

                                                                                                                    1. 2

                                                                                                                      We can admit that the whole web battle is lost and move to the gemini space.

                                                                                                                      In a few years Chrome will run its own k8s instance and a Flutter v69.0.0 frontend will talk to it via gRPC and PubSub.

                                                                                                                      1. 9

                                                                                                                        The problem with Gemini is all the pages are made by other Gemini users and has useless syntax. The web wasn’t useful because it was for appealing to the aesthetics of chickenshit minimalists, it was useful because it had the ability to express information better through hypertext where Gopher wouldn’t.

                                                                                                                        1. 6

                                                                                                                          Why move to Gemini protocol? Why not just write the html you want to see, and have your friends do so too?

                                                                                                                          1. 1

                                                                                                                            Mainly because control over the web is already lost.

                                                                                                                            How can we be sure that Chrome will not refuse to render vanilla HTML pages if there are no required attributes (Google Analytics UID or similar) in your head/body/anchor tags?

                                                                                                                            Or better, imagine ANY ridiculous requirement that a single browser vendor may impose.

                                                                                                                            Writing a whole new browser that implements the web stack is expensive and will take a lot of time. So Google has reliable protective moat there.

                                                                                                                            Gemini contrary allows you to implement a client in a few hours, so the entry barrier is low.

                                                                                                                        1. 8

                                                                                                                          Oh, also: whatever approach you choose, you are going to also need to provide an ergonomic, performant animation API.

                                                                                                                          This is where I died inside. Just no. Animations are one of the most despicable developments of recent UIs. I don’t want to keep either waiting for the computer to do its trivial jobs, or distract me in general altogether. Want to make your phone faster? Disable animations!

                                                                                                                          You need to support emoji.

                                                                                                                          Also no, this is a largely pointless complication.

                                                                                                                          Async You do have nice ergonomic async support, don’t you?

                                                                                                                          What does this even mean? Win32/X11/Qt/GTK+ are all async by their sheer nature.

                                                                                                                          He’s describing an opinionated, everything-but-the-kitchen-sink approach. But a decent overview nonetheless.

                                                                                                                          1. 33

                                                                                                                            Complaints about animations an emoji sound very much like “old man yells at cloud”.

                                                                                                                            Emoji (and generally Unicode support for more than BMP) is now an expected feature of modern software.

                                                                                                                            UI animations can be done well and be helpful, and hint how UI items relate to each other spatially. It’s really weird that even low-end mobile devices have GPUs that can effortlessly animate millions of 3D triangles, but sliding a menu is considered a big effort.

                                                                                                                            1. 7

                                                                                                                              I’ve honestly never seen a single helpful UI animation in my life, other than spinning wheels and the likes, indicating that the application/system hasn’t frozen up completely. Instead of “click, click, click, be done”, things tend to shift into “click, have your attention grabbed, click, have your attention grabbed, throw your computer out of the window and go live in the woods”. GNOME Builder and GIMP 3 settings dialogues are spectacular examples of GNOME keeping digging its grave.

                                                                                                                              One would expect the computer to be a tool, rather than a work of art.

                                                                                                                              1. 19

                                                                                                                                Maybe that’s just a failing of GNOME?

                                                                                                                                For example, macOS has generally well-done animations that don’t get in the way. It tends to animate after an action, but not before. Animations are very quick, unless they’re used to hide loading time. There are also animations to bring your attention to newly created/focused elements. Reordering of elements (menu icons, tabs) is smooth. IMHO they usually add value.

                                                                                                                                Touchscreen OSes also animate majority of elements that can be swiped or dragged. The animation is not on a fixed timer, but “played” by your finger movements, so you may not think about it as an animation, but technically it is animating positions and sizes of UI elements. Users would think UI is broken if it instantly jumped instead of “sticking” under the finger.

                                                                                                                                1. 4

                                                                                                                                  Eh, macOS has sort of jumped the gun on animation, too. I’ve activated the “Reduce motion” for it because, by default, the transition between full-screen apps is done by having windows “slide” in and out of view. It’s not just slow (it takes substantially more time to do the transition that in takes to Cmd-Tab between the applications), it legit makes you dizzy if you keep switching back and forth.

                                                                                                                                  I imagine it’s taken verbatim from iPad (last macOS version I used before Big Sur was… Tiger, I think? so I’m not sure…) where it makes some sense, but I can’t for the life of me understand what’s the point of it on a thing that has a keyboard and doesn’t have a touch screen.

                                                                                                                                  1. 3

                                                                                                                                    I can’t for the life of me understand what’s the point of it on a thing that has a keyboard and doesn’t have a touch screen.

                                                                                                                                    Probably because most people will use their MacBook trackpad to swipe between full screen apps/desktops. I only rarely use the Ctrl-arrow shortcuts for that. A lot of macOS decisions make more sense when you assume the use of a trackpad rather than a mouse (which is why I’ve always found it weird they don’t ship a trackpad with iMacs by default)

                                                                                                                                    1. 1

                                                                                                                                      You can still cmd-tab between full-screen applications, which is what a lot of people actually do – a “modern” workplace easily gets you an email client, several Preview windows, a Finder window, and a spreadsheet. Trackpad swiping works great when you have two apps open, not so much when you got a bunch of them.

                                                                                                                                      When you’re on the seventh out of the fifteen invoices you got open, you kindda want to get back to the spreadsheet without seeing seven invoices again. That’s actually a bad example because full-screen windows from the same app are handled very poorly but you get the point: lots of apps, you don’t always want to see all of them before you get to the one you need…

                                                                                                                                    2. 1

                                                                                                                                      These animations are helpful, and have been shown to be so. It’s not something some asshole down at Cupertino just cooked up because he thought it would look cool. Cues as to the spatial relations of things (as the desktops have an order and you use left/right gestures to navigate them) are very valuable to a lot of people, and they even let you turn them off, I don’t really see anything worth complaining about.

                                                                                                                                      I mean there’s a lot of questionable things Apple is doing these days, but that’s not one of them.

                                                                                                                                      1. 2

                                                                                                                                        I’m not talking about desktops, but “maximized” applications (i.e. the default, full-screen maximisation you get when you press what used to be the green button).

                                                                                                                                        You get full-screen sliding animations when you Cmd-Tab between apps in this case, even though there’s no spatial relations between them, as the order in which they’re shown in the Cmd-Tab stack has nothing to do with the order in which they’re shown in Mission Control (the former is obviously mutable, since it’s in a stack, the latter is fixed).

                                                                                                                                        In fact, precisely because one’s a stack and the other one isn’t, the visual cue is wrong half the time: you switch to an application to the right of the stack, but the screen slides out to the left.

                                                                                                                                        Animation when transitioning between virtual desktops is a whole other story and yes, it makes every bit of sense there.

                                                                                                                                        and have been shown to be so.

                                                                                                                                        Do you have a study/some data for that? I know of some (I don’t have the papers at hand but I can look it up if you’re curious), but it explicitly expects only occasional use so it doesn’t even attempt to discuss the “what if you use it too much” case. So it’s not even close to applying to the use case of e.g. switching between a spreadsheet and the email client several times a minute.

                                                                                                                                        (Edit: just for the fun of it, I tried to count how often I Cmd-Tab between a terminal window and the reference manual after I ended up ticking the reduce animation box in accessibility options. I didn’t automate it so I gave up after about half an hour, at which point I was already well past 100. Even if this did encode any spatial cues, I think spatial cues are not quite as valuable as not throwing up my guts.)

                                                                                                                                  2. 9

                                                                                                                                    There are many legitimate uses for animations. Yes loading spinners are one of them, unless you think that every single operation can be performed instantly. Sliding and moving elements around on mobile especially is another one. A short animations to reveal new elements after a user action can also improve the UX.

                                                                                                                                    Not everything has to be one extreme or another - it’s not pointless animations everywhere, or no animations at all. When used well they can improve usability.

                                                                                                                                    1. 1

                                                                                                                                      Loading spinners are far from ideal though. A progress bar would be generally better so you have some idea of if it is actually still working and how far is left to go. Or anything else that provides similar information.

                                                                                                                                      I’ve seen so many times when a loading spinner sits there spinning forever because, for example, the wifi disconnected. The animation then is misleading, since it will never complete.

                                                                                                                                      1. 4

                                                                                                                                        That’s an entirely different loading element. You can have animated progress bar. And when progress is indeterminate a spinner makes the most sense. A spinner not stopping on error is a UI bug, not a problem with the concept. If you want to get mad at bad design, how about programming languages and paradigms that don’t make you explicitly handle errors to get in this state.

                                                                                                                                      2. 1

                                                                                                                                        The standard way of indicating length is to say so to the user, and possibly add a progress bar, for when progress can be sensibly measured. Like adding a spinner, it needs to be done explicitly. Revealing new elements can be done responsively by improving the design–the standard way is by turning an arrow.

                                                                                                                                        The notion of phones invading GUIs, as x64k hinted at, is interesting here (though not new). Transplanting things that do not belong, just because of familiarity.

                                                                                                                                        Going back to the article, it said I needed to. I don’t. And still, I can make anything I desire with the toolkit, with no real change to the required effort. Except for “modern” IM, when I don’t care to implement pictures as pseudo-characters.

                                                                                                                                      3. 7

                                                                                                                                        One would expect the computer to be a tool, rather than a work of art.

                                                                                                                                        The computers I remember most fondly all had some qualities of art in it. Sometimes in the hardware, others in the software, and the ones I like the most had it in both.

                                                                                                                                        Animations are important in devices in which there is mostly visual feedback. Most computers don’t have haptics, and we often get annoyed at audio feedback. Visual cues that an action was performed or that something happened are important. There is a difference between UI animation and a firework explosion in the corner of the app.

                                                                                                                                        1. 5

                                                                                                                                          One would expect the computer to be a tool, rather than a work of art.

                                                                                                                                          You, me, and everybody in this thread is in the top 0.001% of computer power users. What’s important to us is totally different than what’s important to the rest of the population. Most normies I talk to value pleasing UIs. If you want to appeal to them, you’re going to need animations.

                                                                                                                                          1. 6

                                                                                                                                            I’d argue even further that the 0.001% of computer power users also need animations. When done well, animations really effectively convey state changes in a way that speaks to our psychology. A great example is that when I scroll a full page in my web browser, the brief scroll animation shows my brain how where I am now relates to where I was a split second ago. Contrast this to TUIs which scroll by a full page in a single frame. It’s easy to consciously believe that we can do without things like animations, but I’m pretty sure that all the little immediate state changes can add up to a subperceptual bit of cognitive load that nevertheless can be fatiguing.

                                                                                                                                            1. 2

                                                                                                                                              I think good animations are ‘invisible’, but bad ones aren’t. So people remember the bad more than the good.

                                                                                                                                        2. 3

                                                                                                                                          UI animations can be done well

                                                                                                                                          Absolutely. I love the subtle animations in iOS. Like when I long-press on the brightness slider to access more controls like the dark mode toggle. I’m already making an action that takes more time than a simple tap, and the OS responds with a perfectly timed animation to indicate that my action is being processed.

                                                                                                                                          On the other hand, animations can be very easily abused. Plenty of examples, like today’s Grumpy Website post, show animations that hinder accessibility. I think the cases where animation goes wrong are where it was thrown in only because “it’s modern” rather than primarily as a means to convey information.

                                                                                                                                        3. 15

                                                                                                                                          I respectfully disagree with your opinion about animations. There are lots of times when I genuinely feel that the animation is important and actually conveys information. For example, the Exposè-style interface in macOS and GNOME is much better since the windows animate from their “physical” locations to their “overview” locations; the animation provides important context about which windows went where, so your eyes get to track the moving objects. It also helps that those animations track your finger movements on the trackpad perfectly, with one pixel of movement per tiny distance travelled across the trackpad (though the animation also has value when triggered using a hotkey IMO).

                                                                                                                                          But there’s definitely a lot of software which over-uses animations. The cardinal sin of a lot of GUI animations is to make the user wait for your flashy effects. A lot of Apple’s and GNOME’s animations do fit this description, as well as arguably most animations in general. So I think a GUI framework needs a robust animation system for when it’s appropriate, but application programmers must show much more discretion about when and how they choose to use animations. For example, I’m currently in Safari on macOS, and when I do the pinch gesture to show an overview of all the tabs, I have to wait far too long for the machine to finish its way too flashy zoom animation until I actually get the information I need in order to interact further.

                                                                                                                                          1. 6

                                                                                                                                            Bad news, even smooth scrolling is a kind of animation.

                                                                                                                                            1. 2

                                                                                                                                              I’ll admit, this is an improvement in the browser. Bumping my counter to one case of a useful animation.

                                                                                                                                            2. 3

                                                                                                                                              What does this even mean? Win32/X11/Qt/GTK+ are all async by their sheer nature.

                                                                                                                                              Not really. It is very easy to block the event loop with various other calls (including things like clipboard which like the thing said is async under the hood on X, but qt and gtk don’t present it that way). The gui thing needs to have some way for other operations to hook into the event loop so you can avoid blocking.

                                                                                                                                              Not terribly difficult but still you do need to at least think about it, it isn’t fully automatic. (Even on Windows, where it is heavenly bliss compared to unix, you do still need to call a function in your loop like SleepEx to opt into some additional sync processing.)

                                                                                                                                              1. 2

                                                                                                                                                GTK+ does present clipboard retrieval asynchronously, see https://docs.gtk.org/gtk3/method.Clipboard.request_contents.html which contains a callback argument–that much I remember. Setting clipboard contents can be done blindly, you can have ownership snatched at any moment.

                                                                                                                                                Going the way of recursive event loops requires caution that I would avoid imparting on users as much as possible, in particular because of callbacks vs state hell. Typically, this is reserved for modal dialogues, and the API user knows what they’re dealing with.

                                                                                                                                                There’s also the possibility of processing the event pump selectively, though that’s another thing you don’t want to do to yourself.

                                                                                                                                              2. 1

                                                                                                                                                Want to make your phone faster? Disable animations!

                                                                                                                                                This is generally the point of animations as a UX feature - they mask the slow operation of applications with a silly animation to keep you distracted/indicate a process is occurring. Want to notice when your app is using a jpeg to pretend it’s loaded? Disable animations!

                                                                                                                                                1. 21

                                                                                                                                                  It’s not only that. The human visual system is very good at tracking movement, much worse at noting that a thing has disappeared and reappeared. If a thing disappears, you’ll typically notice quickly but not immediately be aware of what has disappeared. If you animate movement then there’s lower cognitive load because a part of your brain that evolved to track prey / predators is used rather than anything related to understanding the context of the application.

                                                                                                                                                  1. 4

                                                                                                                                                    This is it exactly. The human visual system evolved in a world where things don’t instantly flicker out of existence or appear out of nothing.

                                                                                                                                                  2. 2

                                                                                                                                                    I don’t think OP is talking about things like progress bars and spinning indicators, which are pretty legitimate everywhere, but things like “gliding” page transitions between application screens. If a framework is indeed so slow that you notice it rendering widgets, an animation API will help now and then, but won’t make that big a dent. (Edit: also, unless you’re loading things off a network, loading JPEGs cannot be a problem anymore, it hasn’t been a problem in twenty years!)

                                                                                                                                                    I do think this piece could’ve been more aptly titled “so you want to write a GUI framework for smartphones”. Animations are important on touch screen driven by gestures (e.g. swiping) – gestures are failure-prone, they need incremental feedback and so on, plus nobody who’s not high on their 2013-era post-PC supply expects efficiency out of phone UIs.

                                                                                                                                                    But they are pretty cringy on desktop. E.g. KDE’s Control Center (and many Kirigami apps) has an annoying misfeature, where you click “back” and the page moves out of view as if you’d swiped it. But you didn’t swipe. Regardless of what you think about animation, it’s not even the right animation.

                                                                                                                                                    That’s why so many people see them as useless eye candy. If you go all Borg on it and only think in absolute terms, you get a very Borg user experience.

                                                                                                                                                    Edit: yes, I know, “a modern GUI toolkit” should have all these things. The point is you can drop a lot of them and still write useful and efficient applications. Just because Google is doing something on Android doesn’t mean everyone has to do it everywhere.

                                                                                                                                                    1. 3

                                                                                                                                                      It’s funny you mention page transitions. I have my ebook reader set up to do a 200ms-ish animation when I tap the ‘next page’ button where the current page slides off to the left and the next one slides in from the right. It has an option to disable it, but I actually find that disorienting in this vague way I can’t explain. But on my desktop, it’s fine with no animations.

                                                                                                                                                    2. 1

                                                                                                                                                      Empirically, that is not how it’s used. This masking is a minority of use cases, and even then it’s bad. To some people that aren’t me, it might be better described as “eye candy” and “smoothness”.

                                                                                                                                                      Being able to disable this irritation is being lucky, e.g. it’s CSS-hardcoded in Firefox and GTK+ (/org/gnome/desktop/interface/enable-animations only works partially).

                                                                                                                                                    3. 1

                                                                                                                                                      What does this even mean? Win32/X11/Qt/GTK+ are all async by their sheer nature.

                                                                                                                                                      I think they’re talking about Rust async, since this is all in the context of writing a cross-platform GUI toolkit in Rust. This is more of a problem than it seems because if you’re doing a cross-platform toolkit that uses native widgets, it’s not at all trivial to impedance-match whatever model the native widget toolkit uses behind the scenes with your toolkit, which exposes an async model.

                                                                                                                                                      (Edit: there are some additional complications here, too. For example there are toolkits that (generally) async, but still do some operations synchronously. The author mentions the copy-paste API as an example.)

                                                                                                                                                      One might conclude that it’s better to not do any of that and instead expose the platform’s intended programming model, as second-guessing thirty year-old code bases tends to backfire spectacularly, but maybe I’m just being grumpy here…

                                                                                                                                                    1. 8

                                                                                                                                                      I generally strongly dislike the “falsehoods programmers believe…” genre of post because so few of them contain useful actionable advice (i.e., they’re all “these things are wrong”, with little or no “here’s something right or at least better that you could do instead”) and many of them don’t even bother to provide counterexamples to the “falsehoods” they’re calling out.

                                                                                                                                                      This one is a step up from the usual in that the author has provided examples and taken the time to add suggestions for how to handle phone numbers in a better way.

                                                                                                                                                      (though a common theme of all “falsehoods” articles is that complex things are actually complex, and that one-size-fits-all solutions neither fit all nor solve the problem, and very often the real correct answer is to determine which cases are appropriate for your software to handle, rather than trying to write something truly universal, because the only universal solution will be a freeform text field with no parsing or validation)

                                                                                                                                                      1. 5

                                                                                                                                                        The solution in this case is to use libphonenumber or one of it’s many ports.

                                                                                                                                                        1. 4

                                                                                                                                                          Yes, I think it is easy to miss this is a file in libphonenumber’s root.

                                                                                                                                                          1. 1

                                                                                                                                                            Indeed, though I agree edge cases are not falsehoods.

                                                                                                                                                            If you happen to use FreeSWITCH, a while back, I’ve created this module https://github.com/rtckit/mod_phonenumber