Hacker News new | ask | show | jobs
by lucideer 2961 days ago
In this particular example, I don't see why. Player and Warrior are conceptually different entities: one is the player of the game, having properties and methods related to controlling gameplay (e.g. a player might play as alternate warriors at different times), the latter is the avatar, having properties and methods related to that fictional characters attributes within the world of the game.

The differences in purpose of the two entities aren't really anything to do with fp vs oop; I don't see what's fp-ish about the first example, and your last example is potentially a weird mix of fp and oop (depending on what "warrior" is, and I can't figure out what use it would be in that context if it wasn't an object with encapsulated methods)