Collecting my attempts to improve at tech, art, and life

2024-05-24

Tags: hackers-town

Does any of this enlighten, entertain, or otherwise please you? Please consider a Tip. Every little bit helps!

I last updated this page

Activity Log

hackers.town: 2024-05-24 Fri 07:33

@mills_lane @WuMargaret @Adam_Cadmon1@mastodon.online @semifor @Chanclatrix @genehack @minego @gizmomathboy @perigrin @Trg404 @fitzgepn @jacobydave

ℹ️ 5022adedc06bb063.mp4 missing from archive

hackers.town: 2024-05-24 Fri 08:01

@maddiefuzz Prometheus chained to the rock with an eagle gnawing on his internal organs at dawn

welcome to another workday, am I right big P?

Ready for the stand-up at 9? Sisyphus says he finished the TPS reports but I got a feeling we’re gonna send him back to touch them up again.

hackers.town: 2024-05-24 Fri 08:45

Yes I absolutely did just write a one line toggle function because my brain tripped every time I read flag = not flag in my Python code.

hackers.town: 2024-05-24 Fri 08:52

I know what flag = not flag means, of course. It means grab the opposite of flag, when treated as a boolean.

But I have to think about it for a fraction of a second every time I see it, so hide it behind the verb my brain’s translating that to.

Way better than adding a comment above saying # toggle the flag. Now that would have been silly.

hackers.town: 2024-05-24 Fri 08:55

@raganwald Thanks! I never felt bad about it in my Perl or Ruby code, but tiny functions for narrative abstraction are more popular in that world.

hackers.town: 2024-05-24 Fri 08:57

@mmastrac @deno_land well dangit. Okay well I’ll just have to track a new place then!

Congrats on what sounds like a positive move?

hackers.town: 2024-05-24 Fri 10:07

My brain’s not in great deciding-mode today – a frequent issue TBH – but it is doing great at seeing obstacles to that process.

So rather than deciding what and how to pack, I’m pulling everything from the hard to reach corners and putting them in easily accessed but out of the way spots. That way deciding what and how to pack should only take a step or two.

hackers.town: 2024-05-24 Fri 10:31

I don’t like using mypy in strict mode. Explicit return types feel redundant in Python.

But I’m treating this code as a prototype for similar in maybe a more strictly typed language, so I’m preparing for that strictness by using mypy --strict.

hackers.town: 2024-05-24 Fri 10:32

@chuck I do appreciate that! I know only Pydantic and mypy care about types in Python, so if this wasn’t helping future me I’d feel pretty silly.

hackers.town: 2024-05-24 Fri 10:39

Thanks to thinking more about return types, I’ve also finally figured out something I do all the time is maybe not the best choice: factory class methods to construct an object.

See, if using explicit return types, your factory method needs to reference a class you’re still in the process of defining. You can reference it as a string or import the future annotations feature.

Normally I’d just do whatever to make mypy happy and move on. But it finally clicked that these are workarounds, and need extra work from both your type checker and future you.

A factory function defined outside the class would require no workarounds and less explaining to someone unfamiliar with typed #Python.

Anyways, there’s my morning brain fart.

hackers.town: 2024-05-24 Fri 10:45

A lot of programming lessons boil down to “it hurts when I do this,” and “stop doing it then.”

hackers.town: 2024-05-24 Fri 11:43

Reminded of a job a few years back that felt like a good job at the time. Everybody was so nice and emotionally supportive.

However.

Everything that was presented as a choice or decision between paths, they already had made the choice.

“Task A or B?” “ooh B sounds right up my alley.” “Oh gosh sorry, we really need someone on A. Maybe later you can do B.”

“Team X or Y?” “oh gosh, X is doing things I love and my skills would fit in perfect with their needs.” “Oh gosh sorry we need to put you on Y. Budgeted project priorities, you understand. Maybe next quarter?”

Unsurprising that I was constantly stressed and did not do my best work.

That pattern went all the way to a “quit with severance now or keep trying and maybe not get fired later.” I knew what choice I wanted to make, but I’d figured out the pattern by that point. Wasn’t a great severance, but enough to help us out for a bit.

Anyways, “nice” is fucking useless at work.

hackers.town: 2024-05-24 Fri 11:49

@zwol Oh me too. The LSP usually catches inconsistencies, but without some kind of external reminder I’d be in trouble. The mypy thing is a conscious decision to make those inconsistencies more obvious.

hackers.town: 2024-05-24 Fri 11:50

@lordbowlich Apparently neither could I.

hackers.town: 2024-05-24 Fri 14:45

@flyingsaceur Oh I routinely write my code with an LSP and linter in hand, which is probably why explicit return types feels redundant. But it’s just a feel. I don’t fuss about it that much.

As for the cognitive load part, I’ve found type aliases help immensely there. ConfigDict is less work to read than dict[str, str|int|bool] and way less than deciphering the code without type hints or LSP.

hackers.town: 2024-05-24 Fri 14:51

@flyingsaceur I usually start with dataclasses, then go to namedtuple or Pydantic if I feel the bit needs to support less or more complexity.

attrs does the job well too, but Pydantic has stolen a lot of the mental space for “when dataclasses aren’t good enough” that attrs used to occupy.

hackers.town: 2024-05-24 Fri 14:59

Back in Reader, I had dozens of categories and subcategories for my RSS subscriptions. That carried over into Feedly, but I wasn’t really paying close attention to what went where.

These days it’s way simpler (and one category’s for debugging my site generator). But I like it.

ℹ️ 6c3e0f1025365348.png missing from archive

hackers.town: 2024-05-24 Fri 15:06

@tk No, I’m using NetNewsWire (when on macOS)

hackers.town: 2024-05-24 Fri 17:16

Apropos of absolutely nothing I mean heck I’m not even working right now so clearly this ain’t about me but

I just want to mention that I’m occasionally reminded, by contrast, just how good @genehack and @perigrin have always been at the empathetic and understanding communication part of being a people manager.

hackers.town: 2024-05-24 Fri 17:19

@IamMrsGeek MEDICAL CHEESECAKE

IT IS FOR YOUR HEALTH

AND THEIR SAFETY

hackers.town: 2024-05-24 Fri 17:25

@neauoire Oh no. I’ve seen this movie.

hackers.town: 2024-05-24 Fri 17:26

@neauoire so a body count of at least one

hackers.town: 2024-05-24 Fri 20:52

Remembering when Jack helped us decide it was time for new bookshelves.

ℹ️ fa27ec6662b669fe.jpeg missing from archive