• Post Reply Bookmark Topic Watch Topic
  • New Topic

Functional Programming in Java: How easy?

 
Raghavendra Desoju
Ranch Hand
Posts: 109
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pierre-Yves Saumont,

Welcome to Ranch !!

How useful is this book in guiding in an approach for Beginners and Intermediate level programmers to think in a functional way?

I see many programmers who do not have past experience in Functional Programming have trouble in understanding/adopting approach.

Thanks,
Raghu
 
Pierre-Yves Saumont
Author
Ranch Hand
Posts: 96
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raghu,

This book is intended to intermediate Java programmers. There is no need to have a prior functional programming experience. The goal of the book is to make the reader think functionally. From my experience of teaching the functional paradigm to imperative programmers, the process is close to (although much easier than) learning a foreign language. At first, when given a problem to solve, the students first think about an imperative implementation, then they translate it into a functional program. After some time (this is highly variable), they start thinking functionally, reverting to imperative style when it becomes harder. Then, those episodes are more an more rare, until they completely disappear. This is generally good news, although they might suffer a bit if later they are asked to write an imperative program. Then they sometimes write a functional implementation and translate it to imperative style!

The key to making the most of this book is solving the exercises. The book contains many exercises. I have not counted them, but certainly more that one hundred, and the book is not finished. (I am currently writing chapter 13). Let me emphasize this: if you are able to understand everything in the book just by reading it, you probably don't need it. And if you are not and you do not want to do the exercises, you will probably waste your time.

Solutions to all exercises are given in the book (with a description) and in the accompanying code, available on github. All exercises in one chapter are independent. This does not mean they do not reuse the results of previous exercises, but that all the code is duplicated from an exercise to the next. The code contains all modules in two forms: exercises and solutions. In the exercises, you generally just have to write the implementation of some methods or functions (signatures are generally given). Both exercises and solutions come with JUnit tests that serve two purposes: first, they allow testing if you solution is working. Second, they show how the methods you implement may be called.

So if you buy the book, do the exercises! And to answer you question more specifically, some exercises are easy, some are not. Some hints may be given in the book, but you probably should start trying to solve the exercises without reading the hints.

Pierre-Yves
 
Raghavendra Desoju
Ranch Hand
Posts: 109
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pierre-Yves,
Thanks a lot for taking time to provide such a good explanation. This definitely sets the right expectations to the readers of the book. Of course, including me
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!