• Post Reply Bookmark Topic Watch Topic
  • New Topic

Finishing Head First Java: Where Do I Go Now?  RSS feed

 
Mike Matthews
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Fellow Ranchers,

I hope I'm not breaking any rule by posting what I'm about to post here. (My schedule's been so tight lately that I just barged in here like a wild moose in mating season without learning the Ranch's dos and don'ts.)

I'm just finishing Head First! Java book and I've been wondering: Where do I go next? The book covers stuff relating to Java 5.0, and the devs have already gone so far past that point. That's one thing. Another thing is that, although I already can make SOME apps, I'd like to make their GUI pleasant to the eye. Also, I simply don't feel like a programmist yet. There's far more to learn — both to improve the code that I can create now, and to create stuff I never considered possible.

In the long run I'd like to learn to make programs that are:
1) safe (crucial code accessed only remotely and with great control over what can be accessed)
2) efficient (but of course!)
3) intuitive (not only easy to use, but also clean and attractive)
4) accessible from different platforms (this includes smartphones with different OS's)

I guess that's what we all aim for, but... the difference is that you know how to do that while I don't. I have the basics and I want to build upon them. Help?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37462
537
Eclipse IDE Java VI Editor
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike,
Don't worry, your post is fine. It even has humor about a Moose .

I can think of a few directions to go in:
1) Pick up on book on new Features in Java 7. There were a good number of syntax improvements and it would be good to learn them soon so you develop good habits. (Richard Reese's book is excellent.)
2) Read a book like "Effective Java" to learn good practices
3) Read about OO and Design Patterns. (The Head First book on this is good)
4) Learn about web apps - Servlets/JSPs.
 
Mike Matthews
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so very much! You were of great help. (And I'm also relieved that no rules were broken when I started this thread.)
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike Matthews wrote:In the long run I'd like to learn to make programs that are:
1) safe (crucial code accessed only remotely and with great control over what can be accessed)
2) efficient (but of course!)...

One specific thing I can think of that will help with both of those - although I warn you, not everyone will agree with me:

Get into the habit of using the final keyword - probably the most powerful (and least taught) keyword in the Java language. Specifically:

1. Make your classes final unless you KNOW you're going to extend them.

2. Make methods final unless you KNOW you're going to override them. I even make my private methods final (theoretically redundant, but perfectly legal), just in case I decide to change the access qualifier later on. Maybe overkill, but it makes me happy.

3. Make fields final unless you KNOW you're going to change them.

The reason? - It protects your design - and in the last case, your data - and you can always remove it later on if you need to; but you can't add it.

Joshua Bloch freely admits that his BigInteger and BigDecimal classes should have been final; but it's now too late to do anything about it without breaking existing code.

My 2¢.

Winston
 
Aki Mohan
Ranch Hand
Posts: 99
Eclipse IDE Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also started with Head First Java. I'll tell you what I did, it worked well for me (not sure if it would work for everyone) and maybe it's your call.

After finishing Head First Java I started preparing for OCAJ 7 certification. I read the book written by Bates and Sierra for certification. It's a very good book and I would totally recommend it.
It goes in depth and it's very well written.

Currently I'm writing more java programs to teach myself and reading for Java 7 II certification.

Let me know what you're upto, if interested we can venture on a java project.

Thanks,
Aakash
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We get lots of posts like this. I would suggest what I haven't before: learn the more recent features of Java. There are lots of things like Streams and λs which are not in HFJ because they didn't exist when it was printed.
 
Mike Matthews
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston:
I think using final might be a very good practice. After all, it guarantees that whatever you've done won't be overwritten (in case you plan to team up with someone.) It's just like using any other keywords/modifiers - they all have their purpose. However, it might be difficult for beginners such as myself because it requires that the coder has good planning skills. Thank you very much for your 2c. I will definitely keep some room in my memory for your advice.

Aakash:
I'm always up for cooperation. I'll say more: I'd love to. Feel free to leave me a PM.

As for my plans, I do have a few projects of my own on my mind so they will keep me buffed for a while. For this reason I decided to get myself a book that would introduce new stuff to me. It's like learning a foreign language (say, Spanish): you need to learn some words, then you can work on your grammar. I was just looking for Reese's book on Java 7's new features when I bumped into another book - Java: The Complete Reference. I haven't read any reviews, but the author has good reputation. I have a feeling it's gonna be a heavy read (1.3k pages), but it has it all. It might be nice to broaden my horizons. Later I'm gonna get myself Effective Java.
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike Matthews wrote: . . . it requires that the coder has good planning skills. . . .
No, you can mark everything in sight final and when it won't compile take the final modifier off
Some IDEs (e.g. Eclipse) will show you error messages and give remove final modifier as an option for correcting the error.

I'll delete the excess post you said was an error.
 
Mike Matthews
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:No, you can mark everything in sight final and when it won't compile take the final modifier off
Some IDEs (e.g. Eclipse) will show you error messages and give remove final modifier as an option for correcting the error.

