this post was submitted on 29 Apr 2024
121 points (96.2% liked)
Programming
17318 readers
46 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 [email protected]
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I was expecting something more profound. Isn't this just the concept of using variables to keep code readable? Not a new concept and likely one most devs learn early on.
I've had at least one code reviewer ask me to put all the logic in the
if ...
line rather than use a variable or two in order to "simplify code by reducing the number of variables."At the very least, this article helped me confirm my own bias of "that guy is a moron" and I can send this article to him the next time he reviews my code.
I guess this is go, and I don't know what the scoping is. In C++ I also suggest putting as much in the if as possible, because it limits the scope of the variables.