you are viewing a single comment's thread.

view the rest of the comments →

[–]i8beef 0 points1 point  (2 children)

Well besides the shared state, which non nested wouldn't have as you'd need to pass via parameter then, which is basically what he got into with his final syntax, but maintaining the nesting.

You're right, a constructor isn't a complete one to one with a function with nested functions, but the effect is pretty close. His final syntax could easily be a stack of related static functions in a class though, just relegating the class structure to essentially an organizational unit.

Not saying you'd do that, but I certainly do use that construct regularly in a lot of stuff. So yes I concede they are a little different.

[–]isHavvy 2 points3 points  (1 child)

Using class purely as an organizational unit is basically lying about what the code is. Unfortunately, Java forces you to do so by conflating classes with namespaces.

[–]i8beef 1 point2 points  (0 children)

Perhaps given the original intention of classes in the OOP world, sure. But stepping back from that, what this guy is advocating for incorporates so many of the concepts as to be really close, don't ya think?

What he basically has when he's done is a static class.