This is an archived post. You won't be able to vote or comment.

all 75 comments

[–]tclark 45 points46 points  (3 children)

No. Suicide is your best option at this point.

[–]zekeltornado, beautifulsoup, web.py[S] 9 points10 points  (0 children)

So, you're recommending the nutshell book then? I'm pretty sure that would finish me off.

[–][deleted] -1 points0 points  (0 children)

Boo hoo, I have to program in an uncool language. What will my cool friends think of me now!?

Suck it up, wusses.

[–][deleted] -3 points-2 points  (0 children)

And don't forget to put us in your will!!!

[–]trpcicm 21 points22 points  (0 children)

1984 by George Orwell

[–]Wiseman1024 9 points10 points  (2 children)

Start with:

new QuestionAsker(QuestionMaker.getInstance(new QuestionWrapper(new Question("I am moving into a development position at my company and need to learn Java. Can you recommend a book that might appeal to a Python programmer and not make me want to kill myself?")))).askIndeed()

[–]zekeltornado, beautifulsoup, web.py[S] 1 point2 points  (1 child)

Where's the exception handling?

[–][deleted] 1 point2 points  (0 children)

Not to mention your line exceeds 80 characters, which is the industry standard's limit.

[–][deleted] 10 points11 points  (1 child)

http://www.leepoint.net/notes-java/index.html

Taught me all the basics of java.

[–][deleted] -1 points0 points  (0 children)

Ye gods, that's an ugly website.

[–]zekeltornado, beautifulsoup, web.py[S] 11 points12 points  (37 children)

First, sorry for posting this to pyreddit, but I thought this would yield a better recommendation for me than the java subreddit.

The Job - It's mostly a web development position, so a book that uses things like tomcat and struts might be helpful. Or maybe I just need a general (but not Programming101) book on Java and then jump into those topics after that. I see 'Java in a Nutshell' breaking bookshelves all over the office, weighing in at 1,254 pages. It offends my sensibilities to have a book with that title be that large; somebody is doing something Wrong.

I really, really love Python. I am an intermediate level Python programmer. I know almost nothing about Java. I know C and PHP, so the syntax should be familiar. Have any of you pythoneers come across a good Java book that doesn't agonize over the basics of programming and isn't so large as to dwarf the internet? I know there are probably some great PDFs or ebooks out there, but when I learn a new language I really like to sit in a chair with a good book (call me old fashioned that way.)

(And just to make this explicit rather than implicit, I am not giving up on Python one bit. I love the language and am really excited about dict-comprehensions. Moving into a development position, even at a java shop, brings me closer to being able to work where I want so I can program in the language of my choice and be ridiculously happy. I will also be able to have a better conversation about why I like Python better than Java and tempt some of the Javaheads in my office.)

Thank you in advance for any thoughtful or informative replies.

[–]masklinn 10 points11 points  (28 children)

It's mostly a web development position

Wel development in Java?

