How can you do anything useful without mutable state?

后端 未结 18 1796
栀梦
栀梦 2020-11-28 17:12

I\'ve been reading a lot of stuff about functional programming lately, and I can understand most of it, but the one thing I just can\'t wrap my head around is stateless codi

18条回答
  •  野性不改
    2020-11-28 17:46

    That's the way FORTRAN would work without COMMON blocks: You'd write methods that had the values you passed in and local variables. That's it.

    Object oriented programming brought us state and behavior together, but it was a new idea when I first encountered it from C++ back in 1994.

    Geez, I was a functional programmer when I was a mechanical engineer and I didn't know it!

提交回复
热议问题