this post was submitted on 12 Apr 2025
198 points (90.6% liked)

Technology

72828 readers
3106 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
you are viewing a single comment's thread
view the rest of the comments
[–] jerkface@lemmy.ca 15 points 3 months ago (22 children)

Strongly disagree that not x implies to programmers that x is a bool.

[–] iAvicenna@lemmy.world 6 points 3 months ago (15 children)

well it does not imply directly per se since you can "not" many things but I feel like my first assumption would be it is used in a bool context

[–] thebestaquaman@lemmy.world 8 points 3 months ago (10 children)

I would say it depends heavily on the language. In Python, it's very common that different objects have some kind of Boolean interpretation, so assuming that an object is a bool because it is used in a Boolean context is a bit silly.

[–] Glitchvid@lemmy.world 2 points 3 months ago

if not x then … end is very common in Lua for similar purposes, very rarely do you see hard nil comparisons or calls to typeof (last time I did was for a serializer).

load more comments (9 replies)
load more comments (13 replies)
load more comments (19 replies)