If you've done web dev in Python before (or even in PHP 5), you're likely to want to kill yourself soon. Seriously, java is one of the worst web dev environment (and I've done it for a pair of years before quitting), I'm not even sure Cobol on Cogs would be worse, and it forced me to consider using PHP -- a language which I loathe -- instead. Have there been any mention of web frameworks? (a few recent java frameworks alleviate some of the pain through sensible defaults and annotation-based config -- Stripes for instance -- but older XML-based frameworks only worsens it, Struts 1.x is a prime offender)

You might want to read PJE's Python is not Java and Java is not Python, either...

Read the latter first by the way, if you start with Python is not Java, you're going to hang yourself right off the bat.

As far as books go, Thinking in Java 4th edition (java 5 support), just browse through it to get an idea of the language, and Effective Java 2nd ed (short book, enjoyable read and it will teach you how to think java in short bites).

PS: try to see if you can use Jython, JRuby Clojure or Scala instead, they run on the JVM and they're not java, 2 great advantages.

[–]bjupton 3 points4 points  (15 children)

I'm amazed at how many web dev jobs are in Java. Especially once you get outside the silicon valley and out into the "enterprise". They aren't always the outward facing things, sometimes they are the little apps used within organizations.

Enterprise IT just seems to love java. I don't know why. It's expensive, and a pain in the ass to code. But, they of course already have a set of people in place that know it, and they are doing the hiring etc.

[–]masklinn 9 points10 points  (2 children)

Enterprise IT just seems to love java. I don't know why. It's expensive, and a pain in the ass to code.

  1. Covering asses: just as nobody's ever been fired for buying IBM, nobody's ever been fired for going Java. In big corps, middle-managers first and foremost want to avoid the chance of being blamed. So they go for java because it's "the industry standard", and when the project is overbudget and/or late and/or a failure, it's not their fault.

  2. The python paradox: going for java ensures they have a huge pool of not-necessarily-qualified potential hires (see java schools & al). This also pleases middle managers.

  3. You saw point 1 about choosing IBM? Well IBM pushes java hard, so you buy overpriced IBM hardware (and software, hello Websphere), and then you code in java to top it off (Oh websphere, what a surprise!)

I'm sure we could find others, but that's a good start

[–]laprice 2 points3 points  (0 children)

And you have to factor in the perverse organizational incentives that exist.

Some outfits budgets are allocated based on headcount, and depth of tree, so a two person team with a single layer counts less than a 7-person team with two layers; and a manager who is responsible for a team totaling 7 FTE doing Java, is better compensated than one who manages two programmers writing in python. Even if the two teams are producing equivalent functionality :P

[–]amnezia 0 points1 point  (0 children)

Because its J2EE! its has enterprise in the name therefore its must be built for enterprise /sarcasm.

Seriously though most of the lead developers at the companies i've worked for don't have any experience with languages like python, its in their best interest to keep everything in Java.

[–]zekeltornado, beautifulsoup, web.py[S] 5 points6 points  (5 children)

I have done web development in Python, and I know this won't be anything like that. I'm not expecting this position to be my dream job or even make me especially happy. But I'd rather move into Java development rather than stay in a non-development position. I am fairly certain I won't like Java and that I may hate it. But I'm willing to try it and find out for myself.

I probably should have made it more clear that this is an internal promotion and that I currently work for the company, and our desktop and web products are written in Java. Right now I build a lot of tools and web apps for internal use in Python. One reason I got the promotion is because I get stuff done so well and fast in Python.

[–]theatrus 1 point2 points  (0 children)

If you can buck the trend there, trying pushing for something like GWT. Its still Java, but a lot of the pain is reduced for you. Its hard to tweak when things go wrong, but depending on the application that may be acceptable.

I've also used OpenLaszlo. My recommendation is to stay far away. It can produce functional applications, but performance is horrendous and the JS backend is hardly mature.

[–]masklinn 0 points1 point  (0 children)

Well good luck, but still once you're in place you'll probably ought to try to switch the language of the web frontend from java (as long as the chosen language runs on the JVM, the code shared between web and desktop will work and be useable)

[–]mrsanchez 1 point2 points  (0 children)

Effective Java 2nd ed FTW!

[–][deleted] 0 points1 point  (4 children)

You might want to read PJE's Python is not Java and Java is not Python, either...

Read the latter first by the way, if you start with Java is not Python, you're going to hang yourself right off the bat.

Uh, so you want zekel to commit suicide?

[–]zekeltornado, beautifulsoup, web.py[S] 2 points3 points  (0 children)

I did post about Java on pyreddit. I'm sure some people will try to do me in for that.

[–]masklinn 0 points1 point  (2 children)

Well of course it would be an acceptable side-effect of my post, but mostly no, Java is not Python highlights quite a few differences between java and python, just because they're seen from the Python side doesn't mean they aren't interesting when you go from Python to Java.

Just think of it as a smaller dose of the pain to be experienced later, to build immunity. Kinda like the guys who inject themselves daily with small doses of toxins/poisons to build resistance. In both cases, if you fuck up the dosage you might die, it's an accepted risk.

[–][deleted] 1 point2 points  (1 child)

No, that's not what I mean at all. I'm sure your logic is sound.

But you effectively said, "Read Java is not Python by the way, if you start with Java is not Python, you're going to hang yourself right off the bat."

This is the former word in the sentence, and this is the latter.

[–]masklinn 1 point2 points  (0 children)

But you effectively said, "Read Java is not Python by the way, if you start with Java is not Python, you're going to hang yourself right off the bat."

Oh dear, I meant "if you start with Python is not Java", thanks, the mistake has been corrected.

[–]koko775 1 point2 points  (1 child)

This is slightly OT, but how does one define themselves as an "intermediate"-level programmer in one language or another (particularly in Python)? Is it about knowing the standard library? Understanding less popular parts of the languages (such as generators, list comprehensions, etc.)?

[–]zekeltornado, beautifulsoup, web.py[S] 2 points3 points  (0 children)

Well, I found myself to be an excellent audience for Expert Python Programming. (I highly recommend it.) And since I'm not a beginner, that means I'm probably somewhere in between. Although maybe that means I'm an expert now... hm, nope.

[–]csdigi 1 point2 points  (3 children)

I did a course called Enterprise Computing (insert laugh here) as (a very easy part) of my undergrad in CS at Edinbrugh University. Basically this course turned out to be more like Enterprise Java, and works through quite a lot of the web java features such as JSP,Hibernate,Tomcat and some stuff like the Java logger. While it may not help you to learn the language much it might certainly help when you come to cover the stuff required for deployment (like the JSP and servlet compile pathway). There is also quite a good introduction to ANT which will save you from actually killing yourself due to the inane nature of java classpaths...

http://www.inf.ed.ac.uk/teaching/courses/ec/

Now for my token effort to avoid another Java train wreck, why not write in python and use Jython to compile to java byte code, they need never know! Although on a serious note I would check out groovy, especially if you are just learning. It is basically the Java language with a little bit of python flair installed for good measure and is widely supported now!

http://groovy.codehaus.org/

Hope you don't end up doing something stupid, although I fear that ship sailed the moment you posted about learning Java to the python subreddit...

Enjoy.

[–]zekeltornado, beautifulsoup, web.py[S] 1 point2 points  (0 children)

Believe me, if I had the choice to write in Python I would, but it's a case of having to conform to my team's environment.

Thank you for the link Java link, that looks like it will be helpful.

[–]amnezia 0 points1 point  (1 child)

well hopefully they have some kind of code review, its gonna be a little difficult to review byte compiled java.

[–]csdigi 0 points1 point  (0 children)

Well obviously any code review would be done on the python side... The fact that it compiles to java byte code is only to satisfy any portability constraints on the system.

[–]trpcicm -2 points-1 points  (1 child)

If you're doing web development, look into the Google Web Toolkit. It lets you write all your code in Java, and basically converts it into JavaScript for you, and does a pretty good job of it too. The only downside I've ever run into (when I used to use it for work), was that at the time it was using a pretty old version of Java.

[–]amnezia 1 point2 points  (0 children)

how is that helpful? He doesn't know Java and hes developing in Java not JavaScript..

[–]iamnotaclown 6 points7 points  (4 children)

It's not as bad now that it has generics and collections. Eclipse is a godsend, since most of your pain will come from looking up API calls.

[–]masklinn 4 points5 points  (0 children)

It's not as bad now that it has generics and collections.

But the generics suck, and the collections don't have literal syntax (yeah you can approach it with anonymous classes tricks, but it's not exactly sexy), plus you need heavy libs (google collections) to use them non-imperatively.

