Threads for randrews

    1. 3

      To get access to the password for any API we need to hit, you search for something like service-password in an AWS service, which returns the value… service-password (as in, literally all the values are the same as the keys), then you use that to look up the actual password in a completely different service. No one knows why we do this.

      I have railed about this exact kind of thing before: using const FOO = 'foo' and then saying FOO everywhere instead of the literal ‘foo’. It’s stupid. The only reason you would do it is to enable changing the literal to const FOO = 'bar' but no one would ever actually do that, you would change the constant name anyway because otherwise it would be very confusing. And if you do that then you already have to touch every occurrence. So what’s the point?

      If you do const PRICING_METHOD = 'foo' then that makes sense, your const-ification actually adds some meaning, but just blindly copying the string into the const name because literal strings are icky is some cargo-cult nonsense.

      1. 6

        A const FOO = 'foo' can be changed to const BAR = 'bar' and auto-renamed across a whole project without the risk of false positives or negatives

        1. 1

          Yes but that still counts as touching every occurrence where the constant is used. Either way, if you have a string that’s reused in several places, changing that string will require looking at all those places, even if it’s an automated tool doing it.

          (And I would still not trust it, in a language like Ruby, to rename the constant without false positives.)

    2. 9

      I was discouraged from reading this by my high school math teachers, and I can’t think of any better way to recommend a book. :)

      1. 8

        I had a middle-school algebra teacher who told my mother I’d never be any good at math.

        In high school I took trigonemtry and then calculus,m and got the highest possible score (5/5) on the AP calculus exam. My mother apparently made a photocopy of my score and mailed it to the algebra teacher.

        The difference, of course, was largely the quality of the teachers for the trig and calc courses.

        1. 3

          My school district had very weird policies about math when I was a kid:

          • To keep people from getting discouraged, the correctness of your answer on a math problem wasn’t allowed to be worth any points; you would lose no points if you wrote the wrong answer, assuming you “showed your work.”
          • But that also meant that if you didn’t sufficiently “show your work,” getting the right answer was no defense: I was accused of cheating and failed assignments and tests, all because I could look at the problem, see the answer, and write it down.
          • It’s very hard to pretend to show your work convincingly when there’s no work to show, and when no one will explain to you what that’s supposed to look like.
          • Because of this lunacy, I thought I was terrible at math until I became an adult.
      2. 4

        That’s fantastic! 😂 I didn’t get discouraged by my high school teachers but indeed what a fantastic book! It really takes out the whole mystery and gate keeping out of calculus. At the end of the day calculus simply gives one tools to deal with ratios, which changes, and this book really aims for you to “get it”. One can eventually jump into deeper water with many other “rigorous” (read terse and show-off) but this one helps one to USE calculus, not brag that you know it!

    3. 1

      I don’t think this is right. If I look at, for example, a VM with dozens of different instructions and concepts, and say “actually, these can all be recast as sequences of a handful of basic stack operations,” where has the complexity gone? Where have I moved it to?

      I think the difference is that I’m not trying to make just the code simpler, I’m trying to reinterpret the problem into something simpler. That’s how you make simple code: you think about it and realize that you were thinking about the problem itself in too complicated of a way.

      Conversely, you can think about how to make code more complex: throw in a feature that doesn’t fit with everything else, and do it by just adding a special case for it. Complex code has a lot of weird special cases while simple code has just a handful of clearly defined concepts.

    4. 1

      I’d really like to play with this but it seems not to start, I click “connect to sourcegraph” and nothing happens. Has anyone here gotten it to work?

      1. 2

        Hi, Sourcegrapher here. AFAIK, we haven’t gotten that specific issue reported yet. We did have some similar Linux issues yesterday but they were resolved. Doing support over comments is tough so if you want feel free to email me and I will get you fixed up.

        1. 3

          I think it was caused by the Github outage just now. I tried about an hour ago and had the same problem: as I was trying to connect with Github it’d hang up on the OAuth redirect, then I saw there was an outage and thought “ok makes sense”. Was able to connect after that (am trying out Cody, pretty cool!). You guys might not have a bug there, just bad timing.

          1. 3

            I tried again just now with the same result, and sent him an email. Hope I can get it working, it looks neat!

            1. 2

              I sent this via email but thought it might be relevant:

              “Could you try the .deb download version here instead? Hopefully that works”

              1. 1

                I did that, and it worked, and the tool is frankly, amazing, it is worth the minor hassle setting it up. :)

    5. 3

      As much as I like this post, I wouldn’t divide the developers world between “grug” and “big brain”.

      I think that a big part of the useless complexity we face (especially in web development) is due to developers craving for self-importance and career/salary improvement. All this complexity created job opportunities and salary increases. And companies of all kinds/sizes just have to deal with that because it’s “modern” (and that’s where Fear Of Looking Dumb plays its role).

      I think what we need to accept is:

      • No, all dev jobs won’t be as technically challenging as being a data engineer at Facebook or front-end engineer on Google Docs ; most companies just need a proper website/webapp shipped in no time with nice extensibility and good ability to change according to user feedback
      • This whole deal is not about us: UX > DX
      • This whole deal is really not about us: this complexity and its costs implications killed many startups and many cool projects that deserved better
      1. 2

        I believe the Grug vs Big Brain dichotomy is more about self perception and programming philosophies than it is about actual abilities. Mostly, Grug is aware of his own limitations, and Big Brain is not. Often, Big Brain is smarter than Grug, but but their defining characteristic is their distinct lack of wisdom when it comes to actually aim their (sometimes) superior intellect.

        I met one such Big Brain once. His cognitive power, as far as I can tell, exceeded my own by a fair margin. He was able to work with much more complexity than I could. On the flip side he was blind to simplicity. I once had to work on his code, it was a mess. I simplified it while adding a feature, and ask for his help about a bug (that eventually was easily fixed). His immediate reaction was that of course my code was too small, it was obviously missing stuff, that’s why I had my bug (nope). He had a simple alternative to his code staring at him, and he did not believe it.

        This attitude, I believe, is a major source of complexity. People who make complex things because they just don’t know any better, and then argue from ignorance that it has to be that complex. Fools, the lot of them.

      2. 2

        I’m not so sure it’s developers adding complexity for their own benefit. I don’t think most developers like this junk either; I think it’s driven by a perception that you’re doing it wrong unless you have ten layers of abstraction everywhere.

        1. 2

          I have seen such cynicism with my own eyes. People who ended a React v. htmx debate with the following argument: “I don’t like server-side templates DX”, “ I would be willing to switch if you’re willing to rewrite your entire Django back-end with Javascript”.

          I have also seen people fear uselessness because of htmx. Because their jobs wouldn’t be needed anymore. Absolutely no sense of “the goal of our jobs is to solve users problems and, by that, make our business prosper”, no sense of “ I am a developer or a software engineer, not just a single-technology programmer”.

    6. 3

      Loading a Wasm binary directly should cause the browser to compile and instantiate the Wasm module directly.

      What if you want multiple instances of the module on the page at the same time? I like that instantiation is a separate step from loading a module.

    7. 3

      This reminds me of this similar advice from Raymond Chen: