# Learning Java Programming

**URL:** <https://boards.straightdope.com/t/learning-java-programming/533052>\
**Category:** Factual Questions\
**Created:** [March 19, 2010, 8:07pm UTC](https://boards.straightdope.com/t/learning-java-programming/533052 "2010-03-19T20:07:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanotd21](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@vanotd21](https://boards.straightdope.com/u/vanotd21)\
**Post date:** [March 19, 2010, 8:07pm UTC](https://boards.straightdope.com/t/learning-java-programming/533052/1 "2010-03-19T20:07:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![HorseloverFat](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@HorseloverFat](https://boards.straightdope.com/u/HorseloverFat)\
**Post date:** [March 19, 2010, 8:11pm UTC](https://boards.straightdope.com/t/learning-java-programming/533052/2 "2010-03-19T20:11:58Z")

</div>

How to Think like a Computer Scientist - Java edition:

[http://www.greenteapress.com/thinkapjava/](http://www.greenteapress.com/thinkapjava/)

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

---

<div class="post-metadata">

**Author:** ![code\_grey](https://avatars.discourse-cdn.com/v4/letter/c/f4b2a3/32.png) [@code\_grey](https://boards.straightdope.com/u/code_grey)\
**Post date:** [March 19, 2010, 8:40pm UTC](https://boards.straightdope.com/t/learning-java-programming/533052/3 "2010-03-19T20:40:46Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![Superfluous\_Parentheses](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Superfluous\_Parentheses](https://boards.straightdope.com/u/Superfluous_Parentheses)\
**Post date:** [March 19, 2010, 9:41pm UTC](https://boards.straightdope.com/t/learning-java-programming/533052/4 "2010-03-19T21:41:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gary\_Robson](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/gary_robson/32/3448_2.png) [@Gary\_Robson](https://boards.straightdope.com/u/Gary_Robson)\
**Post date:** [March 19, 2010, 9:43pm UTC](https://boards.straightdope.com/t/learning-java-programming/533052/5 "2010-03-19T21:43:22Z")

</div>

> [@code\_grey](#):
>
> if you are beginner programmer, my advice would be to start from C#, not Java.

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](http://boards.straightdope.com/sdmb/showpost.php?p=7697092&postcount=3) will often get you better answers to your questions.  
[/moderating]

---

<div class="post-metadata">

**Author:** ![Squink](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@Squink](https://boards.straightdope.com/u/Squink)\
**Post date:** [March 19, 2010, 9:55pm UTC](https://boards.straightdope.com/t/learning-java-programming/533052/6 "2010-03-19T21:55:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Khadaji](https://avatars.discourse-cdn.com/v4/letter/k/9e8a1a/32.png) [@Khadaji](https://boards.straightdope.com/u/Khadaji)\
**Post date:** [March 19, 2010, 10:03pm UTC](https://boards.straightdope.com/t/learning-java-programming/533052/7 "2010-03-19T22:03:36Z")

</div>

[Here](http://www.freetechbooks.com/)is a link to some free tech books online.

Bruce Eckel has some great books so you might try his [Thinking in Java](http://www.mindview.net/Books/TIJ/), 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.

---

<div class="post-metadata">

**Author:** ![Markxxx](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Markxxx](https://boards.straightdope.com/u/Markxxx)\
**Post date:** [March 19, 2010, 10:09pm UTC](https://boards.straightdope.com/t/learning-java-programming/533052/8 "2010-03-19T22:09:58Z")

</div>

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

For instance [Head First Java](http://oreilly.com/catalog/9780596009205/)

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.

---

<div class="post-metadata">

**Author:** ![vanotd21](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@vanotd21](https://boards.straightdope.com/u/vanotd21)\
**Post date:** [March 20, 2010, 12:54am UTC](https://boards.straightdope.com/t/learning-java-programming/533052/9 "2010-03-20T00:54:15Z")

</div>

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.

> [@Superfluous\_Parentheses](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![code\_grey](https://avatars.discourse-cdn.com/v4/letter/c/f4b2a3/32.png) [@code\_grey](https://boards.straightdope.com/u/code_grey)\
**Post date:** [March 20, 2010, 1:03am UTC](https://boards.straightdope.com/t/learning-java-programming/533052/10 "2010-03-20T01:03:49Z")

</div>

[quote=“Gary “Wombat” Robson, post:5, topic:533052”]

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

[/QUOTE]

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?

---

<div class="post-metadata">

**Author:** ![Bijou\_Drains](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bijou_drains/32/2814_2.png) [@Bijou\_Drains](https://boards.straightdope.com/u/Bijou_Drains)\
**Post date:** [March 20, 2010, 1:06am UTC](https://boards.straightdope.com/t/learning-java-programming/533052/11 "2010-03-20T01:06:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [March 20, 2010, 2:21am UTC](https://boards.straightdope.com/t/learning-java-programming/533052/12 "2010-03-20T02:21:24Z")

</div>

> [@Bijou\_Drains](#):
>
> 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. 😛

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [March 20, 2010, 2:25am UTC](https://boards.straightdope.com/t/learning-java-programming/533052/13 "2010-03-20T02:25:07Z")

</div>

I seem to recall my alma mater’s computer science curriculum using Java for [introductory](http://www.cs.cmu.edu/~mrmiller/15-121/) [classes](http://www.cs.cmu.edu/~211/info/)… uh-oh…

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [March 20, 2010, 2:36am UTC](https://boards.straightdope.com/t/learning-java-programming/533052/14 "2010-03-20T02:36:59Z")

</div>

> [@Indistinguishable](#):
>
> I seem to recall my alma mater’s computer science curriculum using Java for [introductory](http://www.cs.cmu.edu/~mrmiller/15-121/) [classes](http://www.cs.cmu.edu/~211/info/)… uh-oh…

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

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [March 20, 2010, 2:42am UTC](https://boards.straightdope.com/t/learning-java-programming/533052/15 "2010-03-20T02:42:38Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![Bijou\_Drains](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bijou_drains/32/2814_2.png) [@Bijou\_Drains](https://boards.straightdope.com/u/Bijou_Drains)\
**Post date:** [March 20, 2010, 3:03am UTC](https://boards.straightdope.com/t/learning-java-programming/533052/16 "2010-03-20T03:03:27Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [March 20, 2010, 3:10am UTC](https://boards.straightdope.com/t/learning-java-programming/533052/17 "2010-03-20T03:10:43Z")

</div>

> [@Bijou\_Drains](#):
>
> So what language should a person learn first these days? C++? I’m guessing Fortran and Cobol are out now. 🙂
> 
> 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.

---

<div class="post-metadata">

**Author:** ![sharding](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@sharding](https://boards.straightdope.com/u/sharding)\
**Post date:** [March 20, 2010, 4:17am UTC](https://boards.straightdope.com/t/learning-java-programming/533052/18 "2010-03-20T04:17:14Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Stealth\_Potato](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@Stealth\_Potato](https://boards.straightdope.com/u/Stealth_Potato)\
**Post date:** [March 20, 2010, 8:19am UTC](https://boards.straightdope.com/t/learning-java-programming/533052/19 "2010-03-20T08:19:34Z")

</div>

> [@Bijou\_Drains](#):
>
> So what language should a person learn first these days? C++?

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](http://en.wikipedia.org/wiki/Nasal_demons) 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](http://digitalmars.com/d/). 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.

---

<div class="post-metadata">

**Author:** ![Superfluous\_Parentheses](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Superfluous\_Parentheses](https://boards.straightdope.com/u/Superfluous_Parentheses)\
**Post date:** [March 20, 2010, 10:58am UTC](https://boards.straightdope.com/t/learning-java-programming/533052/20 "2010-03-20T10:58:23Z")

</div>

> [@vanotd21](#):
>
> 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.

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.

[Next page](https://boards.straightdope.com/t/learning-java-programming/533052.md?page=2)
