• 0 Posts
  • 557 Comments
Joined 2 years ago
cake
Cake day: June 22nd, 2023

help-circle

  • +++ I cannot stress this enough.

    Programmers tend to get over obsessive about DRY code because it seems like it should be easier to maintain fewer functions and writing less code should be easier right? But it tends to ignore the actual subtle differences between the different consumers of that abstraction, and that leads to massively branching functions that couple unrelated parts of the codebase together. These then become impossible to read and change without worrying about breaking something else.

    When I was at Thoughtworks (Martin Fowler’s current company), we were also taught the rule of three for refactoring, and were taught to always optimize your code for readability and maintainability first and foremost. Refactoring and improving easy to read/maintain code is always relatively trivial, by nature of it being clear, concise and decoupled, and that can be done once you have a reason to do so (i.e. performance issue etc), so there’s no point over optimizing for anything else up front.

    This talk from Dan Abramov (one of the lead devs of React) does a really really good job explaining some of these issues and is entirely worth the full watch/listen (do it on company time, it’s professional development):

    https://www.deconstructconf.com/2019/dan-abramov-the-wet-codebasets



  • masterspace@lemmy.catoProgramming@programming.devWhy Is Python So Popular in 2025?
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    4
    ·
    edit-2
    16 days ago

    I literally do that professionally, and I’m telling you that brackets are inarguably better.

    You are used to whitespace; I have literally spent months refactoring and upgrading a react frontend and a python backend and am telling you that brackets are a single character and far more predictable, and then your IDE / Linter / Formatter can reliably use them to fill in the perfect indentation and whitespace.

    My first professional language was Python, but I have since tried a half dozen others and would never choose to go back to a whitespace based language unless there was a good reason.




  • masterspace@lemmy.catoProgramming@programming.devWhy Is Python So Popular in 2025?
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    4
    ·
    edit-2
    17 days ago

    Lazy is an overly harsh and judgemental way to put it (virtually all programmers start with some high level simplified language), but the sentiment arises because it’s syntax is designed to be easy for people writing code, but at the cost of people maintaining code.

    The whitespace delimiters, the lack of type system, the lack of semi-colons … They’re all things that people who haven’t programmed before think make programming easier. In reality they all make in the wild production programs waaay harder to maintain.

    There’s a reason that JavaScript has been surpassed by TypeScript for professional developers, and it did so remarkably quickly. All that ‘extra’ information that seems pointless for a new dev to express, in reality constrains your program, makes it more readable and understandable, reduces the amount of tests you have to write, and makes it easier for someone else to come in and make a change to it and be confident they haven’t broken anything.


  • Python is popular because it’s whitespace based syntax make noobs think it’s easy to read. This and it’s pre-installation on Linux made it popular amongst academics who embraced it for data analysis. This lead to a lot of data scientists embracing it and writing libraries for it which created a virtuous cycle in that arena.

    And it’s a damn shame because Python, and it’s whitespace nonsense and lack of type system, is a horribly impractical language for building anything at scale.



  • masterspace@lemmy.catoTechnology@beehaw.orgEthical alternatives to Spotify
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    3
    ·
    edit-2
    1 month ago

    Why?

    1. Lack of Feature Parity

    2. Stickiness of library transfer

    3. Stickiness of social network effects

    4. It’s still better ethically than Apple Music or YouTube Music, which behave anti-competitively

    1: I’ve tried out Quobuz, it’s pretty good, but it does not have the Jam / Group Session feature which me and my friends use constantly while gaming remotely. It also does not have an Xbox app which I use while playing games. I find Spotify’s recommendations somewhat underwhelming, but Quobuz has a noticeably worse recommendation engine, at least for my genres and tastes. Those are the features that lack parity that matter to me, but for some others, it’s things like amplifiers having built-in Spotify, or there being a Roku or Playstation app or something.

    2: Quobuz uses a third party service to automatically transfer your library, which worked pretty well, but did require jumping through a bunch of hoops and subscribing to a trial subscription that I then had to cancel. It also did not find matches for some songs. Could I make it work if I had enough reason to switch? Yeah, probably, but the lack of feature parity (/roadmap that includes them) is enough to dissuade me from really trying.

    3: In addition to friends on Spotify all using Jams, there’s also an inherent niceness to just being able to text people Spotify links, especially since there’s no cross platform linking service that would otherwise make sharing music easy.

    4: Supporting Spotify may not be great, but its still better than supporting trillion dollar anti-competitive corporations like Apple and Google.