|
|
|
|
|
by tchow
3487 days ago
|
|
He mentioned a lie of: Code should be designed around a model of the world but I didn't hear any reason why not to? The Key/Value pair being the only reason, but besides that being a optimization / preoptimization in high performance applications, is there any reason to not design code around a model of the world? Seems to me it makes things easier to think about. |
|
Basically: When you try too hard to fit the real world into code, you end with OOP.
It has one great advantage: it is easy to translate real world into "computer".
but one great big distvantage: a computer is a computer, not real world, OOP translates to complexity (think "Architecture Astronauts", and spaghetti of pointers/references/virtual/inheritance) and things done in a way that harms performance (not a problem for smaller problems, but if your problem is not small...)
His idea is that you should instead fit the world into your DATA, not your code, think about what data your program needs from the real world (do you really need all tiny details for example?), what is your inputs and outputs, and THEN you code to make that work, you code around your data structures, file formats, etc... not the other way around.