News for hackers. Stuff that matters.
Re:The faster you unlearn OOP, the better for you and your s... by Novashi on Sunday November 25, 2018 @09:17AM (#18526951)
Hit is an event that occurs, so not sure why it should escape OO even though in this example even though it's only decreasing ints. I routinely code event objects rather than modifying another class directly by the delta that should occur. OO isn't good for continuous time and events but it does add ergonomic convenience for the developer in this case (there could be other information on the hit, a historical list of Hits looks better as List<Hit> rather than List<int>, it's easier to inspect a hit object during debugging rather than setting watches on player/monster/weapon values).
Re:The faster you unlearn OOP, the better for you and your s... by jryan49 on Sunday November 25, 2018 @09:26AM (#18526986)
You could even serialize the Hit classes and throw them on a message bus, and have them automatically applied across the network or something.