The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

oltyant (2) [Avatar] Offline
Hi All,

I'm glad to join this group and that I have the possibility to read the MEAP edition of the Reactive Design Patterns. I'm sure it will be a really good book at the end.

I don't want to say that I have scrutinized the first two chapters but I flip through them and I have an observation. I'm aware that the path is really long before the final edition and I also know that the highlighted code examples in the book might be change within a year but if not here is an ambigious part (Chapter 1 on page 3):
"This book assumes that you are fluent in Java or Scala,
where the latter is used to present code examples throughout the book while Java
translations are available for download."

In spite of the above quoted statement most of the code in the first chapters are written in Java 8. I'm not against Java especially as I'm a Java developer but to be honest I'd rather see the examples in the book in Scala. Mostly because of the Reactive coursera course and due to the fact that I have been learning Scala for more than a year and begun to really like it. In my opinion the programming in Scala means more fun(ctions)! smilie

Anyway forget about my opinion and bad pun. Let's go back to the mentioned quote: I only wanted to ask what is the authors' intention.

If you intend to highlight at least as much Java code as Scala than the quoted statement should be changed. If you intend to rewrite the code examples in the first chapters and most of them will be turn to Scala code than forget about my observation. If these stay the same and the remaining chapters contain mostly Scala code - again - never mind my picky observation.
roland.kuhn (39) [Avatar] Offline
Re: Observation/question about the code examples in the book
Thanks, that is a good point. Our intention is to show code samples that are easily understandable without having to know a lot about the language they are written in. Java 8 was not released (not even close) when we started planning this book, and we might be shifting towards treating Scala and Java 8 more equally, we will have to see what works best; preferring Scala was an obvious choice back in the day due to the amount of boilerplate and line noise present in earlier versions of Java.

The statement you mention will then have to be adapted to wherever this journey leads us.
oltyant (2) [Avatar] Offline
Re: Observation/question about the code examples in the book
Thanks for your quick response.

I'm curious what will work best in the majority of the code samples, though we can say - without a doubt - that Scala has much more language features that supports the conciseness and cleanliness.

Anyway I don't want to open a religious argument since this is not that topic so we will see it in the upcoming chapters (I'm really impatient now to read the new ones).

jamie.allen (13) [Avatar] Offline
Re: Observation/question about the code examples in the book
Hi, Tamas. I'm interested in showing examples in both languages as much as possible, so I'm using Java 8 to highlight they're new CompletableFuture and how to use RxJava (a Java library). I do think using Scala is more expressive, but I don't always want to leave people unfamiliar with Scala behind. So yes, I think you're right that the focus of the examples has changed from what we wrote last year about what we expected to show.