• 0 Posts
  • 11 Comments
Joined 1 year ago
cake
Cake day: August 2nd, 2023

help-circle
  • And memory bugs are only a subset of bugs that can be exploited in a program. Pretending Rust means no more exploitation is stupid.

    This is facile.

    According to Microsoft, about 70% of security bugs they see are memory safety issues.

    Yes: if you introduce memory safety, there’s still those 30% of security bugs left. But, well, I’d rather worry about 30% of issues than 100%…

    Similarly, I use libraries that eliminate SQL injections unless you really go out of your way.



  • I still think it’s a really weak definition if you give out arbitrary date ranges which inevitably leads to random smaller generational definitions and too many varying opinions on what generation starts or ends where.

    The point of generational cohorts like millennials or the silent generation is that being born at a particular time in history has an affect on people.

    The silent generation’s earliest memories were depression and war. The great recession impacted millennials in their early career or in high school.

    Age ranges captures that and makes it easy to measure things without having to find out when someone’s great grandparents were born.

    And yeah, 30’s on the young side. Lauren Boebert was in the news recently as a teen mother who became a grandmother at age 36.

    Your definition slips pretty quickly, though. Some siblings have really long age gaps. Some women first give birth at 18 or 19, others not til they’re 40.


  • Married With Children would have ended when millennials were somewhere between 16 and 1.

    It doesn’t really matter how strict your parents were with TV. Most millennials weren’t really in the target demographic for it when it was airing; they’d have been more likely to be watching Rugrats, Power Rangers, All That, Dragon Ball Z or whatever if left to their own devices.

    They’d have watched it if it were something their parents watched. I literally never deliberately turned on Friends or Will And Grace, but since my parents watched them, I saw a bunch of them. Married With Children wasn’t a show my parents followed, though, so the Futurama episode would have gone over my head.

    It really seems like a reference aimed mostly at the oldest millennials, gen X, and boomers.



  • What happens after you merge a feature branch into main and delete it? What happens to the branch?

    Afterwords, what git commands can you run to see what commits were made as part of the feature branch and which were previously on main?

    Mercurial bookmarks correspond to git branches, while mercurial tags correspond to git tags.


  • One problem, I think, is that git names are kinda bad. A git branch is just a pointer to a commit, it really doesn’t correspond to what we’d naturally think of as a branch in the context of a physical tree or even in a graph.

    That’s a bit problematic for explaining git to programming newbies, because grokking pointers is famously one of the stumbling blocks people have, along with recursion. Front-end web developers who never learned C might not really grok pointers due to never really having to deal with them much.

    Some other version control systems like mercurial have both a branch in a more intuitive sense (commits have a branch as a bit of metadata), as well as pointers to commits (mercurial, for example, calls them bookmarks).

    As an aside, there’s a few version control systems like darcs where instead of the first-class concept being snapshots, it’s diffs. There’s no separate cherrypick command in darcs, it’s just one way you can use the regular commands.



  • There are really very few OO languages that really lean FP.

    The essence of FP is working with pure functions that simply map their input to their outputs without mutating anything.

    To do that, you need immutability by default, or at least easy immutability. Very few OO languages do that in their standard libraries. Scala comes to mind as one of the few exceptions. There’s also a bunch of FP languages that bolted an object system into them, like Ocaml and F#.

    There’s a lot of OO languages that take some features like closures from FP languages, but it’s typically a royal pain to actually do anything functionally in those languages. Java and python come to mind here. Javascript used to be a huge pain, but with spread syntax it’s gone down to only moderately painful.

    And while you can definitely do FP + OO, to be honest there’s a bunch of similar but distinct language features in FP languages that I kinda prefer instead.


  • And where does your state go? How would a list of products be represented in FP?

    The essence of FP is functions working on immutable data.

    In FP, you have an immutable list of immutable products. This is basically the same as how when processing strings, you typically have an immutable array of immutable characters. If you concatenate two strings, you get a new immutable string. If you edit a string, you just get a new string. You don’t just edit the array itself directly.

    Because everything is immutable, though, you can be smarter about updates. All copies can be shallow. Adding something to the front of a linked list is just a matter of making a new node that points to the old list. Arrays are harder, but you can use some clever tree-based structures like a Hash Array Mapped Trie to get fast updates.

    So your state goes into the arguments of your functions.