• 13 Posts
  • 379 Comments
Joined 6 years ago
cake
Cake day: May 31st, 2020

help-circle
  • Yeah, at some point, I told Picard to just re-sort everything and that was not a good idea. Some songs got renamed or put under a different artist, because I guess, the actual song is not in the MusicBrainz database.
    I do have a backup that I should restore actually, but yeah, difficult to notice such changes and especially to know how much damage was done.

    I did also figure, I should just add the unknown songs into MusicBrainz, but boy, I added one album and that took more than half an hour…

    Definitely leaning more and more towards that unsorted life…




  • Had to just think about why #[non_exhaustive] exists, so perhaps this helps you as well:

    Imagine you’re developing a really important core library, something like TCP. And then other libraries depend on your library.
    Now, if you change your implementation, you may need to introduce a new error case, even though the rest of the API still works the same.

    You have two choices to deal with that:

    • Release version 2.0, because that’s a breaking change. Each library that depends on you needs to manually upgrade to version 2.0. Some never will, because they’re unmaintained. Any application that ships your library as a transitive dependency will need to ship both, version 1.0 and version 2.0, for the next few years until the last of their direct dependencies has upgraded to 2.0 or been removed.
    • Or: You’ve declared that error enum #[non_exhaustive] before going 1.0 and therefore forced all depending libraries to implement a default match case. You can sneak in the new error case in version 1.1 without all those depending libraries needing to manually upgrade. The ecosystem does not split in half between 1.0 vs. 2.0.

    Obviously, if it’s a really egregious new error case that needs specific handling, then you might still want to release version 2.0, but by adding the #[non_exhaustive], you can decide later on and if you are such a central library, there’s definitely going to be situations where you want to make use of it.






  • Yeah, not a bad stance to have. When I switched to Linux (in the middle of a compsci minor), I thought I was the king of the world and that I knew everything about computers.

    Then Linux showed me that I know fuckall, not because it was particularly hard, but rather because it’s an open library.
    You can look at a random config file on your PC and it will explain you highly technical concepts for free.
    You can look at the source code of anything you’re interested in. Well, or probably rather read an explainer from someone who read/wrote the source code.
    And you can easily look at the logs of your applications to debug them.

    Every so often, I run into folks that genuinely seem to know a lot about Windows, and I always wonder how. It doesn’t explain anything to you. 😅




  • Small nitpick that I noticed while skimming the code:

    Where you define your constants, you can change those comments to be doc-comments instead, so that your editor can display them when you hover over constants.

    And personally, I would go one step further with the units, by putting them at the end of the name of the constant, like you did with some variables in the code. That way, the unit shows up inline while reading code that uses the constant, which makes it easy to see that units match up (or not).

    Side-note: You don’t have to denote the unit for Duration. You construct it from milliseconds, but then it’s unitless and you decide where you use it in what unit you want the value. So, Duration is very cool and I would recommend using it for LRC_START_THRESHOLD as well.

    But yeah, back to the comments-thing: Plain comments are kind of inherently crappy, because they only show up in one place in the code, so you’re less likely to see them and less likely to update them. By putting things into doc-comments, names, log statements, error messages etc., they show up in at least two places.
    Plain comments only really make sense for explaining why the code does something. The what can generally be explained in other ways, at least in a sufficiently abstracted language like Rust.


  • You’re looking at it from the perspective of having coded a single application and wanting to deploy it. Try to think more like a sysadmin:

    • You’ve got a whole bunch of applications to deploy. Some of them may use dynamic linking, too.
    • You don’t know any of them too intimately, so want to just prevent them from interfering with each other, unless you allow it.
    • You want a uniform tool to manage all these different applications, and especially also when they’re allowed to interact.

    The result is deployment orchestration tools like Kubernetes, Docker Compose, Podman Compose etc… And as a dev, you have to provide a container image, if you want to play along in those.






  • Ephera@lemmy.mltoSelfhosted@lemmy.world•Quality Software
    link
    fedilink
    English
    arrow-up
    1
    ·
    24 days ago

    Anyone using the national domain registrar? Does it only resolve nationally, if you buy from there, as the article implies…?

    But you want your domain over the world. Cool, do you have enough clients to need this? Then you can hire a person in each country to buy you a domain from the local registry.

    I’ve been interested in getting a domain name, but it always just felt like a scam to pay a monthly fee for an entry in a database. If the national registrar is good enough, that would be cool.

    Although, I guess, if it is not, I’d at least still be somewhat more at peace with that, since it would mean the intermediate company actually does something…