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.
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
In the US? IMO only possible in exclusive environments similar to saunas at spas or membership-based clubs/gyms
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.
Call their bluff!
If they’re SO concerned and want help signing bans for imaginary problems into law, there are plenty of real issues worth trading for in exchange.
E.g. from now on, schools nationwide are additionally funded to both prohibit litterboxes for students that identify as cats and provide free and healthy school lunches.
Idgi – is it saying that every game is either named “X” or “Y’s X”?
There’s the practical distinction between “everyone can do it with some dedicated intent” (so few actually bother) vs “everyone can do it on a whim”
Seems it depends on which elite/establishment, going by Wikipedia’s definition: “populism” is the political stance of “the people” against “the elite/establishment”
So by that defn, both of these examples qualify:
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’ve heard of publishing software to design photo albums/scrapbooks/cards etc. Is there a photo collection manager for archiving, sorting and filtering?
Given access to a large set of personal photos, say tens of thousands, it should be able to group, categorize, tag, and sort along a myriad of dimensions.
Example dimensions would be time, people and places. It would need some facial recognition/image classifier/similarity scoring capability.
There definitely are some cloud offerings today that do similar things, but I’d want it to work locally for privacy and practical reasons.
The synchronization problem (flakiness and all the waits) is tricky to get right. Browsers are concurrent systems, and programming around one is specialized enough that many devs don’t do it well, e.g. IMO if you’re adding ad-hoc waits or nesting timeouts, you’ve already lost.
Good code is code that’s easy to delete.
I’m not a game dev, but it’s got a reputation for being more of a software engineering shit show than other software industries, which your story only reinforces.
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.