• 3 Posts
  • 792 Comments
Joined 5 years ago
cake
Cake day: May 31st, 2020

help-circle

  • Yeah, I kind of respect the stance, because it knows what it wants to be, but I also wrap number types into a separate data type to document that maybe you shouldn’t multiply a port number by the wheel count and pass that into the temperature parameter, because I want more fine-grained typing, not one-size-fits-all.


  • Groovy will automatically convert integers into objects, as it sees fit. And one such case is when you assign null to an integer.

    There’s some more languages, which try to treat primitive types like objects, to make them more consistently usable. As I understand, nullability is a big part of the reason why it can’t be solved with syntactic sugar, so presumably this would be possible in all those languages.
    If I’m not mistaken, Ruby is another one of those languages.




  • We currently have a semi-serious project at $DAYJOB, like we’re basically allowed to work on it as a team building thing. And one guy who’s tugging along has ten years more programming experience than me, but no experience with the programming language we’re using, so he’s been generating everything with LLMs.

    He knows to write unit tests and well, the programming language in question is Rust, which’s strict compiler prevents lots of bad code from happening. So, this isn’t your stereotypical vibecoding.

    But …yeah, it’s still been challenging to work with.

    Yesterday, the guy built a feature which basically gives the user instructions how to create a bookmark in their browser. There’s a few ways to implement this:

    • You don’t. Our userbase is gonna be technical, they probably know how to do that.
    • You show the instructions for all browsers and let the user pick which instructions to follow.
    • You ask the user interactively what browser to set up and then show them only the instructions for the chosen browser.

    Right, and apparently the fourth way to implement this, which the LLM generated, is to detect what the default browser of the user is.

    Leaving aside the problem that some users will want to set up different browsers than their default browser, how do you implement that? Is there some nice, cross-platform API for it? Well, if there is, the LLM didn’t know about it.
    And neither are there nice APIs per operating system. On macOS and Linux, it runs some random commands to access this information. On Windows, the generated code looks at the Registry.

    All of this is absolutely horrid to maintain. I do not want to be testing on each OS separately. I do not want hundreds of lines of code for a feature that’s not actually needed. And the worst part is, the guy should know this. He has the experience.
    But I’ve seen the guy when he chats with an LLM, just falls into an absolute trance. Does not surprise me that he’s unable to take a step back to think, if this even makes sense to do…









  • Oh yeah, I’m saying that relational databases push you even more to assign IDs to every miniscule piece of information, especially if you’re following best practices (3NF or similar).

    For example, you’re not supposed to say that a user has a list of interests, you’re supposed to say that there’s users with a user_id and then there’s user_interests with a user_id and an interest_description, so two separate tables.
    If those interests can be indexed, then you’d want three tables:

    • users(user_id)
    • interests(interest_id, description)
    • user_interests(user_id, interest_id) (N-M-Mapping)

    I mean, this might not be the best example, as it kind of makes sense to not always load the user interests whenever you do anything with the user, but yeah, the point is that you’re supposed to split it up into separate tables and then JOIN it as you need it.

    With these RDBMS, your entire data loading logic is supposed to happen in-database, so you pretty much need to chop the data into the smallest possible parts and assign IDs to all of those parts, to give you the flexibility to access them how you need to.



  • Not really, but I feel like grayscale values would have been the most useful still, after black and white.

    With colors like orange, blue etc., the hue and lightness play a big role. But with grayscale values, it’s pretty much just the lightness you care about, so there’s a much higher chance of such a named value fitting what you want…



  • Ephera@lemmy.mltoADHD memes@lemmy.dbzer0.comHuh?
    link
    fedilink
    English
    arrow-up
    20
    ·
    18 days ago

    A friend, who I suspect has ADHD, once did this to me when I was explaining some complex stuff to her. I could not possibly imagine that someone got that explanation, if they fell off the thought train halfway through. So, I asked her about it and she told me that this is how she always processes sentences. She just buffers the words in RAM until the sentence is done. Then she slurps the words up and figures out the meaning.

    I’m guessing, her brain is just really fast, but then runs off and does other thoughts while she’s supposed to listen, so she trained all her life to cope via buffering instead.


  • Ephera@lemmy.mltoLinux@lemmy.worldGood bye NixOS, Hello Debian (Again)!
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    18 days ago

    You won’t really need home-manager on a server anyways. It’s for managing the configuration files in your home-folder, so you might customize the shell of your root user with it and that’s about it.

    Home-manager makes a lot more sense on desktop computers. I actually have kind of the opposite ‘problem’. I started out by using home-manager on a different distro and even though I switched to NixOS by now (because the other distro’s installation mysteriously imploded one day), I haven’t bothered to learn the non-home-manager way yet. You can do almost everything in home-manager, too, at least when you don’t need to administer for multiple users.


    And as for Flakes, I feel like they sound a lot scarier than they are. If you’re just an end user (not trying to distribute Flakes to others), then it’s basically just a handful of different commands to use and one more Nix file at the root of your configuration. I had to sit myself down for an hour or so to figure that stuff out and I haven’t touched it much since then.

    I can understand not prioritizing them, though. It’s not like you switch to Flakes and then everything is different. It’s mostly just a different way of doing things, a different set of complexity (they replace Nix Channels, for example), which makes your configuration more reproducible, should you ever need that.


  • I was wondering why he couldn’t just use the normal way of modifying configuration files to configure Xfce.
    Here on KDE, about half my configurations are stuff like configFile.kwinrc.Windows.FocusPolicy = "FocusFollowsMouse";, which basically just modifies ~/.config/kwinrc to contain a section:

    [Windows]
    FocusPolicy = FocusFollowsMouse
    

    This isn’t always pretty, especially when the configuration format is itself not the prettiest, but it seemed a lot simpler than using this xfconf thing.

    But well, the reason is that Xfce’s configuration format is severely ugly. Namely, it’s in XML.
    XML is a markup language, not a configuration language, so it has a far more complex structure, which you cannot easily formulate in the Nix syntax.

    You could still include those XML files as a whole and have Nix roll them out with some mild templating. But yeah, at that point, Nix doesn’t actually do much.

    I don’t agree that you have to use Sway (configuring KDE works well for me, for example), but yeah, some pieces of software will just not have decent configuration files, so if you want to use those, you have to configure them the non-Nix way.

    I do wish NixOS wasn’t as much of an investment, so that folks could just appreciate it when it helps them configure something and wouldn’t be disappointed where it can’t do that.
    To some degree, I feel like using just Nix Home-Manager on another distro alleviates that, but it has some other pitfalls and I’m not yet wizard enough to know all the benefits that NixOS’ particular way of doing things brings along.