• 0 Posts
  • 21 Comments
Joined 1 year ago
cake
Cake day: July 3rd, 2023

help-circle

  • expr@programming.devtoProgrammer Humor@lemmy.mlI love Rust
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    6 days ago

    Don’t need the Ord instance for equality, just Eq is sufficient. Ord is for inequalities.

    The point of the post is that most mainstream languages don’t provide a way to automatically derive point-wise equality by value, even though it’s pervasively used everywhere. They instead need IDEs to generate the boilerplate rather than the compiler handling it.










  • I understand what you’re saying—I’m saying that data validation is precisely the purpose of parsers (or deserialization) in statically-typed languages. Type-checking is data validation, and parsing is the process of turning untyped, unvalidated data into typed, validated data. And, what’s more, is that you can often get this functionality for free without having to write any code other than your type (if the validation is simple enough, anyway). Pydantic exists to solve a problem of Python’s own making and to reproduce what’s standard in statically-typed languages.

    In the case of config files, it’s even possible to do this at compile time, depending on the language. Or in other words, you can statically guarantee that a config file exists at a particular location and deserialize it/validate it into a native data structure all without ever running your actual program. At my day job, all of our app’s configuration lives in Dhall files which get imported and validated into our codebase as a compile-time step, meaning that misconfiguration is a compiler error.







  • It’s perfectly stable. Linux just generally attracts people who like to tinker and tweak things, in particular because it’s much easier to do and gives you a lot of power and flexibility in making the machine your own.

    My laptop running Arch Linux has remained problem-free for the last 6 years or so since I installed it.


  • With a quick search on Zillow for Lincoln, Nebraska (~300k pop college town), cheapest I can find is $90k for a 1 bed/1 bath 500 sqft condo. $100k for a 1 bed/1 bath 500 sqft house, though technically that’s a foreclosure so you might not consider that to count. The cheapest normal house for sale that I can find is $110k for a 2 bed, 1 bath 1500 sqft house. It’s an older home, but actually a pretty decent location (close-ish to downtown).