Mid-level PHP programmer here. I plan on teaching myself Java. I\'m already fami
ID: 639652 • Letter: M
Question
Mid-level PHP programmer here.
I plan on teaching myself Java. I'm already familiar with the basic concepts like MVC, ORM's etc.. so I'm not a beginner programmer. As such, I'm looking for the best way to begin familarising myself with the nuances of a languange I am inexperienced with.
For starters, I have begun coding up a simple login/logout mechanism using JSP and have enjoyed making some decent progress.
So, my question to any and all Java gurus:
What aspects of Java should I delve into first? My plan is currently to continue with a simple app in JSP, then introduce Spring and Hibernate before moving onto concurrency and Swing.
If you had to re-learn java from scratch, what path through the different technologies and concepts is the best to take?
Explanation / Answer
My advice is to pick a small, manageable project in an area that you actually care about (so you have the maximum motivation!), and use this as a forcing device to learn the related set of skills. Some examples:
If you want to learn how to write desktop apps (e.g. with Swing) then maybe try implementing a simple game like MineSweeper. This will teach you all about Swing UI design and user interaction, plus you will need to solve practical problems like access graphics resources or saving high score tables to disk etc. If you want to get fancy you also have plenty of opportunities to explore concurrency here (animations, timers, etc.)
If you want to learn to write Web Apps, I'd strongly recommend writing your own minimal web application using the Servlet API (this is what JSPs actually use under the hood). This is a good learning experience and helps you really understand how Java web applications are actually working. Here's a quick servlet and JSP tutorial that may be helpful.Once you've learnt the basics then you can move on to one of the more advanced frameworks (maybe something like Vaadin?)
If you just want to learn the core language, maybe try something that forces you to write a variety of algorithms and data structures. Maybe implement your own custom tree data structure in a way that conforms to the Java collections API? Or maybe try some of the Project Euler challenges if you are more mathematically inclined?
One extra word of advice: you will never be able to learn all the Java libraries and APIs as there are so many, so don't bother even trying. Instead, learn the core principles of the language, common design patterns and the 3-4 libraries you really want to use regularly. Then you can always Google/use StackOverflow to solve other problems or explore new APIs on an as-needed basis.