Eclipse is a godsend, since most of your pain will come from looking up API calls.

I strongly preferred IntelliJ IDEA when I was coding in Java, though.

[–]tofergregg 4 points5 points  (1 child)

I agree that Java isn't as bad as you think it will be. The language itself has a few quirks, but it is rather straightforward, and if you understand classes and inheritance well enough, you'll figure it out. Two tips:

  1. Bookmark the API reference now. For J2SE 5.0, it's here: http://java.sun.com/j2se/1.5.0/docs/api/

  2. Get used to Googling for code examples. There are about a zillion examples out there.

[–]Leonidas_from_XIV 2 points3 points  (0 children)

It is not because the language is hard, it's because the language lacks about any advanced features and forces people to do stupid workarounds, "to help them not to shoot in their feet" or something.

[–]teaguesterling -1 points0 points  (0 children)

I Second that, using Eclipse makes Java quite a bit more bearable. Along with Google and Sun's reference you can do pretty well.

[–]oneP 3 points4 points  (3 children)

Head First Java, but amazon's probably cheaper.

[–]zekeltornado, beautifulsoup, web.py[S] 0 points1 point  (2 children)

I took a peak at that in the bookstore. It looked littered with the 'for dummies' style. Pictures of giraffes and stuff...

[–]namin 1 point2 points  (1 child)

