Kache

joined 1 year ago
[–] Kache@lemm.ee 70 points 3 weeks ago (1 children)
[–] Kache@lemm.ee 3 points 1 month ago* (last edited 1 month ago)

IMO folding to hide is about equivalent to moving all contents to another file/private function:

def bad_function(args):
    return _hide_elsewhere(args)

i.e. does nothing. Real solution to pyramids of doom is to fix the code.

[–] Kache@lemm.ee -1 points 1 month ago* (last edited 1 month ago)

That's changing the goal posts to "not static"

[–] Kache@lemm.ee 1 points 1 month ago* (last edited 1 month ago) (2 children)

Sounds easy to simplify:

Use one of: constructor A(d), function a(d), or method d.a() to construct A's.

B and C never change, so I invoke YAGNI and hardcode them in this one and only place, abstracting them away entirely.

No factories, no dependency injection frameworks.

[–] Kache@lemm.ee 6 points 1 month ago* (last edited 1 month ago)

IMO factory functions are totally fine -- I hesitate to even give them a special name b/c functions that can return an object are not special.

However I think good use cases for Factory classes (and long-lived stateful instances of) are scarce, often being better served using other constructs.

[–] Kache@lemm.ee 5 points 1 month ago (1 children)

Dedicated incremental static type checkers for dynamic languages already exist. In particular, Pyright for Python is fantastic and in many ways surpasses the type systems of classic typed languages

[–] Kache@lemm.ee 2 points 1 month ago* (last edited 1 month ago) (1 children)

But would you pay for it?

My employer's paying for my access, and I only find it a bit useful here and there

Maybe my company gets a great discount or something, but if they would pay me the subscription cost to give up Copilot, I wouldn't miss it

[–] Kache@lemm.ee 1 points 1 month ago (1 children)

You can reference envs from the host in docker compose, so code it in instead of manually passing tribal knowledge in: https://stackoverflow.com/a/73826410

[–] Kache@lemm.ee 1 points 1 month ago* (last edited 1 month ago) (3 children)

Simpler to keep everything in one compose file if you can, under a test service that doesn't build unless explicitly named

Un-weird that env var and use the normal, boring feature of defining environment under your test service

[–] Kache@lemm.ee 2 points 1 month ago* (last edited 1 month ago) (5 children)

I've often been able to alias drun='docker compose run --rm --build' and simplify down to:

drun test

Should be able to encode all those wayward args into docker-compose.yml or Dockerfile and only use vanilla docker commands -- that's the whole point of containerization

[–] Kache@lemm.ee 6 points 1 month ago

In the US? IMO only possible in exclusive environments similar to saunas at spas or membership-based clubs/gyms

[–] Kache@lemm.ee 56 points 2 months ago* (last edited 2 months ago) (1 children)

I think your ideas are too non-practical/specialized/advanced/low-level for your stated goal of 'digital literacy". They read more like college intro/followup course material and are too esoteric to be readily absorbed, esp by generic teenagers, even if they've self-selected to be "lightly interested".

view more: ‹ prev next ›