Scala Maven rugs

“Add a pom to my toy Scala project so I can build it with Maven” sounds simple. It is, if you do it every day. I can look it up, yet again. And get it wrong, yet again. And consult an expert with “Why doesn’t it see my Scala sources! This works fine from the …

Read moreScala Maven rugs

The Emperor has no clothes: Bad actors in tech

by Jorge Montero Maybe you are interested in a language, or an open source project, but you feel like the community is unwelcoming: Some big voices are rude, they’re downright hostile to newcomers and anyone who disagrees with them. Let’s not get involved. Or in your workplace: influential people in the organization aren’t nearly as …

Read moreThe Emperor has no clothes: Bad actors in tech

Testing akka actor termination

When testing akka code, I want to make sure a particular actor gets shut down within a time limit. I used to do it like this:  Thread.sleep(2.seconds) assertTrue(actorRef.isTerminated()) That isTerminated method is deprecated since Akka 2.2, and good thing too, since my test was wasting everyone’s time. Today I’m doing this instead: import akka.testkit.TestProbeval probe = …

Read moreTesting akka actor termination

Left to right, top to bottom

TL;DR – Clojure’s threading macro keeps code in a legible order, and it’s more extensible than methods. When we create methods in classes, we like that we’re grouping operations with related data. It’s a useful organizational scheme. There’s another reason to like methods: they put the code in an order that’s easy to read. In …

Read moreLeft to right, top to bottom

When OO and FP meet: returning the same type

In the left corner, we have Functional Programming. FP says, “Classes shall be immutable!” In the right corner, we have Object-Oriented programming. It says, “Classes shall be extendable!” The battlefield: define a method on the abstract class such that, when you call it, you get the same concrete class back. In Scala.Fight! Here comes the …

Read moreWhen OO and FP meet: returning the same type