this post was submitted on 16 Sep 2024
433 points (97.4% liked)

Programmer Humor

19187 readers
1135 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] JATtho@lemmy.world 15 points 2 days ago* (last edited 3 hours ago) (2 children)

Python is just a pile of dicts/hashtables under the hood. Even the basic int type is actually a dict of method names:

x = 1
print(dir(x))
['__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', ... ]

PS: I will never get away from the fact that user-space memory addresses are also basically keys into the page table, so it is hashtables all the way down - you cannot escape them.

[–] rain_worl@lemmy.world 2 points 4 hours ago* (last edited 4 hours ago)

js is similar, though it does not include python's precalculated numbers
calculates integers from -5 to 256, see:

> a = 100
> b = 100
> c = 1000
> d = 1000
> a is b
True
> c is d
False
[–] Sylvartas@lemmy.world 4 points 1 day ago

audible C++ programmer disgust