I don’t understand, if you’ve got easy to delete copy-pasted code, then delete it. It’ll be a nice and cathartic exercise.
But sounds like what you’re really talking about is code that isn’t easy to delete.
I don’t understand, if you’ve got easy to delete copy-pasted code, then delete it. It’ll be a nice and cathartic exercise.
But sounds like what you’re really talking about is code that isn’t easy to delete.
Distributing power across a group of communities over the same topic (e.g. like seats in a congress/parliament) is a nice thought.
However, my second thought was how vulnerable that is in a fediverse. To continue the analogy, an adversary could create new states (server/communities) of arbitrary population (accounts) at will.
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.
That’s changing the goal posts to “not static”
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.
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.
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
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
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”.
One of the best tutorials on really “grokking” git
concepts, and it’s online and interactive: https://learngitbranching.js.org
For programming, start with buildings things for yourself. Be practical, start small, and iterate, regardless if you consider the previous iteration was a success or failure. I’ve heard good things about https://automatetheboringstuff.com/ (in Python) in this regard.
Can address it by writing code that doesn’t depend much on indentation, which also makes code more linear and easier to follow.
In recreational climbing, skin calluses and surface abrasion aren’t usually much of a concern compared to tendon health. Skin heals light damage quite easily.
However, it’s not uncommon for a new (or experienced) climber to develop their muscles beyond what their own tendons can take. Since it takes tendons so long to strengthen, it’s common to need managing the risk of finger pulley tendon injuries in climbing.
Also, I do not know how these nuances apply in your context of your medical condition.
wanted to add something to the end of a for-loop, but had too little indentation
To address this, I prefer reducing length & depth of nested code, so the for
/while
is rarely ever not visible along with everything inside it. Others have success with editors that draw indentation lines.
opening up new/anonymous scopes
I occasionally use Python nested functions for this purpose
I find it’s possible to operate Python as a statically typed language if you wanted, though it takes some setup with external tooling. It wasn’t hard, but had to set up pyright, editor integration, configuration to type check strictly and along with tests, and CI.
I even find the type system to be far more powerful than how I remembered Java’s to be (though I’m not familiar with the newest Java versions).
All methods? Of course not. Just methods like these.
I really dislike code like that. Code like that tends to lie about what it says it does and have non-explicit interactions/dependencies.
The only thing I can really be certain from that is:
doAnything();
if(doAnything2()) {
doAnything3();
}
I.e. almost nothing at all because the abstractions aren’t useful.
I agree with the author overall, and I think it can be more straightforwardly stated. IMO it’s the idea that wrong abstractions are even worse than other ills like duplication or god classes/modules. It’s also reminiscent of “modules should be deep”.
I prefer that, though (it’s in my calendar, but I don’t have to accept). I really can’t stand Outlook’s email-based calendar workflow.
It’s the difference between knowing you’ll grow and graduate together with your classmates vs knowing you’re only going to see them for that one month before you move away.