2 ms·
Small note here: it's obviously not it's an "absolute" rule that X lines of codes = fired. But for me, it's just a major code smell when people are writing very
by saberience 8y ago
Small note here: it's obviously not it's an "absolute" rule that X lines of codes = fired. But for me, it's just a major code smell when people are writing very large single files with generalized names like "server.rs" or "processor.java."
It tends to mean that someone isn't following the single responsibility principle and the code is harder to understand and less maintainable. Obviously these aren't hard and fast rules but are combined with many other code smells and metrics.
For example, I really really dislike long methods with generic names. Usually this means there are too many things happening in a single method. The method name, it's input and output parameters should give the reader a fairly exact idea of what's happening in the method.
So if I wrote a method with this signature:
public List<bool> ProcessData(List<string> input)
If you tried to predict what this might contain in the body, you would have zero idea.
Now this method:
public List<bool> ValidateVipCodes(List<string> input)
Just seeing this signature, you could easily imagine what the body would look like without much thought at all.
Great code should be structured in such a way that someone can view the project, ONLY LOOKING at file names and method names and have a good idea about what is going on and how it might work.