• 3 Posts
  • 35 Comments
Joined 2 years ago
cake
Cake day: June 14th, 2023

help-circle


  • Yes. I learned this from Haskell. I like Haskell, but it has a lot of very granular functions.

    Earlier comment said that breaking up 1 function into 3 improves readability? Well, if you really want readability then break it up into 30 functions using Haskell. Your single function with 25 lines will become 30 functions, so readable (/s).

    In truth, there’s a balance between the two. Breaking things up into function does have advantages, but, as you say, it makes it more likely that you’ll have to jump around a lot to understand a single process.


  • Shorter code is almost always better.

    Should you use a class? Should you use a Factory pattern or some other pattern? Should you reorganize your code? Whichever results in the least code is probably best.

    A nice thing about code length is it’s objective. We can argue all day about which design pattern makes more sense, but we can agree on which of two implementations is shorter.

    It takes a damn good abstraction to beat having shorter code.




  • Buttons@programming.devtoTechnology@lemmy.worldReddit is a Dying Mall
    link
    fedilink
    English
    arrow-up
    37
    ·
    edit-2
    2 years ago

    I’ve come up with the following rules for my own relationship with Reddit.

    1. I will avoid posting on Reddit.
    2. If I do post on Reddit, I must make a similar post on another forum, maybe Lemmy, maybe somewhere else.

    Number 2 is important because it helps other small communities grow.

    It’s not a problem if a lot of people post on one forum, but it is a problem if a lot of people post only on one forum. I wont allow myself to post only on Reddit.

    That said, I haven’t posted on Reddit since June.





  • The precompiled implementation is the only supported way to use the macros that are published in serde_derive

    That statement is straight up gaslighting.

    The precompiled binary is only provided for one platform, Linux. Windows does not use a precompiled binary but compiles its own from the source. How can he claim it’s the “only supported way”, when for most platforms he is doing it another way? Also, the crate, throughout most of its life, has been doing it another way.