4 ms·
While I was writing that, I realised that it may come down to the definition of what constitutes a long method / variable / class name. I have usually found th
by scanr 14y ago
While I was writing that, I realised that it may come down to the definition of what constitutes a long method / variable / class name.
I have usually found that the IntelliJ defaults are enough to make the names meaningful. For Ruby, the inspection kicks in at 30 characters. Interestingly, it's referenced from the ruby style guide here: https://github.com/bbatsov/ruby-style-guide https://github.com/bbatsov/ruby-style-guide where I can't find a recommended maximum length.
We're somewhat sidetracked from the main discussion. I'm generally in favour of trying to write code that is as readable as possible. Ideally in such a way that it is understandable even without the comments.
That said, I do think that good comments are helpful and essential if you're building a library. The Spring Framework comes to mind as a project that has a great set of documentation built from the comments (but also has very readable code, along with long method, variable and class names).
- nirvdrum 14y agoI can get on board with common sense decision making :-)