Kotlin doesn’t have true pattern matching, and that’s fine. In order to make matchable classes in Scala, there is an awful lot of overhead required to make it work, and I highly respect Kotlin’s goal of not adding much overhead anywhere. But that doesn’t mean we can’t try to make our own way to get something closer to pattern matching. Continue Reading
Today, we’ll be talking about something controversial: static methods. I have yet to read anything that says static methods are good and useful, other than Effective Java recommending them in the use of static factory methods. There are some really interesting (and somewhat dumb) arguments out there against them that rarely, if ever, even get explained. Notably, I’m providing a rebuttal to the article, Utility Classes Have Nothing to do With Functional Programming.
Today, we’re going to look at the good and bad of static methods; what they’re good for and what they’re not.
This is coming out late on its release date, and to those who actually care (as few in numbers as those people may be), I’m sorry about that. I had taken most of the week off of work in order to work on stuff like this blog and finishing the peripheral parts of my book, so of course I wasted all away all that time with things that didn’t really matter 😛
Anyway, this post is a list of my favorite programming books that I read this year! They’re grouped into categories for your convenience (and my OCDness). Continue Reading
In today’s article, we follow up last week’s article about making Kotlin-like builders in Java and Python, expanding the builder APIs to take some of the optional parameters for more flexibility. We continue on with our HTML example, trying to add tag attributes, such as class, id, and style. Continue Reading
When I first laid eyes on Java 8’s Stream API and found out that it worked lazily (then found out what that meant), I was blown away and utterly baffled. It didn’t seem possible at all. Eventually, I was able to wrap my head around it, realizing it was done with my favorite design pattern: the Decorator Pattern!
In this post, I’m going to go through and write up a simplified implementation, only going through the
reduce() methods. We’ll also be ignoring the ability to parallelize the calls. Lastly, for the sake of readability, I’ll be ignoring
extends in the generics. Continue Reading
First, I’d like to thank everyone who took my survey from last week. It wasn’t important (and, according to some of you, it was ‘dumb’), but it was something I was curious about I’m glad I got all of your feedback. The results are in: Continue Reading
I wrote a poll to see what people what people’s preference was concerning functional composition.