Re:The use of `class` for things that should be simple free ...
by crimsonalucard1 on Thursday May 28, 2020 @12:18PM
(#23339056)
Well I mean would you rather have this:
method(state){
return doSomething(state)
}
Or this: class A:
otherThingThatMutatesState1()
otherThingThatMutatesState2()
otherThingThatMutatesState3()
method(){
this.state += 1 // or some other mutation
}
Re:The use of `class` for things that should be simple free ...
by panopticon on Thursday May 28, 2020 @12:06PM
(#23338898)
That depends on the language. Haskell provides some nice syntax here with monads.
But it is - the programming language is now repeatedly quizzing you on something you've already told it.