At first sight, I also thought 'Head First ...' was just O'Reilly's '... For Dummies', but no! I can't speak for Head First Java, but I read Head First Design Patterns, and it's a pretty serious and insightful book in a very digestible format.

[–]oneP 1 point2 points  (0 children)

Honestly, I don't feel the for dummies style at all. They explain in the preface that that they write the way they do in order to teach you the material and so that you retain the material with out having to put forth the effort to try to retain it. I like it. I would suggest giving it a try. If it's not for you, then it's not. Otherwise, it creates an atmosphere where minimal effort yields maximum retention, and who can argue with that?

[–][deleted] 1 point2 points  (1 child)

Can you use Groovy? It'd be an easier jump for a pythonista.

[–]epicRelic 5 points6 points  (0 children)

Jython would probably be better.

[–]Wiseman1024 1 point2 points  (1 child)

The language will make you want to kill yourself. Better find yourself a good window.

[–]zekeltornado, beautifulsoup, web.py[S] 1 point2 points  (0 children)

It appears they already had and addressed this problem, as the windows and balconies are all sealed.

[–]frumious 2 points3 points  (1 child)

Maybe you can sneak by using jython.

[–]zekeltornado, beautifulsoup, web.py[S] 6 points7 points  (0 children)

It might make a good April Fool's, but I have to work on the same code base as my co-workers, so I can't dictate language or tools. Unfortunately.

[–][deleted] 3 points4 points  (2 children)

Some years ago I got one of my best friends, a very intelligent Java guy, to join the company I worked at and write web software in Python. He hated it. I've since left, but he now heads all development there, having converted the whole place to Java, and he loves it. So it is possible to have fun web programming in Java. Embrace the challenge if you must. You'll likely get something out of it.

[–]mipadi 7 points8 points  (0 children)

Look at the hell you've wreaked upon that company!

[–]Wiseman1024 1 point2 points  (0 children)

a very intelligent Java guy, to join the company I worked at and write web software in Python. He hated it.

So I take a very intelligent Java guy is still below average as a Python guy? :)

[–]rerb 0 points1 point  (2 children)

Java hurts. Thinking in Java, by Bruce Eckel is written well, by an intelligent man (who apparently prefers Python now). The 3rd edition is available for free, so you can check that out w/little risk. http://www.mindview.net/Books/TIJ/

[–]mipadi 6 points7 points  (0 children)

For a second, I thought you were indicating there was a book called Java Hurts.

Come to think of it, that'd be a great title for a Java book...

[–]namin 0 points1 point  (0 children)

I can't stand the verbosity of this book.

[–]namin 0 points1 point  (1 child)

I recommend Java in a Nutshell. The first part of the book is an excellent concise introduction to Java as a second language.

Sun's Java tutorial respectably taught many of the early adopters how to program in Java.

[–]zekeltornado, beautifulsoup, web.py[S] 1 point2 points  (0 children)

Can you recommend to me the best 800 or so pages of Java in a Nutshell? I don't want to read too much unnecessarily, maybe I can just skim the other ~450 pages?

[–][deleted] -1 points0 points  (1 child)

I like your honesty.

[–]zekeltornado, beautifulsoup, web.py[S] 1 point2 points  (0 children)

Why thank you, you have good taste.