@avidamoeba@lemmy.ca cover
@avidamoeba@lemmy.ca avatar

avidamoeba

@[email protected]

This profile is from a federated server and may be incomplete. View on remote instance

avidamoeba ,
@avidamoeba@lemmy.ca avatar

A random letter soup brand "KORIMEFA" isn't making helmets up to snuff? I'm shocked.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

There various strengths of styrofoam. Check out Berm Peak stepping on some helmets.

How much does it matter what type of harddisk i buy for my server?

Hello, I'm relatively new to self-hosting and recently started using Unraid, which I find fantastic! I'm now considering upgrading my storage capacity by purchasing either an 8TB or 10TB hard drive. I'm exploring both new and used options to find the best deal. However, I've noticed that prices vary based on the specific...

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Yes three are differences but you're running a redundant array of independent disks in order not to care about those differences.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Sure but technically non-redundant schemes also fall under the category. E.g. RAID0, multiple non-redundant ZFS vdevs, etc. Those would be reducing the performance effects of single disks.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Maybe go with a longer range RFID and implant it somewhere visible so there's less signal attention from clothes and such.

avidamoeba ,
@avidamoeba@lemmy.ca avatar
avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

Various interests who profit from underfunding education who present phones as the boogeyman that made education bad. I don't know, I'm just guessing.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Me 2.

UN denies Gaza death toll of women and children has been revised down ( www.theguardian.com )

The UN has denied that the estimated death toll of women and children in the war in Gaza has been revised downward, pointing towards a confusion between the total numbers of dead bodies recorded, and the number of those who have so far been fully identified....

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Sounds like heavier bombs would keep the second number lower. 🧠☠️

avidamoeba ,
@avidamoeba@lemmy.ca avatar

We knew Doug is gonna fuck it up we just weren't sure exactly how. This is so fucking sad. Him and his brother have wasted so much investment in the quality of life for people in Ontario and Toronto it's just criminal. His brother set back transit in Toronto by a decade with nothing to show for it.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Just when you thought this couldn't get any more stupid.

avidamoeba OP ,
@avidamoeba@lemmy.ca avatar

Let's see how long the "let's repeal the carbon tax" premiers react.

avidamoeba OP ,
@avidamoeba@lemmy.ca avatar

Brilliant idea 💡

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Oh this sounds brilliant. And they can't even show what the targets are because they don't know them. Some lambda computes them on the fly, per person, per hour.

avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

Joe is Hamas now.

/s

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Any word on extension data sync between Android and desktop?

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Just Bezos whining that he isn't getting them subsidies.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Good LiPo bags work for small batteries. The batteries in most ebikes would burn through those. You can find video tests that show this. For ebike-sized batteries you need an ammo can. Even then if you want to ensure your home doesn't get poisoned with fumes, it should be in a ventilated area, garage or outside.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Indeed. With that said there are some cultural cases too. I know of several families who did well financially but left years ago because Canada was getting too woke for them. Some went back to Eastern Europe where racism is alright, and others went to Florida. Still these kind of cases are probably the minority. 😄

Personally I do have the grass-is-greener periods now and then but I'm sticking with Canada due to what I think is likely one of the safest places to be in 2050. I'm trying not to think about how drought, heat and extreme weather will affect many other parts of the world. I think we still have a chance to keep this place decent socioeconomically and politically.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

I'm counting on us being close to mostly sane states. When shit begins hitting the fan I think they'll gain significant control over the US simply because they'll be much less fucked economically than the South. So I imagine that even if there is some sovereignty dispute or a "takeover" it would be closer to moving to NY or California than moving to Florida or Texas. Of course these are super wild guesses. If the US goes full dictatorship it will be a Southern dictator who could usurp national power for decades... So go Stormy go!

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Is this going to be the mule produced by breeding OpenAI with the Bing team?

avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

