24 ms·
Another one is giving insanely long names but only changing one little part, instead of taking advantage of the heirarchical nature of programming languages and
by jboles 8y ago
Another one is giving insanely long names but only changing one little part, instead of taking advantage of the heirarchical nature of programming languages and coming up with a nice nested structure. Example:
class TheRpcThing
{
object TheRpcThingHost
object TheRpcThingHostTimer
class TheRpcThingValidationException
{
object TheRpcThingHostValidationException
object TheRpcThingHostValidationExceptionErrorMessage
object TheRpcThingHostValidationExceptionErrorMessageFormatter
}
}
The cognitive cost of reading a bunch of previously-unseen code, which has an accumulation (the perfect word for this kind of thing) of the above can be so frustrating.
- avinium 8y agoI actually use the number of capital letters in camel-cased variable/method names as a signal that the code might need refactoring. Generally, every capital letter indicates another hierarchical relationship from left-to-right. Usually these are implementation details that shouldn't be publicly exposed, or at least could be separated out/encapsulated better in a different object/function structure. Obviously it's a rule-of-thumb and there are exceptions, but I've found this works pretty well.