News for hackers. Stuff that matters.
Re:Post-Architecture: Premature Abstraction Is the Root of A... by Dwedit on Thursday July 18, 2024 @02:14PM (#40998276)
When you write a procedure that has to maintain an internal state between calls, changing it into a class makes sense. As for the name, you change the verb (write) into a noun (writer), and you now have a name for the class.

C# will silently create hidden closure classes for you when you use lambdas or yield.

Re:Post-Architecture: Premature Abstraction Is the Root of A... by alex-robbins on Thursday July 18, 2024 @03:06PM (#40998747)
When you write a procedure that has to maintain an internal state between calls, stopping what you're doing and switching to functional programming makes sense.
Re:Post-Architecture: Premature Abstraction Is the Root of A... by arendjr on Thursday July 18, 2024 @02:28PM (#40998403)
Just know that if you do this, you’re injecting statefulness in the center of wherever it was this procedure was being used. If your entire system already has statefulness everywhere, nobody will bet an eye. But if you want to have any chance at creating a functional core or island, it’s the opposite of what you should be doing.