Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

If you're interested, a more detailed analysis of Puzzle 90 is provided in this answer at Stack Overflowthis answer at Stack Overflow.

If you're interested, a more detailed analysis of Puzzle 90 is provided in this answer at Stack Overflow.

If you're interested, a more detailed analysis of Puzzle 90 is provided in this answer at Stack Overflow.

replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

Overall, my (quite painful) encounters with debugging inner classes directly accessing fields of enclosing instance made strong impression that this practice resembles use of global state, along with known evilsknown evils associated with it.

For the sake of completeness, there may be casesmay be cases where above reasoning doesn't apply. For example, per my reading of map.keySet javadocs, this feature suggests tight coupling and as a result, invalidates arguments against non-static classes:

Overall, my (quite painful) encounters with debugging inner classes directly accessing fields of enclosing instance made strong impression that this practice resembles use of global state, along with known evils associated with it.

For the sake of completeness, there may be cases where above reasoning doesn't apply. For example, per my reading of map.keySet javadocs, this feature suggests tight coupling and as a result, invalidates arguments against non-static classes:

Overall, my (quite painful) encounters with debugging inner classes directly accessing fields of enclosing instance made strong impression that this practice resembles use of global state, along with known evils associated with it.

For the sake of completeness, there may be cases where above reasoning doesn't apply. For example, per my reading of map.keySet javadocs, this feature suggests tight coupling and as a result, invalidates arguments against non-static classes:

clarification copied into post from comments
Source Link
gnat
  • 20.5k
  • 29
  • 117
  • 309

For the sake of completeness, there may be cases where above reasoning doesn't apply. For example, per my reading of map.keySet javadocs, this feature suggests tight coupling and as a result, invalidates arguments against non-static classes:

Returns a Set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa...

Not that above would somehow make involved code easier to maintain, test and debug mind you, but it at least could allow one to argue that complication matches / is justified by intended functionality.


For the sake of completeness, there may be cases where above reasoning doesn't apply. For example, per my reading of map.keySet javadocs, this feature suggests tight coupling and as a result, invalidates arguments against non-static classes:

Returns a Set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa...

Not that above would somehow make involved code easier to maintain, test and debug mind you, but it at least could allow one to argue that complication matches / is justified by intended functionality.

Source Link
gnat
  • 20.5k
  • 29
  • 117
  • 309
Loading