Threads for zimpenfish

  1. 2

    I think it can be golfed a bit further at the cost of some readability.

    jq -Rn '[inputs|{"name":sub("^.+/";"")}]'

    rjp@CyanistesCyanus ~ $ cat names.txt
    SAP-samples/cloud-sdk-js
    SAP-samples/cloud-cap-samples-java
    SAP-samples/btp-setup-automator
    SAP-samples/btp-ai-sustainability-bootcamp
    SAP-samples/cloud-cap-samples
    SAP-samples/ui5-exercises-codejam
    SAP-samples/cap-sflight
    SAP-samples/cloud-cf-feature-flags-sample
    SAP-samples/cloud-espm-cloud-native
    SAP-samples/iot-edge-samples
    rjp@CyanistesCyanus ~ $ jq -cRn '[inputs|{"name":sub("^.+/";"")}]' < names.txt
    [{"name":"cloud-sdk-js"},{"name":"cloud-cap-samples-java"},{"name":"btp-setup-automator"},{"name":"btp-ai-sustainability-bootcamp"},{"name":"cloud-cap-samples"},{"name":"ui5-exercises-codejam"},{"name":"cap-sflight"},{"name":"cloud-cf-feature-flags-sample"},{"name":"cloud-espm-cloud-native"},{"name":"iot-edge-samples"}]
    
    1. 3

      Lovely! It’s funny, I feel as thought I’m on the cusp of golfing here, but not quite. That’s not the aim of this post (or the one I’ve just written), though - it’s more to explain the filter, with the hope that there’s some demystification for some folks that might lead to them trying jq.

    1. 3

      Been dealing with some code this week that uses the “single return” pattern … by having a “goto out” jumping to the end if there’s an error higher up in the function. Makes life annoying because Go really objects to you jumping over variable declarations which means everything needs to be a var xyz at the top instead of where they would naturally be declared in scope.

      1. 5

        goto out is common in C, where it is roughly equivalent to go’s defer. Using it in go that has defer is silly of course…

      1. 3

        One suggestion is to rebind the default prefix (C-b) to C-z instead: while C-b moves backwards one character in the default shell config (and hence I use it all the time), C-z backgrounds a job, which I do rarely enough that typing C-z z to do so is perfectly fine.

        1. 5

          I background+foreground jobs pretty frequently. So I need C-z to be free.

          Personally I set my prefix to C-a.
          I think it’s usually used to go to the start of the input line in most shells by default, but I set -o vi in my shell so that doesn’t apply to me.

          A friend of mine sets their prefix to a backtick. Which I thought was interesting, but I like to use backticks now and then…

          1. 7

            C-a is a super common choice, as it’s the same prefix that screen uses by default. The screen folks, in turn, either had the right idea or it was a pretty lucky guess: C-a takes you to the beginning of the line, which is not needed too frequently in a shell.

            On the other hand it’s the “go to the beginning of the line” in Emacs, too so, uhh, I use C-o for tmux. I suppose it might be a good choice for the unenlightened vim users out there :-).

            Another prefix binding that I found to be pretty good is C-t. Normally, it swaps two characters before the cursor, a pretty neat thing to have over really slow connections but also frequently unused. Back when I used Ratpoison, I used it as the Ratpoison prefix key.

            I think C-i (normally that’s a Tab) and C-v (escape the next character) are also pretty good, particularly the former one, since Tab is easily reachable from the home row and available on pretty much any keyboard not from outer space.

            I’ve no idea why I spent so much time thinking about these things, really. Yep, I’m really fun at parties!

            1. 2

              I use C-o for tmux

              Yeah, I’ve used C-o for screen since I guess the mid-90s because I couldn’t deal with C-a being snarfed, possibly because I was using a lot of terminal programs which used emacs keybindings at the time… Now I’m slowly moving over to tmux and keeping the C-o even though I rarely use anything terminal-based these days.

              1. 1

                C-o is pretty important in vim actually. Personally I use M-t, which doesn’t conflict with any vim bindings (vim doesn’t use any alt/meta bindings by default) or any of my i3 bindings (I do use alt for my i3 super key)

                1. 1

                  Oh, I had no idea, the Church of Emacs does not let us meddle with the vim simpletons, nor dirty our hands with their sub-par editor :-P. I just googled it and, uh, yeah, it seems important, I stand corrected!

              2. 2

                Personally I set my prefix to C-a. I think it’s usually used to go to the start of the input line in most shells by default …

                And in Emacs; I use it multiple times an hour, so unfortunately that is out for me.

                I think that I have experimented with backtick in screen, after I started using Emacs. I have a vague memory of problems when copy-pasting lines of shell which led me to use C-z instead.

                1. 2

                  I’ve used C-a in screen for ages and carried it over tmux. Hitting. C-a a to get to the start of the line is so ingrained now that it trips me up when I’m not using tmux.

              3. 2

                I just use C-a, primarily because I moved to tmux from using screen, which uses that binding for the prefix.

                1. 1

                  Yeah I found C-a much better than C-b, much less of a stretch, but eventually I started getting firearm pain in my left arm from all the pinky action. I’ve moved to M-t, most often using right hand for alt and left hand for t.

                2. 1

                  C-f

                  1. 1

                    Unfortunately that is forward-char🙂

                    1. 1

                      the lesser of all evil

                  2. 1

                    I use C-q. It’s extremely easy for me to hit the keys together, since I remap capslock to be control, and is quite comfortable.

                    This leads to fun when I accidentally killed my other applications, but at this point it’s ingrained so I don’t mess up.

                    1. 1

                      Interesting! I might give that a shot. I do use C-q to quote characters, but not that often, only once or twice every couple of days.

                  1. 2

                    Not mentioned in the article, but things get much simpler if you don’t need fifo behaviour. In practice, I’ve seen projects rarely need that. In that case you don’t need the subquery for ordering. Just update ... limit 1 ... returning and as long as you have enough workers, it’s going to be good enough.

                    1. 1

                      Do you know if that works in sqlite? I have something that’s not very performance intensive that I would like to work in sqlite, and doesn’t need LIFO

                      1. 2

                        Since 3.35.0 (https://www.sqlite.org/lang_returning.html). I’ve got something which does

                        update $table set done=datetime('now','-2000 days') where ( done is null or done='' ) returning substr(id, 10), date(published), title limit 1;

                        as a “get me something which isn’t done yet and flag it as being processed” (currently working in 3.37.0 2021-11-27 14:13:22 bd41822c)

                        1. 1

                          Never tried, but it seems to support all the relevant syntax and there can be only one writer at a time, so it should be safe.

                      1. 17

                        SQLite is my go-to for small to medium size webapps that could reasonably run on a single server. It is zero effort to set up. If you need a higher performance DB, you probably need to scale past a single server anyway, and then you have a whole bunch of other scaling issues, where you need a web cache and other stuff anyway.

                        1. 5

                          Reasons not to do that are handling backup at a different place than the application, good inspection tools while your app runs, perf optimization things (also “shared” memory usage with one big dbms instance) you can’t do in sqlite and the easier path for migrating to a multi-machine setup. Lastly you’ll also get separation of concerns, allowing you to split up some parts of your up into different permission levels.

                          1. 5

                            Regarding backups: what’s wrong with the .backup command

                            1. 1

                              If I’m reading that right you’ll have to implement that into your application. postgres/mariadb can be backed up (and restored) without any application interaction. Thus it can also be performed by a specialized backup user (making it also a little bit more secure).

                              1. 12

                                As far as I know, you can use the sqlite3 CLI tool to run .backup while your application is still running. I think it’s fine if you have multiple readers while one process is writing to the DB.

                                1. 5

                                  Yes, provided you use WAL mode, which you should probably do anyway.

                                2. 7

                                  You could use litestream to stream your SQLite changes to local and offsite backups. Works pretty well.

                                  1. 7

                                    Ok but instead of adding another dependency that solves the shortcomings of not using a DBMS (and I’ll also have to care about) I could instead use a DBMS.

                                    1. 6

                                      OK, but then you need to administer a DBMS server, with security, performance, testing, and other implications. The point is that there are tradeoffs and that SQLite offers a simple one for many applications.

                                      1. 3

                                        Not just that, but what exactly are the problems that make someone need a DBMS server? Sqlite3 is thread safe and for remote replication you can just use something like https://www.symmetricds.org/, right? Even then, you can safely store data up to a couple of terabytes in a single Sqlite3 server, too, and it’s pretty fault tolerant by itself. Am I missing something here?

                                        1. 2

                                          What does a “single sqlite3 server” mean in the context of an embedded database?

                                          How do you run N copies of your application for HA/operational purposes when the database is “glued with only one instance of the application”?

                                          It’s far from easy in my experience.

                                          1. 2

                                            My experience has been that managing Postgres replication is also far from easy (though to be fair, Amazon will now do this for you if you’re willing to pay for it).

                                          2. 1

                                            SymmetricDS supports many databases and can replicate across different databases, including Oracle, MySQL, MariaDB, PostgreSQL, MS SQL Server (including Azure), IBM DB2 (UDB, iSeries, and zSeries), H2, HSQLDB, Derby, Firebird, Interbase, Informix, Greenplum, SQLite, Sybase ASE, Sybase ASA (SQL Anywhere), Amazon Redshift, MongoDB, and VoltDB databases.

                                            This seems quite remarkable - any experience with it?

                                        2. 3

                                          Where do you see the difference between litestream and a tool to backup Postgres/MariaDB? Last time I checked my self-hosted Postgres instance didn’t backup itself.

                                          1. 1

                                            You have a point but nearly every dbms hoster has automatic backups and I know many backup solutions that automate this. I am running stuff only by myself though (no SaaS)

                                      2. 6

                                        No, it’s fine to open a SQLite database in another process, such as the CLI. And as long as you use WAL mode, a writer doesn’t interrupt a reader, and a reader can use a RO transaction to operate on a consistent snapshot of the database.

                                1. 6

                                  A slightly related Go nit, the case of structure members determines whether they’re exported or not. It’s crazy, why not explicitly add a private keyword or something?

                                  1. 19

                                    why not explicitly add a private keyword or something?

                                    Because capitalization does the same thing with less ceremony. It’s not crazy. It’s just a design decision.

                                    1. 4

                                      And limiting variable names to just “x”, “y” and “z” are also simpler and much less ceremony than typing out full variable names

                                      1. 1

                                        I’m not sure how this relates. Is your claim that the loss of semantic information that comes with terse identifiers is comparable to the difference between type Foo struct and e.g. type public foo struct?

                                        1. 1

                                          That is actually a Go convention, too. Two-letter or three-letter variable names like cs instead of customerService.

                                      2. 6

                                        This would be a more substantive comment chain if you can express why it’s crazy, not just calling it crazy. Why is it important that it should be a private keyword “or something”? In Go, the “or something” is literally the case sensitive member name…which is an explicit way of expressing whether it’s exported or not. How much more explicit can you get than a phenotypical designation? You can look at the member name and know then and there whether it’s exported. An implicit export would require the reader to look at the member name and at least one other source to figure out if it’s exported.

                                        1. 7

                                          It’s bad because changing the visibility of a member requires renaming it, which requires finding and updating every caller. This is an annoying manual task if your editor doesn’t do automatic refactoring, and it pollutes patches with many tiny one-character diffs.

                                          It reminds me of old versions of Fortran where variables that started with I, J, K L or M were automatically integers and the rest were real. 🙄

                                          1. 5

                                            M-x lsp-rename

                                            I don’t think of those changes as patch pollution — I think of them as opportunities to see where something formerly private is now exposed. E.g. when a var was unexported I knew that my package controlled it, but if I export it now it is mutable outside my control — it is good to see that in the diff.

                                            1. 2

                                              I guess I don’t consider changing the capitalization of a letter as renaming the variable

                                              1. 2

                                                That’s not the point. The point is you have to edit every place that variable/function appears in the source.

                                                1. 3

                                                  I was going to suggest that gofmt‘s pattern rewriting would help here but it seems you can’t limit it to a type (although gofmt -r 'oldname -> Oldname' works if the fieldname is unique enough.) Then I was going to suggest gorename which can limit to struct fields but apparently hasn’t been updated to work with modules. Apparently gopls is the new hotness but testing that, despite the “it’ll rename throughout a package”, when I tested it, specifying main.go:9:9 Oldname only fixed it (correctly!) in main.go, not the other files in the main package.

                                                  In summary, this is all a bit of a mess from the Go camp.

                                                  1. 1

                                                    It looks like rsc’s experimental “refactor” can do this - successfully renamed a field in multiple files for me with rf 'mv Fish.name Fish.Name'.

                                            2. 5

                                              The author of the submitted article wrote a sequel article, Go’ing Insane Part Two: Partial Privacy. It includes a section Privacy via Capitalisation that details what they find frustrating about the feature.

                                            3. 4

                                              A slightly related not-Go nit, the private keyword determines whether struct fields are exported or not. It’s crazy, why not just use the case of the field names saving everyone some keypresses?

                                              1. 2

                                                I really appreciate it, and find myself missing it on every other language. To be honest, I have difficulty understanding why folding would want anything else.

                                                1. 2

                                                  On the contrary, I rather like that it’s obvious in all cases whether something is exported or not without having to find the actual definition.

                                                1. 35

                                                  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. 18

                                                    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. 32

                                                      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. 5

                                                          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. 10

                                                        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. 7

                                                          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. 6

                                                                      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. 10

                                                                        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. 19

                                                                              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. 8

                                                                                  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. 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 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. 3

                                                                                        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. 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

                                                                                        3. 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. 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. 3

                                                                                            on the contrary, google provides a ton of ramp up time for new hires because getting to grips with all the internal infrastructure takes a while (the language is the least part of it). indeed, when I joined a standard part of the orientation lecture was that whatever our experience level was, we should not expect to be productive any time soon.

                                                                                            what go (which I do not use very much) might be optimising for is a certain straightforwardness and uniformity in the code base, so that engineers can move between projects without having to learn essentially a new DSL every time they do.

                                                                                            1. 1

                                                                                              You may have a misconception that good programming languages force people to ‘essentially learn a new DSL’ in every project. In any case, as you yourself said, the language is the least part of the ramp-up of a new project, so even if that bit were true, it’s still optimizing for the wrong thing.

                                                                                              1. 1

                                                                                                no, you misunderstood what i was getting at. i was saying that go was optimisng for straightforwardness and uniformity so that there would be less chance of complex projects evolving their own way of doing things, not that better languages would force people to invent their own DSLs per project.

                                                                                                also the ramp-up time i was referring to was for new hires; a lot of google’s internal libraries and services are pretty consistently used across projects (and even languages via bindings and RPC) so changing teams requires a lot less ramp up than joining google in the first place.

                                                                                                1. 1

                                                                                                  i was saying that go was optimisng for straightforwardness and uniformity so that there would be less chance of complex projects evolving their own way of doing things,

                                                                                                  Again, the chances of that happening are not really as great as the Go people seem to be afraid it is, provided we are talking about a reasonable, good language. So let’s say we leave out Haskell or Clojure. The fear of language-enabled complexity seems pretty overblown to me. Especially considering the effort put into the response, creating an entirely new language and surrounding ecosystem.

                                                                                    2. 9

                                                                                      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. 4

                                                                                          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. 4

                                                                                            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. 3

                                                                                          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. 13

                                                                                        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. 8

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

                                                                                          1. 9

                                                                                            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. 10

                                                                                            Q: Why choose Docker or Podman over Nix or Guix?

                                                                                            Edit with some rephrasing: why run containers over a binary cache? They can both do somewhat similar things in creating a reproductible build (so long as you aren’t apt upgradeing in your container’s config file) and laying out how to glue you different services together, but is there a massive advantage with one on the other?

                                                                                            1. 28

                                                                                              I can’t speak for the OP, but for myself there are three reasons:

                                                                                              1. Docker for Mac is just so damn easy. I don’t have to think about a VM or anything else. It Just Works. I know Nix works natively on Mac (I’ve never tried Guix), but while I do development on a Mac, I’m almost always targeting Linux, so that’s the platform that matters.

                                                                                              2. The consumers of my images don’t use Nix or Guix, they use Docker. I use Docker for CI (GitHub Actions) and to ship software. In both cases, Docker requires no additional effort on my part or on the part of my users. In some cases I literally can’t use Nix. For example, if I need to run something on a cluster controlled by another organization there is literally no chance they’re going to install Nix for me, but they already have Docker (or Podman) available.

                                                                                              3. This is minor, I’m sure I could get over it, but I’ve written a Nix config before and I found the language completely inscrutable. The Dockerfile “language”, while technically inferior, is incredibly simple and leverages shell commands I already know.

                                                                                              1. 15

                                                                                                I am not a nix fan, quite the opposite, I hate it with a passion, but I will point out that you can generate OCI images (docker/podman) from nix. Basically you can use it as a Dockerfile replacement. So you don’t need nix deployed in production, although you do need it for development.

                                                                                                1. 8

                                                                                                  As someone who is about to jump into nixos, Id love to read more about why you hate nix.

                                                                                                  1. 19

                                                                                                    I’m not the previous commenter but I will share my opinion. I’ve given nix two solid tries, but both times walked away. I love declarative configuration and really wanted it to work for me, but it doesn’t.

                                                                                                    1. the nix language is inscrutable (to use the term from a comment above). I know a half dozen languages pretty well and still found it awkward to use
                                                                                                    2. in order to make package configs declarative the config options need to be ported to the nix language. This inevitably means they’ll be out of date or maybe missing a config option you want to set.
                                                                                                    3. the docs could be much better, but this is typical. You generally resort to looking at the package configs in the source repo
                                                                                                    4. nix packages, because of the design of the system, has no connection to real package versions. This is the killer for me, since the rest of the world works on these version numbers. If I want to upgrade from v1.0 to v1.1 there is no direct correlation in nix except for a SHA. How do you find that out? Look at the source repo again.
                                                                                                    1. 4

                                                                                                      This speaks to my experience with Nix too. I want to like it. I get why it’s cool. I also think the language is inscrutable (for Xooglers, the best analogy is borgcfg) and the thing I want most is to define my /etc files in their native tongue under version control and for it all to work out rather than depend on Nix rendering the same files. I could even live with Nix-the-language if that were the case.

                                                                                                      1. 3

                                                                                                        I also think the language is inscrutable (for Xooglers, the best analogy is borgcfg)

                                                                                                        As a former Google SRE, I completely agree—GCL has a lot of quirks. On the other hand, nothing outside Google compares, and I miss it dearly. Abstracting complex configuration outside the Google ecosystem just sucks.

                                                                                                        Yes, open tools exist that try to solve this problem. But only gcl2db can load a config file into an interactive interface where you can navigate the entire hierarchy of values, with traces describing every file:line that contributed to the value at a given path. When GCL does something weird, gcl2db will tell you exactly what happened.

                                                                                                      2. 2

                                                                                                        Thanks for the reply. I’m actually not a huge fan of DSLs so this might be swaying me away from setting up nixos. I have a VM setup with it and tbh the though of me trolling through nix docs to figure out the magical phrase to do what I want does not sound like much fun. I’ll stick with arch for now.

                                                                                                        1. 6

                                                                                                          If you want the nix features but a general purpose language, guix is very similar but uses scheme to configure.

                                                                                                          1. 1

                                                                                                            I would love to use Guix, but lack of nonfree is killer as getting Steam running is a must. There’s no precedence for it being used in the unjamming communities I participate in, where as Nix is has sizable following.

                                                                                                            1. 2

                                                                                                              So use Ubuntu as the host OS for Guix if you need Steam to work. Guix runs well on many OS

                                                                                                      3. 10

                                                                                                        Sorry for the very late reply. The problem I have with nixos is that it’s anti-abstraction in the sense that I elaborated on here. Instead it’s just the ultimate wrapper.

                                                                                                        To me, the point of a distribution is to provide an algebra of packages that’s invariant in changes of state. Or to reverse this idea, an instance of a distribution is anything with a morphism to the category of packages.

                                                                                                        Nix (and nixos) is the ultimate antithesis of this idea. It’s not a morphism, it’s a homomorphism. The structure is algebraic, but it’s concrete, not abstract.

                                                                                                        People claim that “declarative” configuration is good, and it’s hard to attack such a belief, but people don’t really agree on what really means. In Haskell it means that expressions have referential transparency, which is a good thing, but in other contexts when I hear people talk about declarative stuff I immediately shiver expecting the inevitable pain. You can “declare” anything if you are precise enough, and that’s what nix does, it’s very precise, but what matters is not the declarations, but the interactions and in nix interaction means copying sha256 hashes in an esoteric programming language. This is painful and as far away from abstraction as you can get.

                                                                                                        Also notice that I said packages. Nix doesn’t have packages at all. It’s a glorified build system wrapper for source code. Binaries only come as a side effect, and there are no first class packages. The separation between pre-build artefacts and post-build artefacts is what can enable the algebraic properties of package managers to exist, and nix renounces this phase distinction with prejudice.

                                                                                                        To come to another point, I don’t like how Debian (or you other favorite distribution) chooses options and dependencies for building their packages, but the fact that it’s just One Way is far more important to me than a spurious dependency. Nix, on the other hand, encourages pets. Just customize the build options that you want to get what you want! What I want is a standard environment, customizability is a nightmare, an anti-feature.

                                                                                                        When I buy a book, I want to go to a book store and ask for the book I want. With nix I have to go to a printing press and provide instructions for printing the book I want. This is insanity. This is not progress. People say this is good because I can print my book into virgin red papyrus. I say it is bad exactly for the same reason. Also, I don’t want all my prints to be dated January 1, 1970.

                                                                                                    2. 8

                                                                                                      For me personally, I never chose Docker; it was chosen for me by my employer. I could maybe theoretically replace it with podman because it’s compatible with the same image format, which Guix (which is much better designed overall) is not. (But I don’t use the desktop docker stuff at all so I don’t really care that much; mostly I’d like to switch off docker-compose, which I have no idea whether podman can replace.)

                                                                                                      1. 3

                                                                                                        FWIW Podman does have a podman-compose functionality but it works differently. It uses k8s under the hood, so in that sense some people prefer it.

                                                                                                      2. 2

                                                                                                        This quite nicely sums up for me 😄 and more eloquently than I could put it.

                                                                                                        1. 2

                                                                                                          If you’re targeting Linux why aren’t you using a platform that supports running & building Linux software natively like Windows or even Linux?

                                                                                                          1. 12

                                                                                                            … to call WSL ‘native’ compared to running containers/etc via VMs on non-linux OS’s is a bit weird.

                                                                                                            1. 11

                                                                                                              I enjoy using a Mac, and it’s close enough that it’s almost never a problem. I was a Linux user for ~15 years and I just got tired of things only sorta-kinda working. Your experiences certainly might be different, but I find using a Mac to be an almost entirely painless experience. It also plays quite nicely with my iPhone. Windows isn’t a consideration, every time I sit down in front of a Windows machine I end up miserable (again, YMMV, I know lots of people who use Windows productively).

                                                                                                              1. 3

                                                                                                                Because “targeting Linux” really just means “running on a Linux server, somewhere” for many people and they’re not writing specifically Linux code - I spend all day writing Go on a mac that will eventually be run on a Linux box but there’s absolutely nothing Linux specific about it - why would I need Linux to do that?

                                                                                                                1. 2

                                                                                                                  WSL2-based containers run a lightweight Linux install on top of Hyper-V. Docker for Mac runs a lightweight Linux install on top of xhyve. I guess you could argue that this is different because Hyper-V is a type-1 hypervisor, whereas xhyve is a type-2 hypervisor using the hypervisor framework that macOS provides, but I’m not sure that either really counts as more ‘native’.

                                                                                                                  If your development is not Linux-specific, then XNU provides a more complete and compliant POSIX system than WSL1, which are the native kernel POSIX interfaces for macOS and Windows, respectively.

                                                                                                              2. 9

                                                                                                                Prod runs containers, not Nix, and the goal is to run the exact same build artifacts in Dev that will eventually run in Prod.

                                                                                                                1. 8

                                                                                                                  Lots of people distribute dockerfiles and docker-compose configurations. Podman and podman-compose can consume those mostly unchanged. I already understand docker. So I can both use things other people make and roll new things without using my novelty budget for building and running things in a container, which is basically a solved problem from my perspective.

                                                                                                                  Nix or Guix are new to me and would therefore consume my novelty budget, and no one has ever articulated how using my limited novelty budget that way would improve things for me (at least not in any way that has resonated with me).

                                                                                                                  Anyone else’s answer is likely to vary, of course. But that’s why I continue to choose dockerfiles and docker-compose files, whether it’s with docker or podman, rather than Nix or Guix.

                                                                                                                  1. 5

                                                                                                                    Not mentioned in other comments, but you also get process / resource isolation by default on docker/podman. Sure, you can configure service networking, cgroups, namespaces on nix yourself, just like any other system and setup the relevant network proxying. But getting that prepackaged and on by default is very handy.

                                                                                                                    1. 2

                                                                                                                      You can get a good way there without much fuss with using the Declarative NixOS containers feature (which uses systemd-nspawn under the hood).

                                                                                                                    2. 4

                                                                                                                      I’m not very familiar with Nix, but I feel like a Nix-based option could do for you what a single container could do, giving you the reproducibility of environment. What I don’t see how to do is something comparable to creating a stack of containers, such as you get from Docker Compose or Docker Swarm. And that’s considerably simpler than the kinds of auto-provisioning and wiring up that systems like Kubernetes give you. Perhaps that’s what Nix Flakes are about?

                                                                                                                      That said I am definitely feeling like Docker for reproducible developer environments is very heavy, especially on Mac. We spend a significant amount of time rebuilding containers due to code changes. Nix would probably be a better solution for this, since there’s not really an entire virtual machine and assorted filesystem layering technology in between us and the code we’re trying to run.

                                                                                                                      1. 3

                                                                                                                        Is Nix a container system…? I though it was a package manager?

                                                                                                                        1. 3

                                                                                                                          It’s not, but I understand the questions as “you can run a well defined nix configuration which includes your app or a container with your app; they’re both reproducible so why choose one of the over the other?”

                                                                                                                        2. 1

                                                                                                                          It’s possible to generate Docker images using Nix, at least, so you could use Nix for that if you wanted (and users won’t know that it’s Nix).

                                                                                                                          1. 1

                                                                                                                            These aren’t mutually exclusive. I run a few Nix VMs for self-hosting various services, and a number of those services are docker images provided by the upstream project that I use Nix to provision, configure, and run. Configuring Nix to run an image with hash XXXX from Docker registry YYYY and such-and-such environment variables doesn’t look all that different from configuring it to run a non-containerized piece of software.

                                                                                                                          1. 2

                                                                                                                            This is pretty good - graphic selection doesn’t appear to persist when starting a new game but that might just be beta Safari being weird.

                                                                                                                            Bringing back fond memories of porting Moria to RISC OS cli many years ago.

                                                                                                                            1. 7

                                                                                                                              Someone did a very good dive into the archives (starts here https://twitter.com/sirdarckcat/status/1429833886385725441) and it looks like the solution has been described years ahead of filing. IANAL, but hope there’s enough ammunition there to invalidate the patent.

                                                                                                                              1. 2
                                                                                                                                1. 1

                                                                                                                                  I don’t think, and I am definitely not a patent lawyer, that is necessarily “prior art” in the strictest sense - that’s controlling whole script files. Their claims are that their server-generated secrets “reconfigure” the environment for the scripting language according to those secrets allowing different “scopes” of access to different “identities”.

                                                                                                                                  But I wouldn’t be surprised if there’s more prior art out there - it’s not like permissioned conditional execution of chunks of code was a new idea in 2011 (although the replacing of functions to do that might be?)

                                                                                                                              1. 26

                                                                                                                                You’ll be pleased to hear this concept has a name already: literate programming.

                                                                                                                                1. 7

                                                                                                                                  That’s just the author’s particular take on this. I’ve seen other takes that are quite different from plain old literate programming.

                                                                                                                                  1. 3

                                                                                                                                    Yeah Knuth-style tangle/weave definitely shouldn’t be allowed a monopoly on the very good idea of interleaving prose and code. https://github.com/arrdem/source/tree/trunk/projects/lilith/ was my LangJam submission that went in that direction, partly inspired by my previous use of https://github.com/gdeer81/marginalia and various work frustrations at being unable to do eval() in the ReStructuredText files that constitute the majority of my recent writing.

                                                                                                                                  2. 2

                                                                                                                                    Technically, I think, it’d be “documentation generation” because it doesn’t involve any tangle or weave steps.

                                                                                                                                    because these tools do not implement the “web of abstract concepts” hiding behind the system of natural-language macros, or provide an ability to change the order of the source code from a machine-imposed sequence to one convenient to the human mind, they cannot properly be called literate programming tools in the sense intended by Knuth.

                                                                                                                                    [my emphasis]

                                                                                                                                    1. 3

                                                                                                                                      My view of this is:

                                                                                                                                      A lot of Literate Programming systems are based on the idea of automatically copy-pasting pieces of code around. I think this is a terrible idea for many of the same reasons why building a program entirely out of C macros is a terrible idea. However, it’s a necessary evil due to the limitations of C; everything has to be in a particular order imposed by the C compiler. If you want your prose to describe an implementation of a function first, and then describe the struct which that function uses on later, the only solution in C is to do macro-like copy/paste to make the generated C code contain the struct definition before the function even though it’s implemented after the function.

                                                                                                                                      Many modern languages don’t have this limitation. Many languages lets everything refer to everything else regardless of the order they appear in the file. Thanks to this, I think we can generally treat the function as the unit of code in literate programming systems, and we don’t need elaborate automatic copy/paste systems. As a bonus, all the interactions between code snippets follows simple, well-understood semantics, and you don’t have the common issues with invisible action at a distance you see in many literate programming systems.

                                                                                                                                      That’s the basis for our submission at least, where we made a literate programming system (with LaTeX as the outer language) where all the interaction between different code snippets happens through function calls, not macro expansions.

                                                                                                                                    2. 1

                                                                                                                                      Literate programming was the inspiration for my team’s submission: https://github.com/mortie/lafun-language

                                                                                                                                      1. 9

                                                                                                                                        With the disclaimer that I am neither an experienced Go programmer, nor have I worked on large teams, I don’t understand what any of this has to do with being bad for smart programmers. In fact, I would say that many of the deficiencies that the article lists are in fact pitfalls for juniors programmers. Much of it comes down to having a substandard type system, so the compiler and associated tooling can’t give you useful guarantees or feedback. An experienced programmer may be able to keep the code’s requirements in their heads, but most junior programmers should have the compiler check their work, and Go’s design makes it impossible to do this.

                                                                                                                                        1. 12

                                                                                                                                          I thought Go was well known for having extremely good static analysis tools. The type system isn’t that powerful, but static analysis isn’t just type systems.

                                                                                                                                          1. 1

                                                                                                                                            That’s possible. I’m not in tune with the Go ecosystem enough to know if that’s the case, but this is the first I’m hearing of it. I’d be curious to know what these analyses are and what guarantees they provide.

                                                                                                                                            1. 5

                                                                                                                                              The golangci-lint list of linters is probably a good view of what people are using generally.

                                                                                                                                            2. 1

                                                                                                                                              The analysis package makes it pretty easy to write them too, with the biggest downside being that for some reason I always struggle spelling analysis correctly 😅

                                                                                                                                              A simple example to check for copyright comments, and a slightly more complicated example to check if you’re actually calling functions that return a function in defer (defer Fun()()).

                                                                                                                                              Both go vet and staticcheck are implemented with this.

                                                                                                                                              1. 1

                                                                                                                                                I wrote one at a previous job to make sure that event constants were matched up with functions of the correct type. Most helpful because that was a common thing people fat-fingered.

                                                                                                                                          1. 2

                                                                                                                                            I guess browser.org (mainly lynx.browser.org) which came online in late 1996.

                                                                                                                                            (There should be usenet and mailing list posts from late ’92, early ‘93 floating around in archives tho’)

                                                                                                                                            1. 29

                                                                                                                                              Well written, this were exactly my thoughs when i read this. We don’t need faster programmers. We need more thorough programmers.

                                                                                                                                              Software could be so much better (and faster) if the market would value quality software higher than “more features”

                                                                                                                                              1. 9

                                                                                                                                                We don’t need faster programmers. We need more thorough programmers.

                                                                                                                                                That’s just a “kids these days…” complaint. Programmers have always been fast and sloppy and bugs get ironed out over time. We don’t need more thorough programmers, like we don’t need more sturdy furniture. Having IKEA furniture is amazing.

                                                                                                                                                1. 12

                                                                                                                                                  Source code is a blueprint. IKEA spends a lot of time getting their blueprints right. Imagine if every IKEA furniture set had several blueprint bugs in it that you had to work around.

                                                                                                                                                  1. 5

                                                                                                                                                    We’re already close though. We have mature operating systems, language runtimes, and frameworks. Going forward I see the same thing happening to programming that happens to carpentry or cars now. A small set of engineers develop a design (blueprint) and come up with lists of materials. From there, technicians guide the creation of the actual design. Repairs are performed by contractors or other field workers. Likewise, a select few will work on the design for frameworks, operating systems, security, IPC, language runtimes, important libraries, and other core aspects of software. From there we’ll have implementors gluing libraries together for common tasks. Then we’ll have sysadmins or field programmers that actually take these solutions and customize/maintain them for use.

                                                                                                                                                    1. 7

                                                                                                                                                      I think we’re already completely there in some cases. You don’t need to hire any technical people at all if you want to set up a fully functioning online store for your small business. Back in the day, you would have needed a dev team and your own sysadmins, no other options.

                                                                                                                                                      1. 1

                                                                                                                                                        I see the same thing happening to programming that happens to carpentry or cars now. […] From there we’ll have implementors gluing libraries together for common tasks.

                                                                                                                                                        Wasn’t this the spiel from the 4GL advocates in the 80s?

                                                                                                                                                        1. 2

                                                                                                                                                          Wasn’t this the spiel from the 4GL advocates in the 80s?

                                                                                                                                                          No, it was the spiel of OOP/OOAD advocates in the 80s. Think “software IC’.

                                                                                                                                                    2. 1

                                                                                                                                                      Maybe, maybe not. I just figured that if i work more thoroughly, i get to my goals quicker, as i have less work to do and rewrite my code less often. Skipping error handling might seem appealing at frist, as i reach my goal earlier, but the price for this is that either me or someone else has to fix that sooner or later.

                                                                                                                                                      Also mistakes or just imperformance in software nowadays have huge impact due to being so widespread.

                                                                                                                                                      One nice example i like to make:

                                                                                                                                                      Wikimedia foundation got 21.035.450.914 page views last month [0]. So if we optimize that web server by a single instruction per page view, assuming the CPU runs at 4 GHz, with a perfect optimized code of 1.2 instructions per cycle, we can shave off 4.382 seconds per month. Assuming wikipedia runs average servers [1], this means we shave of 1.034 watt hour of energy per month. With a energy price of 13.24 euro cent [2], this means a single cycle costs us roughly 0.013 euro cent.

                                                                                                                                                      Now imagine you can make the software run 1% faster, which are 48.000.000 instructions, this is suddenly 6240€ per month savings. For 1% overall speedup!

                                                                                                                                                      High-quality software is not only pleasant for the user. It also saves the planet by wasting less energy and goes easy on your wallet.

                                                                                                                                                      So maybe

                                                                                                                                                      Programmers have always been fast and sloppy and bugs get ironed out over time. We don’t need more thorough programmers,

                                                                                                                                                      this should change. For the greater good of everyone

                                                                                                                                                      [0] https://stats.wikimedia.org/#/all-projects/reading/total-page-views/normal|table|2-year|~total|monthly
                                                                                                                                                      [1] https://www.zdnet.com/article/toolkit-calculate-datacenter-server-power-usage/
                                                                                                                                                      [2] https://www.statista.com/statistics/1046605/industry-electricity-prices-european-union-country/

                                                                                                                                                    3. 9

                                                                                                                                                      Software could be so much better (and faster) if the market would value quality software higher than “more features”

                                                                                                                                                      The problem is there just aren’t enough people for that. That’s basically been the problem for the last 30+ years. It’s actually better than it used to be; there was a time not so long ago where everyone who could sum up numbers in Excel was a programmer and anyone who knew how to defrag their C:\ drive was a sysadmin.

                                                                                                                                                      Yesterday I wanted to generate a random string in JavaScript; I knew Math.random() isn’t truly random and wanted to know if there’s something better out there. The Stack Overflow question is dominated by Math.random() in more variations that you’d think possible (not all equally good I might add). This makes sense because for a long time this was the only way to get any kind of randomness in client-side JS. It also mentions the newer window.crypto API in some answers which is what I ended up using.

                                                                                                                                                      I can make that judgment call, but I’m not an ML algorithm. And while on Stack Overflow I can add context, caveats, involved trade-offs, offer different solutions, etc. with an “autocomplete code snippet” that’s a lot more limited. And especially for novice less experienced programmer you wouldn’t necessarily know a good snippet from a bad one: “it seems to work”, and without the context a Stack Overflow answer has you just don’t know. Stack Overflow (and related sites) are more than just “gimme teh codez”; they’re also teaching moments.

                                                                                                                                                      Ideally, there would be some senior programmer to correct them. In reality, due the limited number of people, this often doesn’t happen.

                                                                                                                                                      We’ll have to wait and see how well it turns out in practice, but I’m worried for an even greater proliferation of programmers who can’t really program but instead just manage to clobber something together by trail-and-error. Guess we’ll have to suffer through even more ridiculous interviews to separate the wheat from the chaff in the future…

                                                                                                                                                      1. 2

                                                                                                                                                        We’ll have to wait and see how well it turns out in practice, but I’m worried for an even greater proliferation of programmers who can’t really program

                                                                                                                                                        I don’t see this as a problem. More mediocre programmers available doesn’t lower the bar for places that need skilled programmers. Lobste.rs commenters often talk of the death of the open web for example. If this makes programming more accessible, isn’t that better for the open web?

                                                                                                                                                      2. 6

                                                                                                                                                        We don’t need faster programmers. We need more thorough programmers.

                                                                                                                                                        Maybe we need more than programmers and should aim to deserve the title of software engineers. Writing code should be the equivalent of nailing wood, whether you use a hammer or AI assisted nailgun shouldn’t matter much if you are building a structure that can’t hold the weight it is designed for or can’t deal with a single plank that is going to break or rot.

                                                                                                                                                        1. 6

                                                                                                                                                          We don’t need faster programmers. We need more thorough programmers.

                                                                                                                                                          Not for everything, but given we spend so much time debugging and fixing things, thoroughness is usually faster.

                                                                                                                                                          1. 6

                                                                                                                                                            Slow is smooth and smooth is fast.

                                                                                                                                                        1. 4

                                                                                                                                                          This is a bad idea and you should feel bad.

                                                                                                                                                          I do not. If you can be vaccinated and a vaccine is available to you and you’re not getting one, you should feel bad.

                                                                                                                                                          Do you really expect anyone else to do this?

                                                                                                                                                          I could see it being used as a promotion […]

                                                                                                                                                          The road to hell is paved with good intentions.

                                                                                                                                                          If not dying is not enough of an incentive to get the vaccine, I’m not sure what will be.

                                                                                                                                                          In my region, we are 3.79 million people: between 24th February 2020 and 19th June 2021 (481 days) there are 2720 people who died in hospital with covid19 (and not necessarily from), the large majority of them being over 75 years old.

                                                                                                                                                          In the end, maybe “not dying” really isn’t a sufficient incentive to take these vaccines for some people, and we should respect that. Moreover, drug alternatives exists which can reduce the incentive too.

                                                                                                                                                          Cf: Sources are in french unfortunately, but charts are easily translatable.

                                                                                                                                                          1. 4

                                                                                                                                                            All this for eight hours of lost life expectancy

                                                                                                                                                            If the 18-year-old dies, he loses 61.2 years of expected life. That’s a lot. But the probability of the 18-year-old dying, if infected, is tiny, about 0.004%. So the expected years of life lost are only 0.004% times 35% times 61.2 years, which is 0.0009 year. That’s only 7.5 hours. Everything this younger person has been through over the past year was to prevent, on average, the loss of 7.5 hours of his life.

                                                                                                                                                            1. 4

                                                                                                                                                              Everything this younger person has been through over the past year was to prevent, on average, the loss of 7.5 hours of his life.

                                                                                                                                                              That’s discounting all the lost hours that may have arisen from people infected by that 18 year old if he caught COV19. Which is kinda messed up, no?

                                                                                                                                                              1. 1

                                                                                                                                                                Not really. Since we’re talking about broad policies, thinking about “well what if an 18-year-old infects X many people” is not very instructive. Instead, we should consider the total number of people who would be infected, if we changed policies.

                                                                                                                                                                Herd immunity for SARS-CoV-2 would be reached after perhaps 70% of the population has been infected… While perfect protection would eliminate the risk of infection, few people can practice it. Based on data analyzed by economists at the University of California, Berkeley, we assume that actual protection reduced the risk of infection by roughly half. Therefore, imperfect protection reduced the risk of infection for the average American from 70% to 35%.

                                                                                                                                                                That is, roughly twice as many Americans would have been infected.

                                                                                                                                                                1. 1
                                                                                                                                                                  1. 1

                                                                                                                                                                    I figured we both had read the article which I linked two posts above.

                                                                                                                                                              2. 4

                                                                                                                                                                No dead 18 year old loses 7.5 hours of life. You’re saying that it’s cool for 0.004% of 18 year olds to die.

                                                                                                                                                                Also your calculation is BS because you’re not taking account of the long term health effects of non-fatal covid; and you’re not using any kind of quality of life adjustment. And over the whole population the calculation is different, and disease protection is a whole population effort.

                                                                                                                                                                1. 5

                                                                                                                                                                  You’re saying that it’s cool for 0.004% of 18 year olds to die.

                                                                                                                                                                  You make him say it, he didn’t.

                                                                                                                                                                  Every death is a tragedy in itself, but you should take some distance to find incoherence in this global situation.

                                                                                                                                                                  For example, according to WHO 4 millions of deaths are related each year to diabetes; yet do we see as much passion as for covid from governments and corporations to prevent it ? If not, we should ask ourselves why, especially if every people count. I am yet to see MacDonald’s lock down.

                                                                                                                                                                  And the same analysis can be said for pesticides, air pollution, water pollution, ground pollutions, cigarets, cancers, etc…

                                                                                                                                                                  1. 3

                                                                                                                                                                    To expand on what @Student said, mutations are a big reason to control spreading. Mutation is what gets you vaccine-resistant strains, not to mention the risk of more lethal strains.

                                                                                                                                                                    Diabetes isn’t contractable, nor does it mutate on infection.

                                                                                                                                                                    Externalities like pollution are even further distanced from infectious diseases.

                                                                                                                                                                    1. 1

                                                                                                                                                                      My point was more about deaths and how governments/corporations/media react to it, not targeting a death cause in particular.

                                                                                                                                                                      The current situation may have another meaning when you take some distance with just talking about covid and vaccines.

                                                                                                                                                                  2. 2

                                                                                                                                                                    Also your calculation is BS because you’re not taking account of the long term health effects of non-fatal covid

                                                                                                                                                                    The case rate of “long covid” is roughly the proportional to the death rate. That is, prolonged symptoms occur in people who might have died if their symptoms were more severe. Therefore, this has the same cost distribution as death does.

                                                                                                                                                                    and you’re not using any kind of quality of life adjustment.

                                                                                                                                                                    Of course I am.

                                                                                                                                                                    The costs of protection include reduced schooling, reduced economic activity, increased substance abuse, more suicides, more loneliness, reduced contact with loved ones, delayed cancer diagnoses, delayed childhood vaccinations, increased anxiety, lower wage growth, travel restrictions, reduced entertainment choices, and fewer opportunities for socializing and building friendships.

                                                                                                                                                                    I’d say that forcing a reduced quality of life on so many people is too big of a cost.

                                                                                                                                                                    And over the whole population the calculation is different, and disease protection is a whole population effort.

                                                                                                                                                                    The risk is primarily concentrated in the old.

                                                                                                                                                                    SARS-CoV-2 is highly discriminatory and views the old as easy targets. Had policy makers understood the enemy, they would have adopted different protocols for young and old. Politicians would have practiced focused protection, narrowing their efforts to the most vulnerable 11% of the population and freeing the remaining 89% of Americans from wasteful burdens.

                                                                                                                                                                    1. 1

                                                                                                                                                                      Would they really have adopted? Would that have been the right course of action?

                                                                                                                                                                      Seems someone in the comments is also trying to correct someone else being wrong on the internet:

                                                                                                                                                                      As is well known, as viral cases spread more mutations arise leading to further spread in the community. Blithely recommending that younger individuals should have simply avoided all covid protections flies in the face of prudent epidemiologic practice and ignores the costs associated with covid morbidities.

                                                                                                                                                                      Not to mention the pandemic that lasted 50 million years when one might think herd immunity should have been reached.

                                                                                                                                                                      Of course different countries have had different blunders and anyone’s free to believe what they want, but it’s as if some of the most basic things are forgotten in these opinionated discussions.

                                                                                                                                                                  3. 2

                                                                                                                                                                    Preach to the choir ;)

                                                                                                                                                                    Thanks for the interesting article, I will read it after work !

                                                                                                                                                                1. 12

                                                                                                                                                                  One thing that kinda like you in the eye under non-features:

                                                                                                                                                                  No output quality choice. yaydl assumes that you have a large hard drive and your internet connection is good enough, or else you would stream, not download.

                                                                                                                                                                  I would have thought that if I had a good connection, I wouldn’t care about downloading and could just stream at any time.

                                                                                                                                                                  1. 3

                                                                                                                                                                    When I’m downloading something then because I want a different quality or target format (mp3), but this is specifically unsupported by them. And more often that not you’ll realize there’s not “highest” version because there are at least two different formats that provide the same resolution and which you can’t compare just by their bitrate..

                                                                                                                                                                    1. 1

                                                                                                                                                                      Yeah, that’s all well, I agree it’s not as complete feature-wise. What I’ve meant is simply that they say “you have good connection or else you would stream”. And I thought, “well, if I had a good connection, then I might as well just stream, in whatever quality I choose”. Just seemed like a bogus argument for not implementing quality picker.

                                                                                                                                                                    2. 2

                                                                                                                                                                      I would have thought that if I had a good connection, I wouldn’t care about downloading

                                                                                                                                                                      I have a good connection (Gbps fibre) and I frequently download rather than stream because YouTube mid-stream ads are now a plague - I’ve seen videos with 5 ad breaks in the first 15 minutes. Or I’m trying to listen to an ambient mix by Cryo Chamber and I get an un-skippable 30s ad for some new severely non-ambient dance pop act. Or just trying to follow a tutorial where every 2 minutes I have to stop what I’m doing and get the cursor over to “Skip Ad” because if I don’t, I’m going to get 3 minutes of [whatever guff it is this week] before the content comes back.

                                                                                                                                                                      1. 5

                                                                                                                                                                        I’ve been able to avoid ads with ublock origin on desktop and sponsorblock for ‘native’ ads. maybe yt is able to sneak past ublock but i haven’t seen it yet.

                                                                                                                                                                        1. 2

                                                                                                                                                                          I recommend also the “Enhancer for YouTube” on the firefox plugin store to disable autoplay, theme youtube, have scroll-volume-control, select certain video qualities and most importantly set a default volume as youtube ignores media.default_volume. (You can disable all the additional controls in the settings if you’re overhelmed)

                                                                                                                                                                        2. 2

                                                                                                                                                                          I’m subscribed so I don’t get to see ads usually, but yeah, I see how it can make a differnce.

                                                                                                                                                                      1. 2

                                                                                                                                                                        My one question: Caddy is known for effortless TLS, has it on by default and makes it “just work”. Why can’t Maddy also automatically set up TLS, instead of having to use a cert acquired by some other means?

                                                                                                                                                                        1. 3

                                                                                                                                                                          Easier for Caddy since it’s a webserver and directly able to search the HTTP verification for LetsEncrypt. Whereas Maddy would either need write access to a directory to create the responses for {nginx, Apache} to serve or integrate a webserver itself - neither a good option if you’re trying to make a simple, secure mail serving solution.

                                                                                                                                                                          1. 3

                                                                                                                                                                            It could do dns verification, no web server required.

                                                                                                                                                                            1. 3

                                                                                                                                                                              But then it needs either write access to DNS server configs (directly by file or via an API) or an embedded DNS server. All that’s done is move the extra bits to a different port.

                                                                                                                                                                              1. 2

                                                                                                                                                                                it’s arguably much more simple to implement than starting a web server, configuring a firewall for it, routing, etc than, e.g. using an API to set a TXT record in DNS.

                                                                                                                                                                                1. 3

                                                                                                                                                                                  Sure. How many APIs are there for that?

                                                                                                                                                                                  bind9 has one. Amazon has one. Google, Rackspace, Hetzner, Linode, Digital Ocean, EasyDNS, NameCheap, CloudFlare… that’s ten. I bet I left out the most popular choices in Brazil, Mexico and the Czech Republic already, too.

                                                                                                                                                                                  1. 3

                                                                                                                                                                                    And almost all of those are supported by various acme clients, e.g. https://go-acme.github.io/lego/dns/

                                                                                                                                                                                    So you don’t even have to implement each one!

                                                                                                                                                                                  2. 2

                                                                                                                                                                                    Sure but not everyone has an API to set a TXT record in their DNS - my servers don’t. And I would be surprised if there was a consistent API between PowerDNS, BIND, MaraDNS, etc. All of which is more effort for Maddy’s developers for little gain when you can just link directly to the certbot storage and it’ll Just Work.

                                                                                                                                                                          1. 1

                                                                                                                                                                            I’m curious. what is the use case that is not covered by other user process databases like sqlite3?

                                                                                                                                                                            1. 4

                                                                                                                                                                              It’s literally postgres. Sqlite and postgres aren’t the same thing. Postgres has many more datatypes and builtin support for cool json stuff. If you only wanted to use sqlite for testing you’d have to either avoid using some datatypes or use an orm that will polyfill missing types and functions.

                                                                                                                                                                              Edit: sqlite also doesn’t support altering tables. The list of differences just goes on and on. What’s the value in have test specific code? (I’ve definitely done this before too)

                                                                                                                                                                              1. 3

                                                                                                                                                                                Just pointing out that SQLite definitely has some JSON support https://sqlite.org/json1.html#the_json_function as well as ALTER TABLE support https://sqlite.org/lang_altertable.html

                                                                                                                                                                                1. 1

                                                                                                                                                                                  Yes JSON functions are available if you load the extension. But it’s not built in. Every db has lots of extensions. And even then if you’re using JSON in Postgres or MySQL you’re probably using the d->>‘x’->y syntax and that doesn’t exist in SQLite so you do need to have a transform layer before generating SQL if you want to support both.

                                                                                                                                                                                  And yes good callout; I think it’s just that you cannot change a column type in SQLite? It’s been a bit since I was doing work on it.

                                                                                                                                                                                  1. 4

                                                                                                                                                                                    For go at least, modernc.org/sqlite has the JSON support fully working out of the box.

                                                                                                                                                                                    1. 3

                                                                                                                                                                                      Gotcha, thanks.

                                                                                                                                                                                    2. 2

                                                                                                                                                                                      Yes JSON functions are available if you load the extension. But it’s not built in.

                                                                                                                                                                                      I think a lot of people build their distribution of sqlite3 from the amalgamation which does have JSON support built-in.

                                                                                                                                                                                      e.g. immediately to hand I have macOS Monterey (SQLite v3.35.3), Arch (v3.35.5), Cygwin (v3.34.0) all have the JSON support natively. On the other hand, my NAS (SQLite v3.8.4.3 from 2014) doesn’t have it.

                                                                                                                                                                                      (edit: has -> have)

                                                                                                                                                                                      1. 2

                                                                                                                                                                                        Ah cool, makes sense.

                                                                                                                                                                                  2. 2

                                                                                                                                                                                    Title says “in application or test”, I guess I should have been more specific, I didn’t mean the test part, that was obvious to me.

                                                                                                                                                                                  3. 1

                                                                                                                                                                                    automating the testing of postgres queries, stored procedures, etc, that are expressed in the source code of a Go program.

                                                                                                                                                                                  1. 2

                                                                                                                                                                                    The only time I’ve used Jumbo Frames was between the front and back ends of a news server (early 2000s) because there’s a lot of traffic from the storage to the readers and it made a measurable difference. No issues with routing changes etc. because they had their own subnet for this traffic to avoid saturating other people’s links.

                                                                                                                                                                                    (edit: We may also have used them from the transit boxes to the storage but my memory is vague there.)