Show newer

I've been conducting more interviews lately, some of which involve traversing a tree / graph, and I am kind of surprised to find that uniformly everyone does these traversals with recursion. I'm not surprised to find that it's popular (I think it's often taught as an example of something where recursion is appropriate), but I personally almost never use recursion (especially in Python).

I think the main reasons I almost always avoid recursion (both in interviews and in practice) are:

1. I prefer to be very explicit about the resources I am using. It's easy to not realize how much overhead you are storing in the frame stack, whereas when you have an explicit stack or queue of nodes, it's quite easy to see what you are storing and passing up and down the stack.
2. No running into recursion limits (mostly Python specific thing).
3. It's pretty easy to switch between depth and breadth first searches by changing from a stack to a queue and vice-versa, whereas if you change your mind and decide you need to do BFS when you've written a recursive traversal, you have to rip everything out and start over.
4. When I need access to some resources outside of the traversal (either to modify them or for some other reason), it seems cleaner to use a variable that is already in scope rather than a closure (though maybe that's a dubious distinction).

Looking at this list, I do think that (other than the recursion limit thing), this is mostly just a bias against recursive functions. I think the primary benefit of a recursive function is that I think it's easier to pivot to a concurrent traversal by spawning multiple child nodes and letting the stack handle your resolution order for you.

@cenobyte Pretty much every aspect of it.

1. The client is this monolithic thing with all the servers in the sideboard, and then *every room on the server* is available and possibly generating notifications. Even being default-in every room would be annoying enough, but from what I understand you can't even leave or hide rooms you don't care about!
2. The voice chat doesn't seem to work as well as other options I've used before, which I thought was the whole point of using a Discord?
3. No alternative clients and no support for multiple accounts (at least on Android).
4. If I'm not using the *absolute latest client*, Discord refuses to connect. The Arch linux package for discord updated pretty much immediately, and I still couldn't connect because my specific package server had not refreshed their index in the last *four hours*.
5. It's a walled garden situation controlled by discord. Apparently discord has some questionable content policies (servers can get banned for allowing people to talk about violating the ToS of a service, apparently?)

I essentially only use this platform when I absolutely must (and even then poorly). I am totally the kind of person who drops into an IRC or other chat room for a specific purpose and just never leaves for years and years, but I am *never* tempted to do this in any sort of Discord or Slack.

@poleguy @lucifargundam All messaging apps these days are pretty bad in most ways. I think Matrix is probably best because it is a protocol with a few implementations. Signal is also miles better than "SMS Group Chat", even if Signal leaves a lot to be desired as a platform.

Man, every time I've used Discord it has been an aggressively unpleasant experience. How is this platform so popular?

@hugovk Oh man I missed cake!

At least I got to have some of that reindeer poop licorice. 🤤

Traveling to Seattle without renting a car or bringing an umbrella...

It is supremely weird to me that the default view of stock charts I've seen always seems to show a chart from the last day. I guess it is consistent with the hyperbolic and (arguably) borderline irresponsible nature of modern media...

Hm.. Website has cross-site-origin headers configured incorrectly on their feedback form, meaning I cannot actually send them any comments, like, "By the way your feedback form is broken..."

@poleguy I am not an expert in Spanish, but as an expert in Dad jokes, I would play off the concrete vs metaphorical meanings. The goal is to interpret it as something that is a valid meaning according to the grammar, but not one that a normal person would ever interpret it as in that situation, like, "¡Tengo hambre!" "¡Ay no! ¡Debes dejarlo!" Or "¿Verdad? ¿Puedo verlo?"

"¡Estoy aburrida!" "¿Así es? ¿Dónde esta Burrida? ¿Está cercana?"

@poleguy Yeah it struck me as obviously weirdly direct, but my friend from Spain didn't catch it until I pointed it out, so I was surprised to find that it wasn't universally obvious.

Para los que tienen el español como lengua materna, ¿le encuentran sentido a este chiste malo de papá sin necesidad de traducirlo al inglés?

youtu.be/CpcWbwwLHkg?si=d_W8Ml

(4m29s si el enlace no te lleva directamente al momento exacto)

@mahmoud I'm bemused and nonplussed to learn the true meaning of chuffed.

@mahmoud Wow. I feel like "chuffed" has "nonplussed syndrome", in that it sounds like it means the exact opposite of what it means.

New #cattrs is out (24.1.0) but I'm too exhausted to do a large thread about it. The changelog is pretty large: catt.rs/en/stable/history.html

A couple of my favorite features:

Hook factories can have the converter injected as an argument now. This very simple change makes them much more self contained and more fun to write.

Some converter APIs can be used as decorators now, and will read type hints from the decorated functions. It's a small thing but it adds finesse.

@hynek helped focus the docs!

I entered a game into #ifcomp2024 called Birding in Pope Lick Park! Its a peaceful simulation of one of my #birding walks in my favorite park. It includes photos taken by me of actual locations in the park, and photos taken by me of many of the birds mentioned in the game.

Play here: ifcomp.org/ballot?alphabetize=

It should take roughly 30 minutes. Play on WiFi because of the high resolution images. Should work on phones or computers.

#ifcomp #InteractiveFiction

Mildly chuffed that I can't find recommendations for practical tips for which phone to get for a young kid (6-7).

All I can find is moral panic narrative stuff about not getting your kid a phone and recommendations for super locked down, deliberately crippled Orwell phones. I am looking for stuff like, "This one is cheap and rugged and they can operate it with their tiny hands" not "This one doesn't have a browser and you can remotely activate the camera to spy on your child, if you're insistent on raising a damaged child who had a phone too early."

Show older
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.