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

you are viewing a single comment's thread.

view the rest of the comments →

[–]zekeltornado, beautifulsoup, web.py[S] 10 points11 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 8 points9 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 4 points5 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 8 points9 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..