Learning Java Programming

can anybody recommend good sites or books for learning java programming? (not javascript please.)
the internet is pretty cluttered with numerous sites. I haven’t found any particular book either other than java for dummies. so any input would be appreciated.

How to Think like a Computer Scientist - Java edition:

http://www.greenteapress.com/thinkapjava/

This will introduce you to many concepts in programming using Java examples. Its a free ebook.

if you are beginner programmer, my advice would be to start from C#, not Java. It is very similar (essentially the same language) but you will that it’s much easier to develop a small, simple desktop GUI in C# WinForms than in any of the popular Java GUI toolkits. And a GUI is a very helpful thing for doing things like convenient logging as well as for keeping yourself motivated. Remember, the nicer your apps will look, the greater will be your drive to keep on coding instead of hanging out on SDMB and similar :slight_smile:

How much programming experience do you have? Languages/concepts etc. This is really relevant when recommending books.

Why did you pick Java? Not that there’s all that much wrong with it, but IMHO it’s not the best language to start with if you have little experience, and if you have plenty, it may also not the best, depending on what you’re trying to achieve.

Although C# is a proprietary language created for a single platform, but Java isn’t.

[moderating]
I changed the title of the thread from “programming” to “Learning Java Programming.” Using descriptive thread titles will often get you better answers to your questions.
[/moderating]

Have you looked at iTunes U yet?
The University of Utah’s free Java workshop looks like it might supply a good start.

Hereis a link to some free tech books online.

Bruce Eckel has some great books so you might try his Thinking in Java, although I read his Thinking in C++, so I can’t vouch for the Java book.

Some insight to your programming level and background might help us recommend better.

If you are really just starting out, I recommend O’Reilly books

For instance Head First Java

They are easy to follow and written very clearly. Of course they aren’t for advanced or even intermediate users by any means, but they give you a sound foundation. Once you have read through the book and completed the exercises you will be in firm grasp of Java and able to go on to more complex aspects of Java

You can probably find them in a good sized library.

I had no prior experience before starting java. From what I gather, colleges with computer science classes typically start with java as a starting language which is what happened to me. I don’t doubt that it’s not the best language to start off with since I don’t know that much about programming.

so? Like I said, they are so similar as to be essentially the same language. But one is easier to learn than the other for reasons I mentioned, and so it makes sense to cut the teeth on the easier one and then quickly master the harder one. Do you happen to have a religious dislike of touching proprietary languages or something?

There are plenty of Java jobs so that is one good reason to learn it.

It’s a much better idea to learn to be a programmer first. Any computer science curriculum that uses Java for introductory classes isn’t worth the toilet paper it’s printed on.

Bare iron or bust, baby. :stuck_out_tongue:

I seem to recall my alma mater’s computer science curriculum using Java for introductory classes… uh-oh…

Mine did, too. Fortunately I escaped before my brain was damaged too badly.

Ah. Yes, I only exposed myself to one course of it myself. Though that may still have been enough to cause some permanent damage… For example, I now have this problem where it’s hard to judge tone online sometimes. :slight_smile:

So what language should a person learn first these days? C++? I’m guessing Fortran and Cobol are out now. :slight_smile:

BTW, I’m not asking for myself, I have been a programmer for 25 years. I’m just curious.

If I had my way, there would be no programming at all in CS 101. But if someone was interested in just learning programming (as opposed to computer science) I would recommend learning a small, lower-level language like some form of assembler or C. (Not C++. C++ is the devil. And it’s fecking ginormous.)

The reason I don’t like Java as a first language is because it’s ridiculous to try to learn OOP principles at the same time as you’re trying to understand loops, functions and conditionals. And it’s especially ridiculous to try to understand programming if you aren’t made to learn pointers and haven’t manually assembled basic data structures.

I was a hobbyist programmer as a kid before entering my CS program, and was already familiar with OOP. I was constantly annoyed by the fact that instead of teaching computer science, the first six weeks of the semester were spent explaining OOP to the beginners in the class, before anybody ever got around to such concepts as loops and floating point.

I learned BASIC (on an Apple //e) in elementary school and C in high school (kinda – I had a class on C, but the teacher didn’t know C and I didn’t learn to do things right until later). In college, my classes were mostly C++ with a bit of Java (the CS curriculum changed to Java half way through my time there). I also learned C (for real this time), Perl, Javascript, Bourne shell and some PHP on my own during college. Since college, I’ve learned Java and PHP in a lot more depth, Python, Korn shell scripting, Objective-C and small parts of several other languages (plus maybe some stuff I’ve forgotten).

I don’t know if that’s really the ideal order, but it worked well for me and I think is a nice progression in complexity. It seems like too many people are focused on a quick fix, trying to immediately learn something that’s marketable. Marketable is important, but I don’t know that going for the most marketable language is necessarily the right approach if your goal is to be a really strong, career software engineer. It’s important to understand how things actually work, not just how to glue APIs together. If being a highly skilled career software engineer is not your goal, my advice doesn’t necessarily apply (e.g. I don’t think there’s anything at all wrong with jumping right to PHP or Ruby if all you want to do is make some websites for fun).

FWIW, I’m currently a software engineer at Google (ob disclaimer: nothing I post here is ever meant to speak for my employer in any way, shape or form). My colleagues are all very good software engineers. If you asked 100 of them what their learning path was, you’d get 100 different answers. There’s no single best way to go, and don’t listen to anyone who says there is…

I am going to concur with friedo in saying that C++ is the devil. If you’re an expert with it, it’s an extremely useful language, if only because it is so widely used. But it’s filled with cruft, complexity, kludges, questionable design choices, and all manner of dangerous idiosyncrasies that make it difficult enough to navigate for experienced programmers. Beginners have no hope at all. Sadly enough, there are introductory programming classes using C++; generally they are taught by people who don’t understand the language at all, and what is taught is not C++ but a flimsy mix of all the most dangerous habits of C combined with all the most confusing features of C++.

The sheer number of rules and special cases you have to learn by heart just to write a program that a standard-compliant C++ compiler cannot interpret as a request for demons to fly out of your nose is remarkable. It may not be the worst language to try teaching a beginner, but it’s a contender.

…Needless to say, C++ was my first programming language. :o

ETA: I’ve recently fallen in love with the D programming language. It’s the successor to C that C++ only wishes it could be. Garbage collection, a sane module model, native support for strings and arrays, delegates, closures, typesafe variadics, and a template system that blows everything else out of the water. It’s just a pity it hasn’t taken over the world yet.

My main objection to Java as a first language is that to write what would be considered good Java code requires a lot of knowledge about modeling in Java’s OO system and particularly “design patterns”. All of which is just a big burden when you’re only starting to get acquainted with basic programming techniques. Also, the compiler is slow meaning you’re either waiting for the error feedback to come back to you or you need some interactive system that adds even more complexity. IMO, it’s very clear that Java was written with C/C++ programmers in mind and not at all intended as a first language.

I’m not too sure what a good first language is these days, but I think Python is well regarded as a teaching language as well as a “real” production language; it’s relatively quick, allows for mixing of OO and non-OO and functional techniques, doesn’t look too alien and it’s much, much more straightforward for basic programming than Java. You might want to consider using it for a few days and see if you like what it does. It’s free in any case.