This week's book giveaway is in the Functional programming forum.
We're giving away four copies of A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles and have Ben Weidig on-line!
See this thread for details.

Pho Tek

Ranch Hand
+ Follow
since Nov 05, 2000
Pho likes ...
Python Chrome Ubuntu
Merit badge: grant badges
For More
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
7 years ago
Thanks Pierre for the implementation.

From Tim's comment, I found that scala has a @tailrec annotation.
7 years ago
If my memory serves me right, the JVM does not optimize tail calls. Has that changed with Java 8 ?
7 years ago
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.
8 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.
8 years ago
I'm not very clear on what Reactive programming is. Can we use this in Java8 ?
8 years ago
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.
8 years ago
How are closures different in Java 8 compared to older versions of Java ?
8 years ago
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".
8 years ago
Thanks. I'll take a look at "Java 8 for the Really Impatient".
8 years ago
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.
8 years ago
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.
8 years ago