The world expects programmers to make clean code, but we've not really advanced our tools much outside of Java and C#. I'm always envious of what the refactoring tools can do in those languages.
The world expects programmers to make clean code, but we've not really advanced our tools much outside of Java and C#. I'm always envious of what the refactoring tools can do in those languages.
Also - you may be superior to others and able to understand a 50 line function. But what about your colleagues?
The average cognitive limits of are well known. I doubt we will evolve to beyond these flaws in my lifetime.
After many years maintaining my and other people's code, I do tend toward shorter methods. On the other hand, splitting up a method into several methods just to keep under a hard line limit causes more problems than it solves.
I must disagree on the switch statement. A main loop with an rather large switch statement is a perfectly normal way to write a trivial interpreter. C provides a nice way of doing it, and as long as you declare your constants properly it's all perfectly readable. A lot of excellent code bases are structured that way. (Awk comes to mind, IIRC, and it's very easy to read and extend.)
They are global, like hidden assumptions about the stuff you interface with. Requirements regarding order of invocations of some methods of seemingly unrelated classes. Code that shouldn't really be needed, but stuff breaks when you remove it. Esoteric automaticaly generated code driven by xmls or .xlsx, that nobody really understand, but copy-paste when you need another special-case.
http://ruby.sadi.st/Flog.html http://ruby.sadi.st/Flay.html http://brakemanscanner.org/
What makes codeclimate useful is the polish/ease of use on top of these tools. It also makes it easier for me to get projects to adopt new tools - if they're in CC already, and CC start doing bundler-audit reports...we get them for all projects.