• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Beginner OOP code vs design patterns in Matthias's book?

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome Matthias,

If you could explain to us, in what ways techniques in your book bridge the gap between, say, beginner OO code and some more fancy design patterns?
 
Marshal
Posts: 73019
330
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[wild uncontrolled rant]
Why do you think there is a gap between beginners' OO code and fancy design patterns? Good OO code will always use patterns, even if the patterns are too simple to have a name, even in a one‑class app. The common or garden OO class is a pattern in its own right, even if nobody calls it a pattern.
In a lot of beginners' apps, we see there is a gap, not between OO and fancy design patterns, but between the code and OO. Too many people are being taught to write procedural code.
[/rant]
Maybe you meant to ask how far the book goes taking people from the basics of OO to design patterns.
 
Mike Gosling
Ranch Hand
Posts: 121
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Why do you think there is a gap between beginners' OO code and fancy design patterns?  



In my humble opinion and experience (which is not big, I'm still a student, which I based upon reading HF Design Patterns and few implementations of patterns from the book), beginner's OO code is not so flexible and resilient on changes of functionalities, while (fancy) DP most certainly are. From that standpoint, and as someone who is at least trying not to write procedural code but an OO code, I was wondering in what degree are guidelines for good OO code in Matthias's book, (resilient to changes), are close to designing classes and interfaces, putting them together if you will, like in some (fancy) DP.

Campbell Ritchie wrote: Good OO code will always use patterns, even if the patterns are too simple to have a name, even in a one‑class app. The common or garden OO class is a pattern in its own right, even if nobody calls it a pattern.


Learn something new. Completely makes sense.

Campbell Ritchie wrote: Maybe you meant to ask how far the book goes taking people from the basics of OO to design patterns.


We could phrase it that way, yes.
 
Campbell Ritchie
Marshal
Posts: 73019
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mike Gosling wrote:. . . beginner's OO code is not so flexible and resilient . . . .

No, I wouldn't expect it to be. If you start with plain simple OO, you can add resilience and flexibility later. At least some people do start with OO from the very first line of code. Some people teach procedural code and add OO to that. Some people understand the difference readily and others take ages and ages to make the jump to proper OO.
 
Author
Posts: 7
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I find that when developers find out about design patterns, they want to apply them, because they are cool and look interesting/make their code look smart. At least I did this when I first read design pattern books In my book I aim to get back to some of the OO basics and I establish some of the basic ideas that, when you follow them, will eventually lead you to discover the most important design patterns by yourself. I think that's more helpful then starting with the design patterns and only then wondering about what OO programming entails.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic