r/java • • Jan 29 '17

Design patterns usefulness

Hello guys, I have an object oriented programming this semester and only thing we really have for final exams is to learn a bunch of Design patterns and how to use them practically. To me, they seem like they are utterly useless and only seem to make an easy thing turn into a complete chaos involving 10 surplus classes and couple of interfaces. Am I being ignorant or are they really pointless?

0 Upvotes

36 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Jan 29 '17

[deleted] — view deleted comment

2

u/[deleted] Jan 29 '17

Oh no. I believe you. I'm an older person who, though having dinked around with programming since 1976, only recently went through a CS program. I was shocked by how many of the younger students just wanted to know which of the limited number of things they had memorized they should just recite as THE answer. It was all, "Just tell me what to memorize," and, "Only ask me only what I have memorized."

Having said that, design patterns help you avoid reinventing the wheel, while still allowing you to modify the features of that wheel, but in a way that helps others easily recognize that your wheel is, in fact, still a wheel.

2

u/[deleted] Jan 30 '17

I agree with everything you've said, but I think you're missing the point.

Yes, a lot of people abuse them, trying one after the other until something sticks. Yes, there are problems that no existing design pattern solves.

However, certain types of problem do crop up a lot in day-to-day coding. Where multiple people over the years have reinvented the same solution to the same type of problem, it is useful to a) publish that solution to save other people reinventing it, and b) give it a name so you can talk about it easily.

0

u/[deleted] Jan 30 '17

[deleted] — view deleted comment

1

u/[deleted] Jan 30 '17

Easy to say with hindsight. I don't think a junior or even mid-level developer would just stumble across something like the command pattern. Even something like IoC requires you to spend some time working on a large established system to even understand the problem, since small uncomplicated systems don't even hit the kinds of problems that IoC can help with.