3 ms·
I like readable code, he didn't mention readability. The only thing I really care about in code is that it is readable and doesn't stretch all in one line and n
by drawkbox 13y ago
I like readable code, he didn't mention readability. The only thing I really care about in code is that it is readable and doesn't stretch all in one line and not broken up. Small chunks are better than a ninja one liner.
Constructor arguments/params are fine as long as the code is readable and line breaks to keep it within a decent column size. I also think that constructor arguments can sometimes get into overload messes just as method calls can. A good api breaks up any overly parameterized constructor or methods.
I just want code to be readable, fit within a decent column area and make sense. Whether it is in constructor params or method params there shouldn't be too much done in one line for complexity sake.
If programmers don't get constructor params then they probably don't get method params either. I think people just want stepped-readable code in most cases. Named and optional params help to clear up long initialization or method calls but in the end it is about balance and readability.
Smaller, iterative code bits are easier to put a breakpoint on as well say for instance one param was null and it broke on constructor, it might take some more inspection to find unless it was a specific set.