Thinking Functionally With Scala

Kevin Jacobs solves a simple problem using Scala in a few ways and explains functional programming concepts along the way:

Why is this code better than the functional approach? Note that it saves an enormous amount of time since this approach does not need to scan through all the integers! It are simply a few calculations (at which a computer is good at). All the code (the naive approach and the better approach) can be found on GitHub.

Having a solid understanding of mathematics and logic can help you come up with superior algorithms, but make sure you comment them in detail so that the next dev (who might not understand the underpinnings of your code) doesn’t replace it with a brute-force method because it’s “easier.”

Related Posts

Case-Insensitive Searches in Snowflake

Koen Verbeeck shows how you can perform case-insensitive searches in Snowflake DB: I’m doing a little series on some of the nice features/capabilities in Snowflake (the cloud data warehouse). In each part, I’ll highlight something that I think it’s interesting enough to share. It might be some SQL function that I’d really like to be in SQL […]

Read More

Using the ML.NET Model Builder

I have a post looking at the ML.NET Model Builder: You have four options from which to choose: two-class classification, multi-class classification, regression, or Choose Your Own Adventure. Today, we’re going to create a two-class classification model. Incidentally, they’re not kidding about things changing in preview—last time I looked at this, they didn’t have multi-class […]

Read More


July 2016
« Jun Aug »