3 ms·
I think the most important aspect of the object paradigm is that it models real world entities. The real world has a logical consistency so code properly modele
by gmarx 12y ago
I think the most important aspect of the object paradigm is that it models real world entities. The real world has a logical consistency so code properly modeled on it will have a logical consistency. This makes it easier to extend as you try to solve more problems in the given domain.
The more you program the more you tend to design with the intent of making it easier to debug. You end up doing a lot of things that borrow from other paradigms like passing more variables to method calls while using fewer instance variables and consciously avoiding side effects.
Honestly, I don;t know enough about the functional paradigm to argue whether it is easier to debug. It looks like it has a lot of features that would make it so.
Definitely agree that inheritance, instance variables, setters make things more difficult. Inheriting from a framework is asking for trouble.
- blt 12y agoMy C++ coding style is motivated by debugging easiness. I write many local `const` variables acting like a big `let` expression in Lisp. I trust the compiler's data flow analysis to optimize them into the minimal needed registers and memory in optimized builds, but in debug builds I can look at the whole history of the computation to find out what went wrong.
- lsz9 12y agoReal world entities are harder to model than we sometimes like to think. This is a problem in all paradigms because its the fundamental challenge of understanding the world. Entities in the real world often have hidden or poorly understood behaviours. This translates into those moments where you whish you could start all over - because you just learnt something important about your domain.
- pjc50 12y agoThe real world has a logical consistency lolnope (Have a look at, say, the UK benefit system and the failing Universal Credit project that's supposed to work out what to pay people in only one place rather than across a dozen agencies)
- gmarx 12y agoi'm not sure how to contradict this since it seems orthogonal to my point. I don't know those programs and can't tell which aspects of them you consider unmodelable. A human designed system could be stupidly designed but as long as the design doesn't change randomly, you can model it.