From Python to Scala

Sorry for the huge delay!

Immutability makes everything easier except for propagating updates. For instance, in my current project, I have a big graph-like database that I read 99% of the time and mutate the remaining 1% of the time.

I think that making that graph immutable would be a pain as each change would need to be propagated correctly within the graph. My graph is not your standard well-behaved graph, but more like a big interconnected network of subgraphs, etc…

Some methodical design and planning would be needed, which would probably make me understand my problem even more and ultimately lead to a better design… but why bother?

I guess it’s the same tradeoff between using a borrow checker and a garbage collector: sure, the borrow checker forces you to plan and understand things better, but why bother when there’s a simpler solution?

For now, I’m still using Python and learning about Scala in the meantime. I’m reading the 2nd edition of the red book about FP. I have some Haskell experience and I like abstract math, so it’s been an easy read so far. I’ve never gone too deep into category theory, though, so I’ll probably have to work a little harder in later chapters.

Sorry for the delay. I think I’ll first learn more about Scala and then reconsider the whole matter keeping your suggestions into consideration before committing to a particular approach. Thanks for the help!

1 Like