- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Have you ever heard that Composition of is much more favorable than Inheritance as a design pattern? Inheritance is to be avoided in many instances where composition would do.
Why the hell would I inherit? That's the dumbest solution imaginable. This solution applies to * ANY XPathNavigator AND Anything That Inherits From It*. It is incredibly simple and it doesn't change anythings state. An inheriting solution, for this particular instance, by definition, sucks, as all the selection XPathNavigator methods don't return MyBSXPathNavigators, it returns XPathNavigators.
Tell me, seriously, why would I inherit.
And you're cursing me, that's completely uncalled for.
Admin
Admin
Geez, talk about a bad mood!
Admin
This is exactly the problem with OOP. Inheritance is often an anti-pattern (because it binds unrelated constructs too tightly), and without inheritance, plain OOP is just a procedural paradigm with a weird algebra bolted on. You end up using the language of classes to perform structuring and typing, instead of having an assortment of structuring and typing constructs. In other words, OO programmers end up injecting typing and structuring constructs into a "looser" language, meaning that the programmer is responsible for maintaining the typing and structuring invariants.
This is why Microsoft and Oracle are slowly adding strong typing and functional programming features to their flagship languages. It is obvious that the creation of ad hoc types facilitates expressivity and correctness. Results regarding the computational feasibility of ad hoc typing have been known to computer science and mathematics since the 1930s. Unfortunately, the procedure-focused electrical engineers that dominated CS in the 1950s - 1990s have poisoned millions of minds. Admittedly, there was good reason for CS to be EE-centric for all those years -- designing complex electronics is obviously the domain of electronics engineering. On the other hand, to use the misattributed Djikstra quote, “Computer science is no more about computers than astronomy is about telescopes.”
Admin
Let me guess... one of your KPIs is LoC?
Admin
mother of pointers ಠ_ಠ