Mark Lewis
Jun 12, 2021

--

There really shouldn't be any changes in the user-level code if possible. JavaScript and so many other languages are fundamentally non-functional because the majority of their idiomatic ways of doing things are through mutation. Ideally, you would have collections that don't expose any immutability and contain all the functionality you need.

I think the Scala collection libraries are excellent in this regard. Any time I work in other languages I miss them. In this example, using numbers.mkString(", ") is hard to beat.

--

--

Mark Lewis
Mark Lewis

Written by Mark Lewis

Computer Science Professor, Planetary Rings Simulator, Scala Zealot

Responses (1)