• Post Reply Bookmark Topic Watch Topic
  • New Topic

Recommend for a book on how to support Java code, please  RSS feed

 
okom ijin
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Majority of Java books fall in one of two categories: Introduction to Java (e.i. 1000 pages of text, starting from "Hello World", up to Swing components, Swing components and interaction with SQL) and special topics in Java (e.i. "everything you wanted to know about Threads"). These books help to write your own program, but are not very helpful when you want add functionality to existing code. I am looking for a book that would explain:

(1) How to efficiently use IDE: go to type, autocomplete,.. I know some useful features, but I am sure that I am missing some
(2) Debugging: breakpoints, stack, finding relevant variables... It is hard to tell, which variable stores what - took me some time to find out that one variable was static and wasn't visible until I expanded static variables list
(3) How to find relevant class: search button name in project... In one project button names were populated from SQL table - took long time to figure it out.
(4) How to figure out logic in the code... Consider "comments-free" spaghetti code with threads (to make  inside of a 3K-lines class, responsible for Swing elements.
(5) How to correctly implement new features and avoid dirty hacks... For example, creating a static variable to communicate the state of a child process makes it easy to add a feature, but it kills readability of the code and is not safe.

There are notes on these topics here and there, but is there a book specifically dedicated to this topic?

   


 
Tony Docherty
Bartender
Posts: 3271
82
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Points 1 & 2 (and arguably 3) are IDE issues and not Java issues and there are many IDE's so it's unlikely you will find a Java book that teaches you the IDE you want to use.
Points 4 & 5 come down to experience. It would be very hard to impossible to teach a novice how to unravel spaghetti code and it would be equally hard/impossible to teach someone to implement new features without going through most of the process of learning Java.

If you aren't an experienced Java programmer already I'm afraid you need to read one of the basic books and learn about Java. You can miss out the chapters on subjects that won't be of any use to you but you are going to have to learn all the basics whether you are writing whole programs or just adding features to existing programs. You are also going to have to pick an IDE and read the tutorials on how to use it.
 
okom ijin
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working as a Java developer for 6 months now. There are only three major IDEs (NetBeans, Eclipse, IntelliJ). While default shortcuts might be different the principles are the same.

"Points 4 & 5 come down to experience." - trial and error? It encourages quick and dirty fixes - a practice that I want to avoid.
 
Rob Spoor
Sheriff
Posts: 21131
87
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that Clean Code could be a good read for points 4 and 5. You may not get all your questions answered, but it's a good read nonetheless.
 
okom ijin
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great book. Started reading it. I will keep question open for a while. Just in case there are other good books.
 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okom ijin wrote:"Points 4 & 5 come down to experience." - trial and error? It encourages quick and dirty fixes - a practice that I want to avoid.

Using one's experience is absolutely NOT about using trial and error, it's about applying the knowledge one has gained through research and practice.
 
Rob Spoor
Sheriff
Posts: 21131
87
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okom ijin wrote:I will keep question open for a while. Just in case there are other good books.

For me, another must-read for Java developers is Josh Bloch's Effective Java. I've reread it this year, and I found only one sentence that was out-of-date; the rest was still very relevant.

FYI, the sentence was about interfaces not having method implementations, which is possible since Java 8.
 
Dave Tolls
Ranch Foreman
Posts: 3056
37
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To go with Clean Code I would offer up Fowler's Refactoring.
As a contractor I end up doing a lot of work on other people's code, or at least in the vicinity of other people's code, and refactoring plays a huge part of that work.
Sounds like you'll be doing the same sort of thing.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another interesting book is this one: Working Effectively with Legacy Code

One way to get to know an existing code base is by writing unit tests for it. You'll learn how parts of the system work, and at the same time you're making something useful - the unit tests.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!