Right now I'm trying to learn Scala and functional programming, particularly not using any mutable state. I'm going cold-turkey on mutable state. It's hard. I've noticed a few things:
- It takes me forever to work out functions that build collections despite the fact that I can clearly envision to mutating-version of the algorithm
- Once the functions actually compile, they tend to "just work," or at least any flaws are design flaws, not simple coding mistakes. This is very much like the Python experience, only it takes longer.
- The functions continue to work, unlike the Python experience where a combination of edge cases and type errors generally crop up as the complexity of inputs increases
No comments:
Post a Comment