The "Why" behind PMD's rules.
Posted
by James Kingsbery
on Stack Overflow
See other posts from Stack Overflow
or by James Kingsbery
Published on 2010-03-24T17:16:44Z
Indexed on
2010/03/24
17:23 UTC
Read the original article
Hit count: 403
Is there a good resource which describes the "why" behind PMD rule sets? PMD's site has the "what" - what each rule does - but it doesn't describe why PMD has that rule and why ignoring that rule can get you in trouble in the real world. In particular, I'm interested in knowing why PMD has the AvoidInstantiatingObjectsInLoops and OnlyOneReturn rules (the first seems necessary if you need to create a new object corresponding to each object in a collection, the second seems like it is a necessity in many cases that return a value based on some criteria).
Just to be clear, I know that I can disable these and how to do that, I'm just wondering why they are there in the first place. Sorry if there's something obvious I missed out there, but I did a Google search and SO search before posting this.
© Stack Overflow or respective owner