4 ms·
But if the structure is unused and my program only deals with a single integer does it make sense to modify the structure of the program for readability? No. I
by nendroid 6y ago
But if the structure is unused and my program only deals with a single integer does it make sense to modify the structure of the program for readability?
No. If my program only modifies the left bottom side of the box it doesn't need the whole box defined. In this case and many cases similar to this, it's totally fine encoding more verbosity into the naming of the integer.
The "smell" your sensing here is only called a smell because you can't logically explain it. Your brain is firing off a false alarm.
I can easily make a variable name that can trigger the false alarm but you won't be able to come up with a reasonable nested structure to contain it.
theColorOfTheSkyOnAThursdayAt6PM = "ReddishOrange"
What are you gonna do here? I have a string that represents a color of the sky at a certain day on a certain time. What structure can reasonably contain this concept and ONLY this concept. Unless you want to define a structure called Sky the long name is the only possibility.
- alfonsodev 6y agoIs all context, if you have such specific need probably the app context is already understood and there is no need to have such big names, perhaps the apps is called, 'colors of Thursday 6pm' the you just hold a variable for sky. Same for box side, if your app only deals with a side, then is boxSide, you wouldn't say upperBottleTap, because all bottles have the tap on the upper side, and there is only one, so context is everything.