Saturday, April 10, 2010

Four "harmful" Java idioms

http://www.javaworld.com/javaworld/jw-07-2008/jw-07-harmful-idioms.html



  • Use a naming convention to distinguish three kinds of data, not two: local variables, fields, and method arguments. (disagree)

  • Prefer the package-by-feature style over package-by-layer. (interesting idea, practical?)

  • Prefer immutable objects over JavaBeans.(agree)

  • Order items in a class in terms of decreasing scope, with private items appearing last. (interesting idea, potentially confusing)




  • Referenced

    • Code Complete by Steve McConnell
    • Martin Odersky, the principal creator of Scala
    • Josh Bloch