Saturday, December 22, 2012

A Java Library (of books) for beginners, and a little path to self instruction for geophysicists

It is quite a few years that I insist for students moving to program in Java. Java is not anymore Java 1, it has evolved towards a mature language and now it is at its version 7 (Java 8, now and Java 9 soon). Times ago I talked about doing matrix algebra in Java. Most of that post is still valid.

However, many would realize that for learning Java the right way s/he has to start from the beginning, and possibly, start to learn also the concepts of object oriented programming (the real reason to use Java).

My personal training began with the videos (in Italian) of one of my Trento university colleague Marco Ronchetti. For others, MIT Courseware could be a good starting, but also these less academical clips can help.

Programming is more than just knowing a language. This concept is well covered in

Introduction to programming using Java by David J.Eck

and nothing can substitute the reading of a good book. More specialised classics on Java are also:

Thinking in Java 4th edition

Thinking in Java annotated solutions book

the two by Bruce Eckel

The design pattern Java companion, by J. W. Cooper

These books sum up to a lot of pages to read and working them out is not a thing you do in a day.
People who teach Java, usually rely on command line. However, I would prefer to learn how to use an IDE. Our choice is, since many years, Eclipse. Learning to use it is easy but is made easier by reading Lars Vogel tutorials and material.

Going to more specialised book, for scientists, I also recommend

Mak, R. (2010). Prentice Hall - Java Number Cruncher. The Java Programmer's Guide to Numerical Computing (pp. 1–493).

Besset, D.H., Object-Oriented Implementation of Numerical Methods: An Introduction with Java & Smalltalk , 2000. (~70 Mb) (His code can be found here).

Nikishkov, G. (2010). Programming Finite Elements in Java (pp. 1–394). The preface of his book can give a good rational for using Java instead of other languages.

A general collection of Algorithms in Java is Algorithms by Kevin Wayne and Robert Sedgewick (also addressed here).

You can also give a look to old C Numerical Recipes (for algorithms) and use this free Java project for their application. (Do not support NR license policies).

Having got a clear idea of what Java is, you probably wants to write clean code. The right book is Clean Code by Robert Martin.

Now, you are probably ready to understand the subtleties of the Java Matrix Libraries I indicated in my older post.

If one wants to move to geosciences and GIS, the best choice is to give a look to the GEOtools site and to al the documentation s/he can find there. At that point s/he will be probably also ready for programming the Jgrasstools.  Programming OMS3 components would be easier, indeed, if you do not care of geographic features.  For GIS and working with us, one should consider the introduction by Andrea Antonello.

Eventually you can probably go back and make reacher your library (of books) by also reading and applying

Martin Fowler's UML Distilled: A Brief Guide to the Standard Object Modeling Language

Erich Gamma, Richard Helm, Ralph Johnson and John VlissidesDesign Patterns: Elements of Reusable Object-Oriented Software (but the easiest book, from the opinion of many is Head First Design Patterns by Eric Freeman and Elisabeth Robson.

and  the book that many consider the best one:

Effective Java Second Edition, by Joshua Bloch  by many considered the best book about Java.
Here there is also a video about.

For mastering Java generics and collections, I suggest:

Java Generics and collections by Maurcie Naftalin & Philip Wadler, by O'Reilly.

Obviously Java is one of the most used languages, and there is a lot of material on the web. Starting from the Oracles itself main site.

However, programming is about writing code, not just reading about it. Wishing I would have time to do it! 


  1. This comment has been removed by a blog administrator.

  2. Great Overview !!
    I would add Clean Code and Refactoring by Fowler to the List.

  3. I have searched for jgrasstool documentation... I could not find ... I need to develop an web application that you informs a point on map, on a river for example ... and the app calculate the watershed area poligon.

    1. Dear Pedro, what do you need exactly. Just use the JgrassTools or modify them for use inside another software ?

      Please let me know.