3 ms·
I'm going to take issue with the given trivial example. So you've got this: int robert_age = 32; int annalouise_age = 25; int bob_age =
by ufmace 12y ago
I'm going to take issue with the given trivial example. So you've got this:
int robert_age = 32;
int annalouise_age = 25;
int bob_age = 250;
int dorothy_age = 56;
And it's supposed to be easier to tell that bob_age is out of place because all of the numbers are in a column. Technically, that's so, but I don't think this is a good way to set things up in any modern programming language.
If you're defining as separate variables four different things, all of the same type but all typed as individual variables of a basic type, then you already have a problem, long before you decide how to align them. If they're that similar that you can easily notice that kind of inconsistency, then those numbers ought to be in some kind of data structure - an array, or they should all be objects or something holding the name and the age. Exactly how to set that up varies by the language and the problem domain, but I can't think of any language where there isn't a better way to do it than that
Meanwhile, things that actually should be separate integer definitions like that don't have any direct connection to each other, and so you can't trivially tell that something is wrong by looking at a column of numbers.