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

Clippy Lives: In Scala

Akhil Vijayan explains Scala Clippy: Now you may be wondering how these errors are identified and we get advice related to it. Simple, these are provided by the Scala community. If you visit their official website Scala Clippy where you can find a tab “Contribute”. Under that, we can post our own errors. These errors are parsed […]

Read More

Bashing Windows

Steve Jones shows how to install Bash on Windows 10: With SQL Server coming on Linux, some people will want to learn a bit of Linux. Or perhaps they need to get re-acquainted with the OS, which is my situation. I grew up on DOS, but moved to Unix in university. I’ve dabbled in Linux […]

Read More


July 2016
« Jun Aug »