• 8 Posts
  • 55 Comments
Joined 7 months ago
cake
Cake day: June 2nd, 2024

help-circle





  • bleistift2@sopuli.xyztoProgrammer Humor@lemmy.mlI love Rust
    link
    fedilink
    English
    arrow-up
    1
    ·
    28 days ago

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

    Why not? It’s a perfectly human readable representation of that duration, just as intended by ISO.

    what the hell am I supposed to do with that?

    Just as an example, we use that format to communicate durations between the frontend and backend.







  • Completely depends on how often you need to write boilerplate code, and how error-prone it is.

    After writing hundreds of instances of ‘fetch this from the server and show an error if it doesn’t work’, I finally wrote a helper for that. It took 2 hours, shouts at me if I use it wrong, and instantly makes my classes easier to read because all the boilerplate is gone. As an added bonus, the invocation is so small that Copilot can write it error-free, which it couldn’t before.

    So fetching things is now a thing of a few seconds instead of one minute with a chance of making a mistake. I say it’s worth it.






  • Programs aren’t written by a single team of developers that speak the same language. You’d be calling a library by a Hungarian with additions from an Indian in a framework developed by Germans based on original work by Mexicans.

    If no-one were forcing all of them to use English by only allowing English keywords, they’d name their variables and functions in their local language and cause mayhem to readability.

    I can’t find the source right now, but I strongly believe that Steve McConnell has a section like this in one of his books where he quotes a function commented in French and asks, “Can you tell the pitfall the author is warning you about? It’s something about a NullPointerException”. McConnell then advises against local languages even in comments