Oh... Now, that's useful. Thanks to you, too. As for IDE's, I'll avoid them for a little longer as an exercise.
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would prefer Effective Java™ to some of the other books mentioned in this discussion.
 
Mike Matthews
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But doesn't Effective Java focus on clean code rather than introducing new subjects? I feel that Head First. Java is just the tip of the iceberg. There's much beyond it. I want to gather all those small clusters of knowledge, and then learn how to effectively put them together.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike Matthews wrote:But doesn't Effective Java focus on clean code rather than introducing new subjects?...

Actually, that may be no bad thing. I'd say it's probably worth honing your skills on the basic stuff at this stage before you move on to new topics; otherwise you're in danger of the "new stuff" crowding out the old.

Personally, EJ is the best book I've ever read about ANY language (and Java is my 6th). It's basically a "why to" book, and it taught me an incredible amount about how Java (and its base classes) works.

HIH

Winston
 
Mike Matthews
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds to me like I should get myself two books instead of one, like I originally planned. But then, I noticed Effective Java isn't half as expensive as Complete Reference so it won't hurt my pocket at all. It's that book by Joshua Bloch, right? And it seems to be at 2nd edition now.
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get Effective Java™.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike Matthews wrote:Sounds to me like I should get myself two books instead of one, like I originally planned. But then, I noticed Effective Java isn't half as expensive as Complete Reference so it won't hurt my pocket at all. It's that book by Joshua Bloch, right? And it seems to be at 2nd edition now.

And given all the goodies that came out with version 8, I wouldn't be at all surprised if a v3 isn't in the works.

That's said, it's not a book about the "latest and greatest"; it's about best practise.

Winston
 
Mike Matthews
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I got myself Effective Java and The Complete Reference. I started with EJ, and I must say: it won't be an easy read. It starts with static factory methods which construction I don't quite understand. Example:


I remember that some of this stuff was mentioned in Head First Java, like the wildcard <?>, but I know little of it. The whole 2nd line of the code above is a little mysterious. Another thing is that some solutions are unclear to me because Joshua Bloch says that I can use A instead of B, while I didn't even know about the B, let alone the A which is supposed to be original to more experienced programmers (thus in my eyes it's obviously like black magic); in other words, the whole realm he introduces is a big unkown, like JDBC mentioned in relation to said static factory methods. So, my question is:

Should I carry on with reading EJ or should I turn to TCR instead? Another solution I can think of, which would be a nice compromise, is to continue with EJ while referring to TCR whenever I have doubts. What do you think?
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to familiarise yourself with the ?: operator. It means if the left operand is true, return the middle operand otherwise return the right operand. It just happens to work nicely with Boolean because there are two possible values.

You will probably find the Java® Tutorials easier to understand.
 
Mike Matthews
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:You need to familiarise yourself with the ?: operator. It means if the left operand is true, return the middle operand otherwise return the right operand. It just happens to work nicely with Boolean because there are two possible values.

You will probably find the Java® Tutorials easier to understand.


Thank you for your help. I know what to do now. Both books will prove useful in the nearest future, as well as the tutorials you recommended.
 
Stevens Miller
Bartender
Posts: 1445
30
C++ Java Netbeans IDE Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:
3) Read about OO and Design Patterns. (The Head First book on this is good)


Jeanne's suggestion, that you read "Head First Design Patterns" is good enough, imho, that I'm going to push it more explicitly: if you don't already know the basics of design patterns, read this book. In fact, even if you do know them, you probably ought to read this book to see them implemented in Java (interestingly, the book isn't a "Java book," per se. But, it does show every one of the patterns it treats as a Java implementation).

I was a programmer for decades before hearing about design patterns. After I did, what I found about them online was often so stratospheric (UML diagrams I couldn't read, examples solely in functional programming contexts, and so on) that I couldn't understand them, or else it was so abbreviated (UML diagrams that I could read, one-page cheat-sheets, and so on) that every one of them looked pretty much like some kind of wrapper, to me (so, hey, what's the big?). The Head First book, on the other hand, was comprehensible and showed me why design patterns can be beautiful things.

Since I've been programming for 40 years, taught myself in the first place, and like to think I've mastered some fairly complex stuff, the whole class of "don't worry, we'll take this step-by-step" books, with silly pictures and lots of whitespace on the pages, don't feel like they offer much to me. But, in all humility, the Head First books are different. While I could do without the stock photos of the (often surprisingly grumpy looking) models and their thought-balloons, the actual text, examples, and exercises have been immensely valuable to me. Head First Design Patterns is definitely one I'd recommend for you, if you don't already feel you know that topic thoroughly.
 
Mike Matthews
Ranch Hand
Posts: 49
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might be a good choice. There are three books that seem to stand out among other options for the 2nd step: Effective Java, The Complete Reference and Head First Design Patterns. I tried reading EJ, but it has only shown how much there is still for me to learn. Now I'm reading TCR, not just referring to it in times of need. It's hard to build if you have few resources at hand. I decided to learn more, perhaps referring to EJ in the process so that I don't develop bad habits. I'm going to buy HF:DP later… then again I could just as well get it now and use it instead of bedtime story.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!