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

help-circle
  • Nonprofits can “own” for-profits.

    One of the saner reasons for this structure is that the non-profit owns the things the for-profit works on. If the for-profit goes under, all things are still owned by the non-profit, so some large tech company can’t swoop in and yoink anything available.

    This includes any and all data generated by the for-profit, which means your data is “safe”.



  • weird dude who writes raw HTML

    Eyy, that’s me! Good excercise to learn actual HTML, instead of directly trying to jump into <insert random JS framework> and getting confused on what’s what.

    Anyway, I ended up switching to Hugo as a static site generator, because it was too damn hard to keep all my <header>, <nav> and <main> aligned for all my HTML files.

    Now I can just write a markdown file as an article, or switch back to raw HTML if I so need (like rewriting Alan Turing’s paper " On computable numbers" in HTML because I can’t use TTS on the PDFs I found; I still haven’t finished writing it, because I am now reading E. F. Codd’s papers on the Relational Model, which is pretty wild how we already figured that shit out in the 1970s!)








  • just like followers of religion

    We say that shit, because we’ve touched code that’s deeply inherited, and it was a god-damn pain to work with, because changing a single line can mean you’ll need to update a fuckton more, which breaks tests all god-damn over, which means you may have to refactor 50% of the application in one go.

    Anyway, everything has its uses (even goto). It’s just there are typically better alternatives.

    “sum types” and “algebraic data types” are horrible names.

    Agreed, but they exist due to historic reasons, and now we’re stuck with them. Not much we can do there ¯\_(ツ)_/¯

    Pretty much the equivalent of “imaginary numbers”.

    Terrible name that just means “vertical number line” (with an added operation where you rotate the vector, instead of add or scale), or “y-axis for the number line”. It’s funny because “Real” numbers are about as real as “Imaginary” numbers. Both are virtual (not physically existing).

    str | int is a sum type

    It just means that the variable can either be a str or an int. You’ve seen | used as “bitwise or”, right? Think in that direction.

    PS: Stay away from Monads - they’ll give you an aneurysm. 😂




  • What’s even the “gold standard” for logging stuff I guess?

    structlog. Or just Structured Logging in general.

    Don’t do:

    logging.info(f"{something} happened!")

    But do

    logging.info(“thing-happened”, thing=something)

    Why? Your event will become a category, which means it’s easily searchable/findable, you can output either human-readable stuff (the typical {date}, {loglevel}, {event}) or just straight up JSONL (a JSON object/dict per line). If you have JSON logs you can use jq to query/filter/manipulate your logs, if you have something like ELK, you can insert your logs there and create dashboards.

    It’s amazing - though it may break your brain initially.