• 1 Post
  • 16 Comments
Joined 3 months ago
cake
Cake day: August 16th, 2024

help-circle

  • By the power invested in me by, well, nobody whatsoever, can I just take a minute to say, let’s all cool down a little in the comments!

    There’s a lot of arguing against:

    • The idea that acknowledging the tragic reality of climate change makes you defeatist
    • The idea that because we have had some great advantages in green tech we can sit back and let climate change fix itself

    I don’t see anyone making those arguments here though! Just lots of people concerned about climate change with different skews of how positive/negative we should feel.

    Personally, I swing between powerful optimism and waking in terror at 3:00am for the future we’re hurtling towards. I’m sure other people are the same, so let’s just be friendly to the fact that other people are in different vibes to us.

    There are some people working together very well right now to dismantle the climate, so let’s all remember that when we’re talking with each other.

    Peace and love!




  • I have advice that you didn’t ask for at all!

    SQL’s declarative ordering annoys me too. In most languages you order things based on when you want them to happen, SQL doesn’t work like that- you need to order query dyntax based on where that bit goes according to the rules of SQL. It’s meant to aid readability, some people like it a lot,but for me it’s just a bunch of extra rules to remember.

    Anyway, for nested expressions, I think CTEs make stuff a lot easier, and SQL query optimisers mean you probably shouldn’t have to worry about performance.

    I.e. instead of:

    SELECT
      one.col_a,
      two.col_b
    FROM one
    LEFT JOIN
        (SELECT * FROM somewhere WHERE something) as two
        ON one.x = two.x
    

    you can do this:

    WITH two as (
         SELECT * FROM somewhere
         WHERE something
    )
    
    SELECT
      one.col_a,
      two.col_b
    FROM one
    LEFT JOIN two
    ON one.x = two.x
    

    Especially when things are a little gnarly with lots of nested CTEs, this style makes stuff a tonne easier to reason with.



  • Ok really tangential rant here!

    I find societal attitudes to art and morality really crazy.

    I don’t necessarily disagree with the idea that art and morality should be linked, but it only ever seems to happen in a negative capacity of “don’t listen to x because they did y”.

    There’s a whole strain of:

    • Artists who are not necessarily bad people, but whose art is aggresively immoral (I guess an obvious example would be Biggie Smalls or someone who frequently raps about sexual assault and violence in a positive way, but also the ammount of mainstream pop or country that has sexist or racist undertones)
    • Artists who try hard to inject their morality into their work (such as Becky Chambers’ climate positive fiction, or Giancinto Scelsi’s anti-facist music)

    On the whole, I don’t see anyone care very much about the above two points, people just “like what they like”, which is as if we think morality and art are two seperate things.

    That makes sense, but then there’s this wierd category where “oh that person did this bad thing, so now their art is invalid”.

    So, what’s the overall attitude? Like, art isn’t related to morality generally, but there’s some mysterious line where if it’s crossed art moves into the “forbidden zone”?

    I’m all for calling bad people to account for their moral behaviour, but the way we do it in art is so jumbled and inconsistent.


  • Short answer is no, I think because what tools you need for programming change so much based on the development you’re doing. C++ developers need compiler toolchain stuff that Javascript developers would never need to look at and vice versa.

    Curveball answer is that modern extensible IDEs with the power of language servers and plugins have kind of become this. I’d massively recommend properly getting into one of the following and learning how to configure new languages and plugins:

    • VScode
    • Neovim
    • Emacs
    • Helix

    (Sure I’ve probably missed some great options, feel free to flame me on why notepad++ should be OPs first choice)




  • I feel like in a lot of ways, most languages are great candidates for this, for lots of different reasons!

    • Rust: Great choice because it produces a small, very well optimised binary. If you just care about the output binary being small and non-memory intensive, then this is probably a good call.

    Buuuuut, Rust’s compilation can be pretty resource intensive, so if you’re actually developing on limited hardware:

    • C (or curveball option, Hare): produces a small, well optimised binary, with faster compilation. But less framework type things to help you on your way to apis/servers/etc.

    Then there’s the fact that it’s a home server, so always on, meaning you actually have generous resources in some ways, because any available CPU is kinda just there to use so:

    • Python: has a runtime and can be pretty heavy CPU wise, but lots of frameworks, and in all honesty, would wind up being a lot faster to put stuff together in than Rust or C. Probably a great default option until you hit resource issues.

    And then why not go whole hog into the world of experimental languages:

    • Roc: Doesn’t have versions yet, so super new, but should produce a pretty small binary and give you higher level ergonomics than something like Rust or C, especially if you’re into FP.

    And then we’re forgetting about:

    • Haskell: Haskell is the only true programming language, and any time there’s a selection of programming languages, picking the one that isn’t Haskell is the wrong choice. Just ask anyone who programs in Haskell.

    But that doesn’t factor in:

    • Javascript: Sooner or later, everything is just javascript anyway, why even try to resit?

    Plus:

    • Assembly: Can you even trust that it’s well optimised unless you’re writing the assembly yourself?

    Edit: My actual serious answer is that Rust + Rocket would be great fun if you’re interested in learning something new, and you’d get very optimised code. If you just want it to use less memory that java and don’t want to spend too much time learning new things then python is probably fine and very quick to learn. Go is a nice halfway point.


  • I’m a data engineer, use parquet all the time and absolutely love love love it as a format!

    arrow (a data format) + parquet, is particularly powerful, and lets you:

    • Only read the columns you need (with a csv your computer has to parse all the data even if afterwards you discard all but one column)

    • Use metadata to only read relevant files. This is particularly cool abd probably needs some unpacking. Say you’re reading 10 files, but only want data where “column-a” is greater than 5. Parquet can look at file headers at run time, and figure out if a file doesn’t have any column-a values over five. And therefore, never have to read it!.

    • Have data in an unambigious format that can be read by multiple programming languages. Since CSV is text, anything reading it will look at a value like “2022-04-05” and say “oh, this text looks like dates, let’s see what happens if I read it as dates”. Parquet contains actual data type information, so it will always be read consistently.

    If you’re handling a lot of data, this kind of stuff can wind up making a huge difference.



  • I’m a data engineer, and have seen an ungodly ammount of 200-but-actually-no-stuff-is-broken errors and it’s the bane of my life!

    We have generic code to handle pulling in api data, and transforming it. It’s obviously check the status code, but any time an API implements this we have to choose between:

    • having code fail wierdly further down the line because can’t parse the status
    • adding in some kind of insane if not response.ok or "actually no there's an error really" in response.content logic

    Every time you ignore protocols and invent your own, you are making everyone sad.

    Will take recommendations of support groups I can join for victims of terrible apis.




  • Ah Marginalia is absolutely awesome! I feel like modern search is almost an extension of website names now, so if I want to find netflix but don’t know it’s website, I might search for “netflix”. Marginalia is actually a cool way to find new stuff- like you can search “bike maintenance” and find cool blog posts about that topic.

    I honestly can’t remember if that’s something google and the like used to do, but doesn’t now, or if they never did. Either way, I love it!