You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- 42+1: "No, long methods are not alway bad" but they're nearly always badBinary Worrier– Binary Worrier2012-10-15 11:41:38 +00:00Commented Oct 15, 2012 at 11:41
- 68Long method bodies are a classical code smell: it's not in itself a problem, but it's an indication that there's probably a problem there.Joachim Sauer– Joachim Sauer2012-10-15 11:46:13 +00:00Commented Oct 15, 2012 at 11:46
- 6+1, but I'd still recommend checking the cyclomatic complexity of the long method. High values indicate methods which are effectively impossible to unit test (and long methods are very rarely devoid of control flow logic).Daniel B– Daniel B2012-10-15 12:12:50 +00:00Commented Oct 15, 2012 at 12:12
- 11I use method names to minimize comments. Which sometimes leads to stuff like "getSelectedNodeWithChildren", but my colleague keep telling me, that my code is nicely readable. I also try to avoid abbreviations, they are nice to write, but not so nice to read.K..– K..2012-10-15 13:09:53 +00:00Commented Oct 15, 2012 at 13:09
- 4@da_b0uncer That is also a policy I follow. It is harder to read code than to write it, so extra effort when writing to make code more readable does pay back.deadalnix– deadalnix2012-10-15 13:12:17 +00:00Commented Oct 15, 2012 at 13:12
| Show 7 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you