future

Industrial robot costs to drop 65%

According to ARK Invest, the cost of industrial robots will drop 65% by 2025. As they write, “Combined with advances in machine learning and computer vision, this drop in costs should cause an inflection point in the demand for robots as they infiltrate new industries with more provocative use cases.” (Image from the ARK Invest website.)

Looking at some differences between Scalaz Task and Scala Future

Table of Contents1 - The Scala Future example2 - The Scalaz Task example3 - What happens when you call the Future twice?4 - What happens when you call the Task twice?5 - Is one approach correct?6 - Source code

Some time ago I was searching for something and came across this Reddit thread about this tweet from Timothy Perrett, who leads Scala teams at Verizon:

“The fact that #scala Future is not lazy just blows my mind. After years of using Scalaz Task, Future is now totally unusable.”

The last part of that tweet is a bit of hyperbole to me, as I’ve been using the Scala Future for a long time myself, and I’ve had no problems using it. That being said, the examples at the top of the Reddit page were interesting, so I decided to try to understand the differences.

How to use multiple Futures in a Scala for-comprehension

If you want to create multiple Scala Futures and merge their results together to get a result in a for comprehension, the correct approach is to (a) first create the futures, (b) merge their results in a for comprehension, then (c) extract the result using onComplete or a similar technique.

8 ways to do asynchronous processing in Android and counting

This is a good article that shows several different ways to handle background tasks in Android, including

  • AsyncTask
  • IntentService
  • Loader
  • JobScheduler
  • CountdownTimer
  • Java threads
  • Android HandlerThread
  • FutureTask
  • Java Timer

The karma of writing a book

As I’m writing my new book on functional programming in Scala I started thinking, “What if the person who creates Skynet or the Matrix reads this book and suddenly understands how to create their evil invention? But ... if I don’t create this book, they’ll stay on their previous course in life to be a world-famous cookie baker.”

It’s quite a responsibility, knowing that you could be responsible for a future without great cookies.