Coding Hamming Distance in #Scala - 2 Functional approaches - #12in23
Channel: Lorenzo Barasti
Date: 2023-02-02

Getting ready for a live stream on @exercismlive, scheduled for Monday 6 Feb at 10 am UTC!

We solve a challenge where we are asked to compute the Hamming distance between two strings - in this case representing two DNA strands.
In doing so, we explore some functional programming concepts in Scala as a functional programming language.

3:28 Exercise intro
5:08 Option to represent absence of value
8:00 Coding starts - zipping strings
16:16 Functions as first class citizens
21:44 Pure functions (light version)
23:00 Immutability
23:11 Pattern Matching
26:11 A recursive solution (more Pattern Matching!)
42:20 Pattern Matching with Guards
47:00 Wrapping up

Streamed on 2 February 2023.