this post was submitted on 17 Aug 2024
705 points (95.1% liked)

Programmer Humor

32495 readers
283 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] C0MPL3X4@programming.dev 45 points 3 months ago (2 children)

It's about writing the code, not execution time. Otherwise Assembly wouldn't take 7 years...

[–] jjjalljs@ttrpg.network 7 points 3 months ago (1 children)

Some languages are just worse to work with. like JavaScript. Console.log is like sure I'll log your object but I'll tell you what it is now, not what it was when you logged it.

[–] skullgiver@popplesburger.hilciferous.nl 8 points 3 months ago* (last edited 2 months ago) (2 children)

[This comment has been deleted by an automated system]

[–] jjjalljs@ttrpg.network 3 points 3 months ago (1 children)

I've never had a complaint about logging stuff in python. It generally does what I expect.

"Create a copy of your object and print that" is what I ended up doing, but I don't think most people would say that's intuitive. I expect if i print something at a particular time, I get what it is at that point in time.

[–] Ephera@lemmy.ml 2 points 3 months ago

I'd just like to highlight what you mention below: Logging it as an object allows you to inspect it in the browser console, presumably with some JSON tree representation, rather than just a dumb string.

It's described in the "Outputting a single object" example here: https://developer.mozilla.org/en-US/docs/Web/API/console#examples

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

I can see it going both ways. Talking about execution times, this would be an exaggeration, but then, these memes always are.