Ask HN: Is there a fun way to learn Java?
I'm a CS student and my Java skills aren't nearly as solid as they should be. Even at a top University it was a class that wasn't very well taught.
Learning web languages (Ruby in particular) is very easy to get into due to the fun tutorials available. I'm tempted to learn Ruby and hope it also enhances my Java/general programming knowledge.
Before I learn yet another language, is there a fun way to learn Java better (OOP concepts in particular)? I saw the Play! framework and thought that might be quite fun to try out, but doubt it will enhance my actual Java knowledge.
14 comments
[ 0.28 ms ] story [ 40.9 ms ] threadLanguage-centric tutorials won't get you far in Java because there's not much to discover. Python or Scheme or Haskell elicit a "Wow!" every now and then. Java is all about libraries, tools and ecosystem. It's a language that very much disappears behind its immediate surroundings -- counteract that by extensively using the language.
So go and grab that Play!-thing, and build something reasonably awesome.
It's easy to pick up either once you learn either languages. C# is easier because visual studio is way easier to setup and configure. The language is often more susinct as well.
Welcome aboard, hope you are able to increase your sense of self-importance and foster a more exclusive body-politic.
Please flesh out your profile: http://c2.com/cgi/wiki?SmugCeeSharpWeenie
C# is the least annoying plumbing code I do, that's the only love I have for it. That and VS2010 is really nice to work in, and it's probably got the least painful jquery support out there right now (though I am VERY open to hearing about an IDE that is better/more excellent for pure jQuery use - sorry no vi, I prefer something with a mouse these days).
HN is chalked full of snobs on all sides; just because I dare to post a comment counter to the norm doesn't make me a snob (well not a c# snob that's for damn sure). It makes me crazy probably (knowing the inevitable results of sharing an alternative viewpoint - esp. one that gasp indirectly praises the Evil Empire).
Plus what's all that karma for if you can't have some fun with it?
http://www.jibble.org/pircbot.php
Java is simply not a "fun" language! If you're a student and looking for a job, knowing the language basics is enough, no one hiring out of school will expect you to be an expert. Much more important to know the OO principles it's supposedly based on.
A few things that made me enjoy Java more:
• Use an IDE Eclipse, IntelliJ IDEA or NetBeans. Vim can't handle things like automatic imports and serious refactorings like "extract method."
• Use packages liberally. Start your project inside `com.mistrq.myproject` and make a good, semantic hierarchy.
• Write applications with Guice. Program to interfaces and bind concrete classes at runtime. Dependency injection lets you easily turn a giant, hard-to-comprehend project into manageable chunks.
• Be liberal with interfaces. Sure, we had a lot of single implementations for interfaces, but using Guice made it trivial to swap out implementations for experimentation.
• Write tests. Use whatever's popular for unit tests right now, and check out EasyMock for amazingly-easy creation of mock objects.
(trust me, it's fun and you can steadily see your progress)
I didn't really feel I learnt better Java though, alot of the programming is quite Android-specific.
I'll already need to learn extended ML for my functional programming class this semester (previously done haskell). I use php at work when doing front-end web dev. I wouldn't mind increasing my javascript skills also. So I'm afraid of being jack of all trades, master of none.
I know Java better than I think I do. It's all the libraries and frameworks that I need to become familiar with.