Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Pho Tek

Ranch Hand
+ Follow
since Nov 05, 2000
Pho likes ...
Chrome Python Ubuntu
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pho Tek


My understanding is that your code snippet is implementing a trampoline. Am I correct ? I'm basing this on this article Tail calls, @tailrec and trampolines in scala
Thanks Pierre for the implementation.

From Tim's comment, I found that scala has a @tailrec annotation.
If my memory serves me right, the JVM does not optimize tail calls. Has that changed with Java 8 ?
Thanks for your reply.

What is your opinion on doing this:

git pull --rebase

vs the plain

git pull
If my code is hosted in a private GITHUB repo, what are the security implications of deploying my github SSH keypair to cloud VMs that I spin up - in order to allow a headless process to git checkout ?
I know this is a cultural thing but what is your opinion on the choice between doing rebase vs merge ?
Are there plans to rewrite logstash ?
It is so slow. Lumberjack performs pretty well though. Otherwise I am happy with ELK.
3 years ago

I have found the solution to Tuples in java8. I use Lombok to create throwaway value objects.

This creates an object with immutable properties.
I'm not very clear on what Reactive programming is. Can we use this in Java8 ?
I do define a lot of methods which take an interface and it is still convenient to be able to create an anonymous class as an argument in-situ during the invocation. I'm used to tuples in python, so this is how I get my fix in Java8 - unless you can suggest an improvement.

As for labelled breaks; I use them very often. I probably have used them three times last year.
How are closures different in Java 8 compared to older versions of Java ?
I used Scala For the impatient when completing Odersky's coursera course.

I think I'm going to start writing some technical books with the title "Technology XYZ for those with ADHD".
Thanks. I'll take a look at "Java 8 for the Really Impatient".
In Chapter 8, there's a section called How Not To Work With Optional values.

Can you summarize in one sentence what are the gotchas to watch out for when designing and using APIs that exposes optional values ?

As far as I'm concerned, nulls in the JVM is an impediment to using java.util.Optional ? It applies to Enums as well.

P.S. The book contains too much introductory material for me to fork out the money for it.
You have a point but I'm just pointing out that because Java has null references, we need static code analysis to detect & flag code that returns null for a type wrapper with Optional. Without it, Optional does not prevent NPE.