the last section before the conclusion only mentions readability
Eager Eagle
- 0 Posts
- 12 Comments
The example of a string length function could be replaced by any other API
I don’t know about that,
len
is a built-in – likestr
,abs
,bool
. There are only a few of them and they’re well known by people familiar to the language (which seems to exclude the article author). Their use is more about the language itself than about what to expect from a particular API.In fact, most Python APIs that go beyond built-in usage actually look much more object-oriented with “left-to-right”
object.method()
calls. So this argument seems silly and goes away with some familiarity with that language.
People don’t, in fact, read code from top to bottom, left to right
100% this.
This false premise is also why a few (objectively wrong) people defend writing long essays: functions with hundreds of lines and files with thousands; saying “then you don’t have to go back and forth to read it”, when in fact, no one should be reading it like a novel in the first place.
Once you get used with list and dict comprehensions, they read just fine. Much like the functional approach is not really that readable for a newcomer either.
IMO all those examples are less readable than writing it in an imperative way using good function and variable names.
Also,
len()
is a Python convention and a built-in function that calls__len__()
on that object. It’s even more established than.length
in JS, so I really don’t see why someone would expect anything else. And even then, one could callmy_list.__len__()
if they really wanted to be sure and have that “left to right” bonus.
Eager Eagle@lemmy.worldto Technology@lemmy.world•Goodbye, $165,000 Tech Jobs. Student Coders Seek Work at Chipotle.English6·3 days agoIndividuals buying/renting for themselves don’t destroy any housing market.
Scalping companies buying hundreds of houses and apartments in a city to leave them vacant and artificially pump prices do.
Eager Eagle@lemmy.worldto Self Hosted - Self-hosting your services.@lemmy.ml•My biggest annoyances with NGINX-managerEnglish2·7 days agoDisagree. When it’s inherited, the gray value is not applied, because it’s defined somewhere else. It’s not a default in this case.
Eager Eagle@lemmy.worldto Self Hosted - Self-hosting your services.@lemmy.ml•My biggest annoyances with NGINX-managerEnglish0·9 days ago… the default might change…
That’s getting into application state management and heavily dependent on what kind of form it is.
What I wrote above reflects what web forms usually follow, and they don’t use faded values for defaults, because in the context of a form, defaults are just values that were pre-populated and get no special styling.
Eager Eagle@lemmy.worldto Technology@lemmy.world•ChatGPT 5 power consumption could be as much as eight times higher than GPT 4 — research institute estimates medium-sized GPT-5 response can consume up to 40 watt-hours of electricityEnglish2·9 days agoBit of a clickbait. We can’t really say it without more info.
But it’s important to point out that the lab’s test methodology is far from ideal.
The team measured GPT-5’s power consumption by combining two key factors: how long the model took to respond to a given request, and the estimated average power draw of the hardware running it.
What we do know is that the price went down. So this could be a strong indication the model is, in fact, more energy efficient. At least a stronger indicator than response time.
Eager Eagle@lemmy.worldto Self Hosted - Self-hosting your services.@lemmy.ml•My biggest annoyances with NGINX-managerEnglish1·9 days agoThose TrueNAS fields seem gray because they’re disabled (since it’s inherited), not because those are defaults.
Eager Eagle@lemmy.worldto Self Hosted - Self-hosting your services.@lemmy.ml•My biggest annoyances with NGINX-managerEnglish0·9 days agoFor the web, there’s no reason to make them faded out / grey if they’re default values.
Those fields can just be pre-populated with those default values, which is unambiguous and get sent with the other user-edited fields.
Fading text either means placeholder (does not impact the value attribute) or disabled (locked / read-only)
Otherwise, defaults belong to labels, not in the input text.
Eager Eagle@lemmy.worldto Technology@lemmy.world•Why LLMs can't really build softwareEnglish4·9 days agoI have a solution for that, I just need a small loan of a billion dollars and 5 years. #trustmebro
That’s malpractice in most cases, and thankfully, becoming more rare to find in the wild. Any decent linter will shout at you for using star imports.
Then he should have picked examples of APIs that break this, not use the built-in functions. Because as it reads now, it seems he is just against established conventions for purism.
yeah, one of my favorite things about python is that everything not in the language itself is either defined in the file, or explicitly imported. Unless, like mentioned, you have anti-patterns like star imports and scripts messing with globals().