15 Apr 2023
A couple things happened recently in my #python learning journey, that made me fully realise how important coming up with the most explicit variable names is.
By that I mean for example naming a variable
email_ids_in_mailingee =
instead of ids =
, or even email_ids =
or worse, x =
-
I read Clean Code Clean Code which articulated why it's better to use explicit variable names for readability. Better than obscure ones, or only understandable by the original programmer. It beats inline comments too, as updating code without updating comments is a common source of bugs.
-
I had to dive back into an old code base of mine from a couple years ago and experienced the pain and time waste of trying to figure out again what logic I had implemented then 😅
-
when using Github Copilot Github Copilot writing comments helps it generate better code suggestions for you. While not as good, writing explicit variable names is as close as it gets.