3 ms·
These are all great tips but still won't help me figuring out how should I name my variable. Sometimes it's obvious but sometimes I struggle. I hope it isn't an
by rplnt 15y ago
These are all great tips but still won't help me figuring out how should I name my variable. Sometimes it's obvious but sometimes I struggle. I hope it isn't an indicator of bad code :)
- riffraff 15y agoobligatory: There are only two hard things in Computer Science: cache invalidation and naming things. -- Phil Karlton
- DrJokepu 15y agoIn my experience if you're struggling with naming something (variable, function, class, etc.) in your code, it often indicates that you're not entirely sure about the role of that particular structure. When this happens to me, I ask myself: what is the role of this variable? What does this method do? If you can't figure that out sometimes that's indicating that it's time for refactoring.
- MortenK 15y agoGet the book "Code complete", it has a large section dedicated to this problem.