Earlier quoted context omitted.
And you end up having functions that look like. hit(player, monster, weapon, damage_modifier, arena, previous_turn, next_turn, global_modifiers) because the author didn't like, or understood encapsulation.
In the OO version of this pathology, these arguments become the instance variables of a class introduced to do nothing more than hold them. Poor design has a way of cutting across programming paradigms, or even (in the case of inappropriate inheritance, for example) leveraging their features.
The faster you unlearn OOP, the better for you and your software
221–230 of 252 posts
Re: The faster you unlearn OOP, the better for you and your software
#222> The vast majority of essential code is not operating on just one object – it is actually implementing cross-cutting concerns. Example: when class Player hits() a class Monster, where exactly do we modify data? Monster's hp has to decrease by Player's attackPower, Player's xps increase by Monster's level if Monster got killed. Does it happen in Player.hits(Monster m) or Monster.isHitBy(Player p). What if there's a c…
> You end up with: > Player.hits(Monster).with(Weapon) I think games are a particularly pathological case for OOP, and as such probably not a good example for the article's case. But FWIW, the problem with what you describe (and with OOP for games generally) is that game logic tends to be way too polymorphic for code like that. That is, players don't just Hit() monsters, they also hit items, traps, breakable terrain,…
Re: The faster you unlearn OOP, the better for you and your software
#223IMO, OOP is not inherently any more flawed than any other paradigm.
Re: The faster you unlearn OOP, the better for you and your software
#224> The vast majority of essential code is not operating on just one object – it is actually implementing cross-cutting concerns. Example: when class Player hits() a class Monster, where exactly do we modify data? Monster's hp has to decrease by Player's attackPower, Player's xps increase by Monster's level if Monster got killed. Does it happen in Player.hits(Monster m) or Monster.isHitBy(Player p). What if there's a c…
I tried the more ”OO”-approaches for all too long thinking it would lead me right. It doesn’t.
Re: The faster you unlearn OOP, the better for you and your software
#225Most of the problems pointed out can be reduced into "confusing indirection as abstraction", which is a sin of many OOP developers, particularly those obsessed with design patterns. IMO, OOP is not inherently any more flawed than any other paradigm.
Re: The faster you unlearn OOP, the better for you and your software
#226Blame mediocre OOP languages (Java & friends), not OOP itself.
Re: The faster you unlearn OOP, the better for you and your software
#227Earlier quoted context omitted.
Smalltalk does "OOP" properly because it focuses on message passing, the real benefit of "OOP". Any OOPL that isn't based on message passing is degenerate.
Right. Because Objective C and Smalltalk are such resounding successes, uh?
Popularity amongst the masses of 9-5 brogrammers who code for money and have no artistic sense when it comes to programming doesn't really imply quality. All the programming languages that are truly technically great - today - have small userbases. They're not easily digestible by mediocre coders, require some upfront effort and an open mind. Since the vast majority of professional programmers today are average at best, languages like Erlang, Haskell, Ocaml, Lisp, Smalltalk will never be popular.
It follows then that when looking for quality one should actually reverse popularity.
Re: The faster you unlearn OOP, the better for you and your software
#228> Data is more important than code Nope. Right there at the beginning is where the author goes off track. Computation itself is the most important aspect of computing. Code and data are just complexity to manage. > Do I have a Customer? It goes into class Customer. Do I have a rendering context? It goes into class RenderingContext. I whole heartedly agree with this. The naive approach to domain modelling is to classi…
I disagree. SICP says "“In programming, we deal with two kinds of elements: procedures and data.” If we reduce that further it is really just data.
The data is unintelligible randomness without some algorithm to process it
The code cant exist without some data schema to reference and has no value if there's no data instances to process.
Re: The faster you unlearn OOP, the better for you and your software
#229Earlier quoted context omitted.
In the OO version of this pathology, these arguments become the instance variables of a class introduced to do nothing more than hold them. Poor design has a way of cutting across programming paradigms, or even (in the case of inappropriate inheritance, for example) leveraging their features.
What's wrong with config/value holder objects? Most OOP languages can store them as simple structs in memory.