3 ms·
> I think this is where we differ! I prefer to know what I can do with something without having to ask a compiler or IDE. This helps, for example, when looking
by joshuamorton 7y ago
> I think this is where we differ! I prefer to know what I can do with something without having to ask a compiler or IDE. This helps, for example, when looking at a pull request -- you don't have the code easily accessible for the compiler or IDE.
Same (I mostly use python, which puts your dynamic languages to shame), so structure your code such that this is possible.
Keep your functions relatively short. Then the declaration of a type, if its a local or an argument, will be close by (usually the same screen).
Globals should be defined at the top, so those are easy too. That leaves only class members that might require spelunking. Be judicious with those, they're often more pain than is worth it.
As for your statement about employeesById not being a map should be called out in review, that's true. But over time those things can change unless enforced. You're not just relying on the initial review, but all follow up changes not breaking the invariants.