--

I agree with you - in my own codebases I prefer functional style and immutable stuff wherever possible.

But the real world isn't perfect and sometimes you need to maintain large, legacy codebase with tons of mutables.

In this article I tried to find example as simple as possible, but initially I encountered this "pitfall" in a class inheriting from Android View and managing some [mutable] properties given by React Native. And just making these immutable simply wasn't possible.

--

--

Bartłomiej Klocek
Bartłomiej Klocek

Written by Bartłomiej Klocek

Enthusiast of electronics and all kinds of software development — from web apps to embedded systems. Expo open-source contributor at Software Mansion.

No responses yet