From lambda expressions and JavaFX 8 to new support for network programming and mobile development, Java 8 brings a wealth of changes. This cookbook helps you get up to speed right away with hundreds of hands-on recipes across a broad range of Java topics. You'll learn useful techniques for everything from debugging and data structures to GUI development and functional programming.
Each recipe includes self-contained code solutions that you can freely use, along with a discussion of how and why they work. If you are familiar with Java basics, this cookbook will bolster your knowledge of the language in general and Java 8's main APIs in particular.
Recipes include:
Methods for compiling, running, and debugging Manipulating, comparing, and rearranging text Regular expressions for string- and pattern-matching Handling numbers, dates, and times Structuring data with collections, arrays, and other types Object-oriented and functional programming techniques Directory and filesystem operations Working with graphics, audio, and video GUI development, including JavaFX and handlers Network programming on both client and server Database access, using JPA, Hibernate, and JDBC Processing JSON and XML for data storage Multithreading and concurrency
Ian Darwin's Java Cookbook is out and it's a great resource for developers working in Java that are out there and scratching their heads asking "How would I go about...?"
The thing that makes Java Cookbook stand out is its comprehensive scope. Darwin has done an excellent job of gathering a wide array of common problems faced by Java developers and presenting solutions to those problems that are decipherable using just the language's standard library features. (Which isn't to say "ignore libraries" -- just that there are few (any?) recipes in this cookbook that require external dependencies.) By and large, the recipes are practical and are organized into sensible categories. This isn't a book that I'd recommend you read front-to-back, but if you're programming in Java, it's worth having it handy to help kickstart your thought process on a number of different problems. (Plus, 3rd edition has been updated to include solutions that highlight Java 8 features.)
In addition to the above, it's worth noting that while Java Cookbook isn't a great book to learn from, that if you have stumbled your way into Java with an otherwise solid software engineering background, that you could use it as a leg-up or crutch while you're otherwise getting up to speed.
At first, you cannot believe your luck. Examples hundreds of examples and they look functional. They get down to the nitty-gritty of creating, renaming, and deleting files. The book is up to date on strings and threads for scalability.
We can go on and on to create a book about this book.
However, there is no mention of signals. There is a quickie on pipes that is misleading as it ignores pipe timing of fast machines that will give misleading information; for example, all pipes start at the same time (parallel), not one at a time in a series. No information about creating or handling named pipes. Do not see any information on handling semaphores. There is a quick survey on how to handle different operating systems. What could have been a book in itself covers only a hand full of pages? You could not possibly keep up with the history of operating systems if you did not know the story ahead of time.
However, there is plenty of examples to help get off the ground for many projects. Also, some great ideas that you can use that you may not have thought of.
It is of pretty poor quality, especially for O'Reilly. Out of 10 random code snippets that I decided to copy-paste and try out in my IDE, about 8 did not even compile! I don't care that there's a GitHub repo that might contain fixed code! If you publish a book with code - at least have the decency to make sure your code compiles.
Many code examples belong to the 90s or 00s at best. A major overhaul is needed. Some praise comprehensiveness, but I don't understand why the author decided to add a whole chapter on the "R" language, just because "data science is hip right now".
Two better alternatives: Java 9 Recipes, Java Coding Problems by Packt.
The book is pretty big, but for a first iteration over this book it can be just looked through, I suppose, just indexing the book into your mind would be enough, for further use of the solutions suggested
What you want from a programming language cookbook is instruction on the basic tasks that are needed to form the scaffolding that you build around your application. Language teaching and references can teach you syntax and good practices. Topical books can demonstrate how to tasks in the large. But the cookbook is for the small but necessary tasks. And for me, who does not spend much time in the JavaVM ecosystem, the Java Cookbook is a very welcome addition to my bookshelf.
I spend most of my time doing scientific programming in Python and R, but I am starting to return to the JVM because of the need to deploy what I develop. But while other languages like Jython, Groovy, Scala, and Clojure exist on the JVM, to use them well means you need grounding in Java, certainly most of the instructional material assumes more than passing understanding of the JVM and the Java standard library.
I've been building a prototype application using Java as my means of re-learning Java. Where this cookbook has helped me already is in understanding better how to configure projects, more effective use of the Java data structures and I/O, and some utilities. While I know what I need to do through my experiences in other languages, and Java tutorials and references can identify the libraries and functions that I need, the Java Cookbook provides well written examples that I can use to guide me through the JVM.
There are some warts. This book (like most JVM books) seems to be written with the understanding that the readers are web programmers and I think that the discussion of the options available are filtered with that in mind. But this is a very good reference for those times when you know what you need to do, and it is not the type of thing that gets put into a tutorial.
Disclaimer: I received a free electronic copy of this book through the OReilly Blogger program