@SomeClass

public void method() {

...

}

I had a friend visit me today. He's a Java programmer, but he also knows enough Python, Ruby, JavaScript and Scheme to be dangerous. I asked him to show me around his code so I could see some modern Java. I learned Java back in the 1.0 days, but I stopped paying attention back around 1.4. Here are some of the things I saw.Generics are as I expected.Annotations are interesting. There was code like:"SomeClass" acts like a "tag" for "method". Elsewhere in the code, you can define wrapper methods (i.e. decorators) for all the methods that have been wrapped by "@SomeClass". Clearly, this was the inspiration for Python's function decorators. I had simply never seen them in Java before.Dependency injection is interesting, as I expected it to be. In general, you accept parameters for everything you need, and you don't worry a lot about how things get instantiated. You avoid using the "new" keyword, and instead let the dependency injection framework instantiate things for you. This takes care of circular dependencies. There was a Java file that configured what gets bound to what. Hence, if I ask for SomeFoo, it'll give me an instance of the right SomeFooImpl. Basically, it's a whole layer to add more dynamism.IntelliJ was impressive. I asked him to write a module from scratch so I could see his workflow. He right clicked and hit "add new class". IntelliJ created a file and asked if he wanted to add it to Subversion. Then he simply started typing in the implementation for the class. Whenever he typed something like FileWriter, it automatically added the right import line. Whenever he used a class attribute that didn't exist yet, it showed up in red until he told the IDE to create the attribute. Then, he had to click on the attribute to add a getter and setter.I knew that Java IDEs held your hand a lot. I didn't know that the work flow was to simply start using something and then have the IDE generate the boilerplate for you. That was interesting. I liked how nicely he was able to navigate the code base. Best of all, IntelliJ has really nice Vim keybindings, which he was using.He showed me Struts 2 and his usage of JSP. Those weren't all that remarkable or new to me.I returned the favor by showing him some of the code from my current project. He said, "Wow, your Python code is really beautiful," which I took as quite a compliment. He also said that there was clearly a lot less boilerplate and that more functionality was achieved in fewer lines.Clearly, a lot of useful code is written in Java. glassfish HiveDB , and IntelliJ are just a few things that come to mind. I'm not going to give up Python anytime soon, but it was nice to get a peek into another world.