this post was submitted on 12 Apr 2025
196 points (90.2% liked)

Technology

68918 readers
4008 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
top 50 comments
sorted by: hot top controversial new old
[–] Opisek@lemmy.world 28 points 6 days ago (4 children)

The graph makes no sense. Did a generative AI make it.

I think there's a good chance of that:

  • -2x instead of ~2x - a human is unlikely to make that mistake
  • no space here: ==0 - there's a space every other time it's done, including the screenshot
  • the numbers are wrong - the screenshot has different data than the image
  • why are there three bars? A naive approach would have two.
[–] gerryflap@feddit.nl 5 points 6 days ago

Looks like it. It's a complete fever dream graph. I really don't get how someone can use an image like that. Personally I don't really like AI art anyways, but I could somewhat understand it as a sort of "filler" image to make your article a bit more interesting. But a graph that is supposed to convey actual information? No idea why anyone would AI gen that without checking

[–] pyre@lemmy.world 4 points 5 days ago

yeah I got angry just looking at it

[–] iknowitwheniseeit@lemmynsfw.com 3 points 6 days ago (1 children)

My ad blocker has blocked all pictures on this article, so I can't say. 😄

load more comments (1 replies)
[–] uis@lemm.ee 16 points 6 days ago (1 children)

There are decades of articles on c++ optimizations, that say "use empty() instead of size()", which is same as here.

[–] dreugeworst@lemmy.ml 5 points 6 days ago

except for c++ it was just to avoid a single function call, not extra indirection. also on modern compilers size() will get inlined and ultimate instructions generated by the compiler will likely be the same

[–] ne0n@lemmy.world 7 points 6 days ago (3 children)

Isn’t “-2x faster” 2x slower?

That woulb be 0.5x. −2x implies negative duration, which makes no sense. Neither does the layout of anything else in the image.

[–] sugar_in_your_tea@sh.itjust.works 2 points 6 days ago* (last edited 6 days ago) (1 children)

I think it was supposed to be a ~, since they use that in a paragraph below the image.

[–] phoenixz@lemmy.ca 2 points 6 days ago (1 children)

It probably is AI. Either that, or a drunken stupor that produced that graph.

load more comments (1 replies)
[–] gigachad@sh.itjust.works 6 points 6 days ago (1 children)

I don't like it very much, my variable could also be None here

[–] iknowitwheniseeit@lemmynsfw.com 3 points 6 days ago (1 children)

You'd need to explicitly check for None if using the len() construct as well, so this doesn't change the point of the article.

[–] gigachad@sh.itjust.works 6 points 6 days ago* (last edited 6 days ago) (10 children)

But None has no len

if not foo:  

-> foo could be an empty list or None, it is ambiguous.

len(foo) will lead to an exception TypeError if foo is None, I can cleanly catch that.

It suggests I deal with a boolean when that is not the case. Explicit is better than implicit, and if not foo to check for an empty list may be pythonic, but it's still implicit af

it's still implicit

I don't see it that way. If you're doing if len(foo) == 0, you're implying that foo is expected to not be None, and expecting an exception should not be the default assumption, because exceptions should be... exceptional.

Here's what I assume:

  • if foo is not None - empty values are explicitly acceptable
  • if not foo - the difference between an empty and None value isn't important
  • if len(foo) == 0 - implicit assumption that foo is not None (I frequently forget that len(...) raises on None)

If an exception was intended by the last bullet point, I prefer an explicit raise:

if foo is None:
    raise ValueError("foo may not be None")

I actually use schema validation to enforce this at the edge so the rest of my code can make reasonable assumptions, and I'm explicit about whether each field may or may not be None.

load more comments (9 replies)
[–] AnUnusualRelic@lemmy.world 2 points 5 days ago* (last edited 5 days ago)

From that little image, they're happy it takes a tenth of a fucking second to check if a list is empty?

What kind of dorito chip is that code even running on?

[–] Harvey656@lemmy.world 3 points 5 days ago (1 children)

I could have tripped, knocked over my keyboard, cried for 13 straight minutes on the floor, picked my keyboard back up, accidentally hit the enter key making a graph and it would have made more sense than this thing.

-2x faster. What does that even mean?

[–] AnUnusualRelic@lemmy.world 2 points 5 days ago

There's probably an "import * from relativity" in there somewhere.

load more comments