![](https://social.packetloss.gg/pictrs/image/ec8d7eb3-7d83-4623-81be-6f9b3dcb071d.png)
![](https://lemmy.ml/pictrs/image/qIIa9cvhIT.png)
Huh… So it does. Interesting.
Hiker, software engineer (primarily C++, Java, and Python), Minecraft modder, hunter (of the Hunt Showdown variety), biker, adoptive Akronite, and general doer of assorted things.
Huh… So it does. Interesting.
I confused Alzheimer’s with Autism for a minute and was like … haven’t I been on this ride before? Didn’t the paper get retracted ages ago?
🤦♂️ lol
We need to invent an image format that let’s chart colorw be tweaked after the fact lol
What’s your source that there’s not warming in the southern hemisphere?
The temperature readings would look different because winter and summer are flipped, but they absolutely should be attributing a similar effect.
Compiling to wasm also means that you can distribute a binary rather than needing people to have python installed.
I don’t know that I’d say that’s true? wasm itself is not a binary format.
It sounds like just from how you describe things Swift is using fibers instead of real OS threads(?)
Seriously look at this comparison of DispatchQueue and OperationQueue
What are these things/what is this comparing?
It’s an opinion article. Those are meant to break down groupthink/publish pieces that typically the editorial board wouldn’t publish to make people think/consider other perspectives.
The article itself is pretty harshly anti-Trump; I think the picture is intended as more of a caricature than an endorsement in any case.
Hmmm… That’s true, my rough litmus test is “can you explain what this thing does in fairly precise language without having to add a bunch of qualifiers for different cases?”
If you meet that bar the function is probably fine/doesn’t need broken up further.
That said, I don’t particularly care how many functions I have to jump through or what their line count is because I can verify “did the function do the thing it says it’s supposed to do?” after it’s called in a debugger. If it did, then I know my bug isn’t there. If it didn’t, I know where to look.
Just like with commits, I’d rather have more small commits to feed through git bisect than a few larger commits because it makes identifying where/when a contract/test case/invariant was violated much more straight forward.
This only leads to bad code when people get to afraid to refactor things in light of the new requirements.Which sadly happens far to often. People seem to like to keep what was there already and follow existing patterns even well after they are no longer suitable. I have made quite a lot of bad code better by just ripping out the old patterns and putting back something that better fits the current requirements - quite often in code I have written before and others have added to over time.
Yup, this is part of what’s lead me to advocate for SRP (the single responsibility principle). If you have everything broken down into pieces where the description of the function/class is something like “given X this function does Y” (and unrelated things thus aren’t unnecessarily coupled) it makes reorganization of the higher level logic to fit the current requirements a lot easier.
For instance I see this a lot in DRY code. While the rules themselves are useful to know and apply they are too easily over applied removing any benefit they originally gave and result in overly abstract code. The number of times I have added duplication back into code to remove a layer of abstraction that was not working only to maybe reapply it in a different way, often keeping some duplication.
Preach. DRY is IMO the most abused/mis-understood best practice particularly by newer programmers. DRY is not about compressing your code/minimizing line count. It’s about … avoiding things like writing the exact same general (e.g., a sort) algorithm inline in a dozen places. People are really good at finding patterns and “over fitting” making up abstractions that make no sense.
I agree; I prefer a “hammer and chisel” strategy, I tend to leave things a little less precisely organized/factored earlier in the project and then make a some incremental passes to clean things up as it becomes more clear that what I’ve done handles all the cases it needs to handle.
It’s the same vein as the “don’t prematurely optimize.”
Minimizing responsibilities of individual functions/classes/components is the only thing that I take a pretty hard line on. Making sure that I can reason about the code later and objectively say simple sentences like “given X this does Y.” I want all the complex pieces to be isolated into their own individual smaller pieces that can be reasoned about.
All of the code bases I’ve been in where I go “oh my god why”, the typical reason is been because that’s not true; when I’m in the function I don’t know what it does because it does a lot of things depending on different state flags.
I’ll contest their is such a thing as good code. I don’t think experienced devs always do the best job at passing on what works and what doesn’t though. Universities certainly could do more software engineering/architecture.
My personal take is that SRP (the single responsibility principle) is the #1 thing to keep in mind. In my experience DRY (do not repeat yourself) often takes precedence over SRP – IMO because DRY is easy to (mis-)understand – and that ends up making some major messes when good/reasonable code is rewritten into some ultra-compact (typically) inheritance or template-based mess that’s “fewer lines of code, so better.”
I’ve never regretted using composition (and thus having a few extra lines and a little bit more boilerplate) over inheritance. I’ve similarly never regretted breaking down a function into smaller functions (even if it introduces more lines of code). I’ve also never regretted generalizing code that’s actually general (e.g., a sum N elements function is always a sum N elements function).
The most important thing with all of these best practices though is “apply it if it makes sense.” If you’re writing some code and you’ve got a good reason to have a function that does multiple things … just write the function, don’t bend over backwards doing something really weird to “technically” abide by the best practice.
Before people get mad at Telegram; these channel things are like mailing lists or blogs, nobody is being indoctrinated by them, you have to have sought them out on your own and then hit the subscribe button.
I think part of the problem is text book authors make up problems that they haven’t taught you how to solve but they’ve taught you some pieces that maybe you could use to solve the problem, and then they expect you to figure the rest out… Which is just silly and IMO a major reason why kids that don’t have educated attentive parents struggle so much more.
Yes, but Biden can’t do anything about that (other than yell like the rest of us, the office has basically no power to address an issue like this) and Congress won’t do anything about that because the Republicans think it’s politically advantageous.
The loudest atheists I know off also happen to be white supremacists
That tells me a lot about the (supposed) “rationality” of liberal atheism
I’m really inclined to believe that you’re a troll… Liberal atheists that are white supremacists? I’ve never met anyone that fits that description. I’ll give you the benefit of the doubt a little longer…
If you want a great example of how religion has been quite negative, see the crusades, salem witch trials, the Spanish inquisition, ISIS, 9-11.
None of these events have relationships to the teachings of say, Jesus. However, they are atrocities (in cases like the crusades some of the bloodiest conflicts in history) where someone’s belief in god is ultimately what led to the conflict. In many cases the atrocities of a nation state and the religious motivation are hand in hand; the founding fathers specifically tried to separate religion from government because of this problematic history.
In the modern US religion is often used to dismiss scientific findings. Folks will say “oh it doesn’t matter if climate change is real, God will find a way for us all to continue living.” … or … “it doesn’t matter if COVID is real, God will find a way to heal me” … or … “my kid has cancer but they don’t need doctors they need prayers for God to heal them miraculously.” Religion was even used by some to justify racism based slavery in the US.
Religion has a long history of being used to incite violence or to dismiss concerns about problems where … whether God exists or not … there are concrete actions that people on Earth can take right this instant that we know will help.
I’m not going to say “we’d be better off with nobody believing in anything!” but we certainly would be better off if more people/societies didn’t listen to fanatics that have their own agenda that’s truly devoid of rational thought and the high morals most scripture seeks to teach.
Despite the comment I just posted articulating how the second amendment is muddy. I agree with you, it’s time to drop the gun grabbing tone and focus on other strategies.
It’s a bit more complicated than that. The second amendment has been “infringed upon” for roughly a century because it isn’t as straight forward as second amendment advocates claim.
A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall not be infringed.
That doesn’t say:
The right of the people to keep and bear Arms, shall not be infringed.
Which is what a lot of second amendment advocates wish it says.
If you read the sentence:
With the impending meteor, we must have daily meetings for safety.
it’s pretty clear the meteor is a factor.
The United States did not have a standing army when the second amendment was ratified. So this could be interpreted more as “the people have a right to security from threats to their freedoms foreign and domestic.”
Now that said, it’s true (to my knowledge) that the founding fathers were not opposed to violent revolution in the face of a tyrannical government. So the “militia” portion of that really just muddies the waters.
I can believe I’m going to get eaten by a talking meatball when I go to dinner tonight.
The talking meatball obviously isn’t going to eat me, it isn’t real.
The impact the talking meatball has on my decision making remains a real observable thing.
Nobody is blaming god here, they’re blaming the concept of god/gods, and how that concept has resulted in many people treating others poorly.
Note, that’s not a judgement on you (presumably) having beliefs, I believe there’s probably something out there myself. The talking meatball is purely illustrative.
Well, the image format is based on indexed color for compression purposes … But it’s not like it calls out “these indexes should be customizable”.