Weird feeling about this. $5-$20 flat fee sounds like a lower price than what I'd imagine donations would bring. I imagine most who would donate would give at least $5-20, and then some would subscribe monthly. The dev team is obviously gonna get funding from Eron for now which would likely be higher today than what they get in donations.

avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

Me too, I subbed for monthly.

The one thing I can see FUTO can do is provide capital up front for developers to work which could be recouped over time as more users begin to use and pay for the software. That makes sense and in a competent, not neoliberal economy, the government might have a fund doing something like that. What I'm a bit worried about is that this might not be all Eron's up to. But again, we'll take his money when he gives it, so long as the work is open source. And we'll see where we end up in a few years. 😅

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Uses multiple returns... I'm switching to Windows.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Fuck.

avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

Maintainability.

You can't read a block of code and as quickly and understand its control flow without reading every line, especially in regards to resource cleanup.

For example say you have:

...
if this:
    something
    or other
    and many more...
    ...
else:
    yet another thing 
    and some more
    ...

do some cleanup
return
...

Say you aren't exactly interested in what happens inside each branch. If you can assume that there's one return at the end of the block, you can see the if and else, you can reason about what values would trigger each branch, you can also see that no matter which branch is executed, the cleanup step will be executed before returning. Straightforward. I don't have to read all the lines of the branches to ensure the cleanup will be executed. If I can't assume a single return, I have to read all those lines too to ensure none of them jumps out of the function skipping the cleanup. Not having to think about such cases reduces the amount of reading needed and it makes reasoning about the block simpler. The bigger the blocks, the more the branches, the stronger the effect. You have one less foot-shotgun to think about. The easier you make it for your brain, the fewer mistakes it's gonna make. For all those days when you haven't slept enough.

E: Oh also refactoring blocks of code out into functions is trivial when you don't have multiple returns. Extracting a block with a return in it breaks the parent control flow and requires changes in the implementation.

E2: Shorter blocks do not obviate this argument. They just make things less bad. But they make almost everything less bad. Shorter blocks and single returns make things even better.

avidamoeba ,
@avidamoeba@lemmy.ca avatar
  • Time Troll
avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

Early returns are very similar to gotos. One level of nesting to take care of validation is trivial in comparison. You're replacing logical clarity for minimal visual clarity. This is true regardless of the size of the function which shows that the size of the function isn't the determinant. You're not alone in your opinion, clearly, and I'm not going to convince you it's a bad practice but I'll just say what I think about it. 😅 This practice doesn't make it my team's codebase.

avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

I'm sure you are capable of rewriting that in 3 lines and a single nested scope followed by a single return. In fact in languages that use exceptions you have to use at least one subscope.

Notice that in my example I didn't even broach the example with error conditions, cause it's trivial to write cleanly either way. Instead I talked about returns inside business logic. You can't unfuck that. 🐞

avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

I never said longer functions are not less clear. I said my argument is valid irrespective of the length of the function which shows that the problems I claim multiple returns bring are independent of function length. 😊

Any validation you can write with a few early returns you can write with an equivalent conditional/s followed by a single nested block under it, followed by a single return. The reader is free to leave if the validation fails nearly the same, they have to glance that the scope ends at the end of the function. Looks at conditional - that's validation, looks at the nested block - everything here runs only after validation, looks after the block - a return. As I mentioned in another comment, validation is a trivial case to do either way. Returns inside business logic past validation is where the problematic bugs of this class show up which requires more thorough reading to avoid.

If you gave me a PR with early returns only during validation, I probably won't ask you to rewrite it. If I see them further down, it's not going in.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Again, if you can write it with conditionals and returns, you can write it with equivalent number of conditionals and a single nested scope. No further scopes are needed. The conditional will even look nearly identically.

avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

I don't think it's worse, I think it's equivalent. Also I don't like the risk of resource leaks which is inherent to multi-returns beyond input validation. And that's true beyond C because memory isn't the only resource that can be leaked.

