3 ms·
I agree. I prefer this List<Host> hosts = hostService.fetchMatchingHosts(hostFilter); Set<JVMVersions> versions = JVMServiceFactory.factory(region).getApprov
by JamesBarney 11y ago
I agree. I prefer this
List<Host> hosts = hostService.fetchMatchingHosts(hostFilter);
Set<JVMVersions> versions = JVMServiceFactory.factory(region).getApprovedVersions(),
List<AvailabilityZone> zones = RegionFactory(region).getZones();
return hostUpdater.updateJVM(hosts, versions, zones);
to this
List<Host> hs = hostService.fetchMatchingHosts(hostFilter);
Set<JVMVersions> js = JVMServiceFactory.factory(region).getApprovedVersions(),
List<AvailabilityZone> zs = RegionFactory(region).getZones();
return hostUpdater.updateJVM(hs, js, zs);
The top version means I can read the return line by itself and get a feel for what it does without having to skip back up a few lines. And while there definitely is a tax on longer variable names, I usually don't feel that way with single words.
The brain chunks small common words, so hs probably takes just as much if not more working memory than hosts.
Footnote : Just while writing this I had to look up a couple of times to remember hs, js, and zs. But I never hard to look up to to remember hosts, versions, and zones.