The goal of this blog-post is not to shape an idea that one language is better than the other. It is more about what kind of things I have so far encountered and discovered on my path.
Let’s start from the basics – syntax. AS3 looks syntactically almost like Java. It also has OO structure, organization for packages, classes, methods and fields. A small comparison is highlighted in the picture below – declaring variables and methods.
Those two languages are so alike that it takes only few days to get to know what the main differences are. They even share similar features like having a garbage collector. A little bit more time is required to get rid of the brain muscle memory and the mental desire of automatically writing a „var“ when declaring a variable. Also getting to familiar with Java API takes weeks, depending on what exact features are required (I/O, JDBC etc.).
Still, there are some small quirks I missed for a while from the AS3 times as I was used to these and expected those to work in Java as well:
Is it good that I don’t have these features anymore? Probably yes. Now I have to create a stricter design and less likely shoot my leg with the code being too loose and dynamic. Yes, at first it was a little bit frustrating to find out that I cannot declare a method in Java to be overridden by child classes but being hidden to others. Creating a sub-package for one file seems an overkill. This all taught me that not everything has to be strongly concealed – it is your package, your files. You control it, so just don’t call those methods 🙂
On the other hand, Java is not poor of having features I like:
When grasping the Java language was really easy, then getting to know Java EE world is completely a different story. It is not like opening a small door/window and peeking inside like you would do first when trying out a new thing. There are too many technologies and frameworks tangled together – servlets, AOP, Spring, Hibernate, OSGi and the list goes on and on. If you don’t know anything about those then absorbing all these seems quite impossible. I recommend starting from servlets. After that at least the Spring MVC makes better sense.
What else has changed? Even though I can continue on using Eclipse or IntelliJ (what a relief), the debugging of live projects has come more painful. Before I just had to switch one small swf file with Fiddler and saw the impact. Now I have to build and deploy bigger file packets and this takes much more time. The major time saver has been developing against unit tests.
Java EE has already expanded my mind and I have taken only few steps on this very long path. So, I already have great expectations what things and approaches are there waiting for me. I strongly suggest you to take some time and look into other languages and their frameworks. It doesn’t matter what language to choose. They all teach you a different perspective on solving problems. And the result is good – more creativity. I bet you will find at least one interesting thought, for example from Scala. BTW, every next language will be easier to master.