Reading through the specifics of what the guy’s said and done, clearly a good move
Reading through the specifics of what the guy’s said and done, clearly a good move
In the way that’s common in languages like Java where you’re making a property read-only, yes. But there’s a whole protocol in Python called descriptors where you can override the . on a field. The most common form of these is class methods annotated with the @property annotation, which makes it so the method can be accessed as if it were a property.
Yeah. I can understand the use case when it’s something relating to keeping simple state in sync by replacing it with derived state. But this particular case was flushing a cache after each get, which made each get of the property non-deterministic based on the class’s state.
I helped a friend debug a script last week that was working inconsistently in really weird ways. I looked at the script and it was all event hooks littered with sleep calls. I told him he was basically fuzz testing his own script and then getting surprised when he found race conditions. Shit was wild. Also, sometimes getters in Python are a mistake.
dozen = 12 + 1; // one extra for the baker!
I got mad at this when I first saw it but then I remembered there’s some code at work that defines an hour as 50 minutes
Statistically, this makes your code better
Yeah…. I’ve definitely been the next guy on a couple bad regexes that I wrote
When versioning and feature flags are too hard: just use git and hope for the best
My old senior used to do this before he got laid off and now I’m charge of code that’s littered with old commented out code and no way to know why it was commented out.
Then it breaks years after you’ve left and someone has no choice but to touch it
I often use comments as ways to say, “I know this is cursed, but here’s why the obvious solution won’t work.” Like so:
/**
* The column on this table is badly named, but
* renaming it is going to require an audit of our
* db instances because we used to create them
* by hand and there are some inconsistencies
* that referential integrity breaks. This method
* just does some basic checks and translates the
* model’s property to be more understandable.
* See [#27267] for more info.
*/
Edit: to answer your question more directly, the “why not what” advice is more about the intent of whether to write a comment or not in the first place rather than rephrasing the existing “what” style comments. What code is doing should be clear based on names of variables and functions. Why it’s doing that may be unclear, which is why you would write a comment.
So this is admittedly the first genocide I’ve followed this closely in real time. Is it normal for them to just… announce what they’re doing the entire time? The general who drafted the plan posted it on YouTube? What?
Linux installs have gotten so quick and painless over the past decade or so. Usually just following a GUI, waiting like 5 minutes for the install, and suddenly you’re booted into a fresh desktop.
Yes, that’s what I’m talking about. Funny how Trump is a fascist no matter what definition you use.
Umberto Eco completely ignores the material basis for fascism, which is usually the downwardly mobile petit bourgeoisie. Fascism takes advantage of superstructural elements, which is why Eco’s list contains the elements it does in a kind of grab bag fashion. But it still has a material basis, itself being a response to a crisis within capitalism. Would highly recommend The Jakarta Method for further reading on what people are discussing in your replies and in this thread.
I spend 8 hours a day gluing together spells my company purchased from a proprietary caster’s book to serve increasingly arcane (no pun intended) business needs. In my free time, I like to read about the latest advancements in corporate spellcraft, but most of the new spells are either patches of old spells or new spells that fix problems created by popular spells of the past 5 years. These new spells inevitably introduce new problems that will be “solved” in another 5 years.
How people think wizards would talk:
Behold! I have unfurled powers beyond mortal comprehension!
How wizards would actually talk:
If I hear, “why don’t you just channel the infernal essence through an ephemeral plane?” one more goddamn time from someone who hasn’t actually read the fucking rune diagrams, I’m going to lose my shit.
The dude who admitted on national tv to never washing his hands? Lmao