5 ms·
> Most of the OOP problems go away if you use more flexible programming languages or paradigms. Spare us the myth. This isn't reddit.
by ExpiredLink 15y ago
> Most of the OOP problems go away if you use more flexible programming languages or paradigms.
Spare us the myth. This isn't reddit.
- raganwald 15y agoIronically, your comment is rather reditesque in that it piles abuse upon my comment without actually providing an argument against it. Perhaps you have something specific to share about why that or any other point is wrong? Perhaps an interesting viewpoint on myths and how they take hold?
- true_religion 15y agoOne myth I can think of is... most people believe that current design patterns originated in Java, or if not Java then C. This is primarily because of the languages books like Gang of Four use to illustrate design patterns. In reality however, most design patterns date back to Smalltalk which (ignoring multiple-inheritance for the moment), provides the most flexible and dynamic representation of objects that I've seen to date. ---- Another myth is that design patterns were invented. The the Gang of Four can be quoted as saying they merely are documenting patterns that will naturally occur in the course of writing code. If you use run-time-binding to determine an objects inteplementation, then congratulations you have Inversion of Control whether you want to call it that or not. The whole purpose of design patterns is to give us a common language so we don't have to describe our code, but can simply call it by name.
- raganwald 15y agoI agree with what you've said here. I actually use ST to illustrate the relationship between patterns and languages. "Fluent Interface" is the name of a pattern wherein methods that are executed for their side-effects return the receiver, and callers then chain methods to a single receiver. This encourages writing many small methods while keeping code clear. It is not necessary in ST, because ST's syntax includes the semicolon operator for cascading messages to a single receiver. In effect, the pattern is "baked into the language."
- ExpiredLink 15y ago> Another myth is that design patterns were invented. Patterns are detected - abstracted from what experienced people usually do in certain circumstances.
- route66 15y agohttp://norvig.com/design-patterns/ http://norvig.com/design-patterns/ illustrates the role of design patterns in dynamic languages: some are less important, others stay. But you could come up with that for yourself by comparing the need for a visitor pattern in, say, Java and Python respectively its implementation in both. [EDIT] Of course other programming paradigms can develop other patterns, if they are confronted with problems they cannot solve from the outset. That was more raganwald's point.
- ExpiredLink 15y ago> Of course other programming paradigms can develop other patterns Of course, that's the point of patterns.