It's not about how readable the branches are, it's about having to read all of them to ensure you understand the control flow so that you don't leak. Length of functions is a red herring. You want me to read the contents of short blocks to ensure the control flow is correct. I don't want to read the contents of those blocks, other than the conditional and loop statements. Reading short blocks is better than reading long blocks. Reading just the control flow lines is better than reading short blocks.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

I meant assigning a return value then returning it is the sam as rnultiple returns. Anyway.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

That was the joke. 😂 I bet Windows is worse.

avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

Not sure why you had to do the inverted predicate check again in your first example. You already have the information encoded in the value of retval. It can be written like this:

int result = 0;
if (!p1) result = -ERROR1;
if (p2) result = -ERROR2;
if (!p3 && p4) result = -ERROR3;
if (result != 0) {
    result = 42;
}

return result;

With a return value you have to add 4 extra lines. This overhead remains constant as you add more checks and more business logic.

Yes all the other suggestions are better than early returns in business logic and would help with leaks. Would be nice if we had RAII outside of C++. I think Rust has it? Haven't done Rust yet.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

goto cleanup is not the same as return. I didn't badmouth goto cleanup.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Yes clearly someone has to read the blocks at least once to ensure they are correct.

In subsequent reads, when I'm interested in the second block out of two, say during a defect analysis, I don't have to read the first one to be sure I'm going to reach the second. I can straight head for the second one and any subsequent stuff I care about. Multiple returns force me to read both blocks. I don't know what else to tell you. To me this is obvious and I think it's probably even provable. I don't know about you but I have to read a lot of existing code and every bit helps. We have pretty strict code style guides for that reason.

avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

Clearly I'm not referring to an if/else by saying two blocks. Even in my original example I show the exact issue. You don't understand it. I can't explain it better.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Have you stopped to consider why you can't explain it better? Perhaps the reason is because you're wrong.

Yes I have. You've already assumed I'm not too bright more than once and worked from there. There's no point in investing more work on my end. If what I said worked, good. If not, that's fine too.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Jerboa. Because it works alright, it's open source and it's the Lemmy team's app.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Read the article. 😊 I mean, it's even in the one sentence summary.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

I don't see this mentioned often, but ebikes just feel good to ride. People are hesitant until they try them. Once they try them, it's over. Especially if it's a nice torque-assist ebike they tried.

avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

Time to install a front hub. Small geared like the Bafang G311 for lightweight or Grin All-Axle for the same reliability as the rest of your bike. 😁

I run a rear G310 with 11sp drivetrain but to be honest if I knew everything I do now when I designed the build, I'd have left my drivetrain intact and used a front hub instead. It's way easier to do, fewer compromises and it could even end up lighter.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

I guess you're right that cheap cadence sensored ebikes might not feel that great, especially to people used to nice pushbikes.

avidamoeba ,
@avidamoeba@lemmy.ca avatar

Some BSOs shittiness can't be overcome by any number of watts.

A nice bike with a small front hub (1.8kg), torque sensor and a small battery (2kg) can feel amazing. It adds very little weight so the handling doesn't change much but you get superpower that feels like it's connected to your legs.

avidamoeba , (edited )
@avidamoeba@lemmy.ca avatar

Oh I'm aware, am part of the industry. I think the disparately higher compensation relative to the rest of the economy has given us a false idea we're paid fairly (perhaps even unfairly high) for what we produce. Which I have definitely felt myself. In fact I've felt very strange of the disparities within the industry itself. However that's completely the wrong way to look at it. There's no magical upper number that our labor deserves. Everything is determined by what people pay and how much they buy. (I'm not saying that's the only way it should be) So if the revenues and profits are sky high, and we know labor makes most of it happen, then our labor is simply worth that much more. Given that someone will collect the difference, we may as well get a larger share of it. The sooner we recognize that, the sooner we'll get even higher compensation which will be much more beneficial for people in the wider economy than a much smaller proportion of the exec class getting wealthier. But that can't happen without unions. We mistake the temporary labor shortage for stable and strong negotiation leverage.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • kbinchat
  • All magazines