this post was submitted on 25 Aug 2025
23 points (100.0% liked)
Programming
24153 readers
333 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Following the article, the former describes the type (a map from employees to roles) while the latter describes the relationship (these are the employees' roles).
At the same time, I'm not pedantic enough to care in practice. Both are fine, and I'll get the point when I read either of those.
I agree with the author here that names don't need to be so verbose, but I also think there needs to be a balance.
outorreqorresare clear with context, butoutput,request, andresponseare always clear and not bad to write.http_responseadds extra unnecessary info (unless there's another response variable in scope).It also helps when languages support local variable shadowing. For example:
Both of these are responses, and fundamentally the same thing being passed around while being mutated. The types are (potentially) different. You won't use the first variable ever again (and in Rust, likely can't). Just reuse the name.