• 0 Posts
  • 7 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle

  • 418teapot@lemmy.worldtoProgrammer Humor@programming.devaverage day in NPM land
    link
    fedilink
    English
    arrow-up
    35
    arrow-down
    4
    ·
    edit-2
    23 days ago

    It’s kind of insane how bad this whole is-number thing is. It’s designed to tell you if a string is numeric, but I would argue if you’re ever using that you have a fundamental design problem. I hate dynamic typing as much as anyone else, but if forced to use it I would at least try to have some resemblance of sanity by just normalizing it to an actual number first.

    Just fucking do this…

    const toRegexRange = (minStr, maxStr, options) => {
      const min = parseInt(minStr, 10);
      const max = parseInt(maxStr, 10);
      if (isNaN(min) || isNaN(max)) throw Error("bad input or whatever");
      // ...
    

    Because of the insanity of keeping them strings and only attempting to validate them (poorly) up front you open yourself up to a suite of bugs. For example, it took me all of 5 minutes to find this bug:

    toRegexRange('+1', '+2')
    // returns "(?:+1|+2)" which is not valid regexp
    

  • Agreed, but my point is with a centralized network the lowest common denominator wins. There is no reason you can’t have QoL features on an open network, and thusly let everyone have the features that they care most about.

    Can you imagine what a shithole the internet would have been if email wasn’t federated an open? There is absolutely no way that whatever centralized bullshit would have spawned instead would already be either long gone or enshittified to the point of being useless.


  • Good for you, you have a short list of requirements out of a chat service and discord perfectly fills your niche. But different people have different requirements for chat, and they don’t align. And network effects force people who have differing requirements to use the service with the most users which sucks.

    For instance here are things that I require from any chat service that I use that discord completely falls flat at:

    • Ability to run it on my linux machine without using an electron client (npm is a huge mess of supply chain attacks and I refuse to run any software that is likely to contain dependencies from it)
    • Ability to run it on my AOSP phone which does not have any google play services installed
    • Ability to write software to back up messages without fear of a company changing their API and breaking my backup system


  • The way I remember the order is that the parentheses around the link would make grammatical sense outside of markdown (the goal of markdown is to still be fully readable even when looking at the raw source).

    For example if I were posting on a forum that didn’t have markdown support which one of these would make more sense:

    1. You can find that on this lemmy instance (https://lemmy.world).
    2. You can find that on (this lemmy instance) https://lemmy.world.

    Option 2 makes no sense grammatically. Then you just need to use the square brackets (which rarely show up in non-markdown text) to denote the link range.


    Alternatively, if you still have a hard time remembering the order, you can use reference-style links which make it even more readable outside of markdown rendered contexts (note that there are no parentheses in this version, nothing to get confused):

    [Here is a link][1] and [here is another link][2].
    
    [1]: http://example.org
    [2]: http://example.com
    

  • Personally I think Spotify is worth $10 a month.

    While I agree that there aren’t any great self-hosted solutions, more diversity in the music space is important. I refuse to use Spotify, and for me it’s not about price. In fact, if they charged more and actually paid their artists more I would probably hate it less. But overall I mostly refuse to use it for other reasons:

    It couples the company that delivers your music with the app you must use to stream your music. In my opinion these should be separate - perhaps an open protocol that streaming companies can all use and open source clients that can connect to one or many of them?

    Spotify made it clear that they don’t care about Linux users when they killed their Linux client. Yes I know about librespot, it’s only a trivial decision away from Spotify killing it. And unlike Reddit’s API changes, the backlash would be minimal since most people use the official one.

    It strongly relies on network effects to get everyone on the platform and keep them there. As mentioned above, this hurts independent artists because they are forced to publish their music on a platform that doesn’t pay well just because everyone is on that platform. But there are more than just network effects between artists and consumers: Spotify relies on social-network style antipatterns to keep users in their ecosystem. I’ve been told by my friends that I am “difficult” because I don’t use Spotify and they want to share something with me. That is Spotify’s manipulation

    Their official client is electron, I don’t want to have to run a whole browser stack to listen to music. Not to mention the fact that npm is plagued with supply chain problems and unless the Spotify devs manually audit every dependency of every dependency of every dependency any time they add or update one (doubt it), users are one attack away from being compromised.

    When I did briefly use Spotify many years ago I took the time to build up some playlists of music and randomly songs would disappear from the playlists when Spotify lost rights to stream it.


    I personally use Bandcamp for recommendations/discovery, and then purchase music I like to listen to and self-host it with MPD. It works great.

    I’m not saying this is for everyone, obviously streaming has its merits. But in my experience most people self host not because something costs money, but because they have zero control of the actual experience, and they want to avoid the vendor lock-in issue.