πŸ’¬ Reply by Ephera

2024-11-16 πŸ”„ programmerhumor ┃ RE: kazaika

I always hated the implementation for .toString() of Duration. It gives you a string like that: PT8H6M12.345S (not a hash)
Apparently, it’s an ISO 8601 thing, but what the hell am I supposed to do with that?
It’s not useful for outputting to end users (which is fair enough), but I don’t even want to write that into a log message.
I got so used to this just being garbage that I would automatically call .toMillis() and write β€œms” after it.
Well, and not to gush about Rust too much, but I recently learned that its debug string representation is actually really good. As in, it’s better than my Java workaround, because it’ll even do things like printing 1000ms as 1s.
And that’s just like, oh right, libraries can actually provide a better implementation than what I’ll slap down offhandedly.

Ephera

kazaika

πŸ”„ programmerhumor

πŸ’¬ Replies

2024-11-24 bleistift2 ┃ 1πŸ’¬

I don’t even want to write that into a log message.
[…]

────

View parent post

View first post in thread

────

πŸ“‘ Local feed

πŸ•οΈ Communities

πŸ”₯ Hashtags

πŸ”Ž Search posts

πŸ”‘ Sign in

πŸ“Š Status

πŸ›Ÿ Help