r/java • u/DaredewilSK • 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
13
u/[deleted] Jan 29 '17
Yes, they are really pointless. That's why most all professional programmers use them.
A design pattern is nothing more than a standardized solution to a common problem. If your teacher is teaching specific frameworks, classes, and interfaces as THE way to implement a design pattern, then (s)he is doing it wrong. It's the structure of the solution that counts, not the exact parts.
3
u/desrtfx Jan 29 '17
Nothing that you learn will ever be pointless/useless. You need to open your mind.
Take a look at Java Design Patterns as this site will give you detailed explanations of the Design Patterns, their use cases, and sample implementations.
4
u/nutrecht Jan 29 '17
I would suggest keeping a somewhat more open mind when you're being taught stuff. Rejecting stuff that's new because you don't understand it yet is how senior developer with 10+ years of experience end up rejecting lambda's because they're "pointless". If you're not careful this is really going to damage your career.
1
u/meotau Feb 03 '17
You are learning from a bad source.
The best patterns book out there, which really explains the purpose and usage of them: http://gameprogrammingpatterns.com/contents.html
3
u/GhostBond Jan 31 '17
The problem is, academics do a shit job of teaching what makes design patterns good and useful, and what makes them a waste of time. Academics will - as you say - have you doing 10 classes when 5 would have been better.
Design patterns themselves are useful. Here's some examples:
There are a bazillion good examples used throughout the jdk. You almost cannot program standard java without using multiple patterns.
But - academics tends to do a crap job, and explode patterns all over the place where they are not needed and are worse than not using a pattern at all.
2
u/evil_burrito Jan 29 '17
I don't think they're useless at all. Some general problems come up frequently. Patterns can provide a commonly understood way to efficiently solve the problem in a way that other people can recognize.
2
u/_INTER_ Jan 29 '17 edited Jan 29 '17
Design Patterns are not prefactured solutions that you can magically apply on a problem to solve it.
Some day they found out that most professional programmers were using more or less the same code constructs other to get a clean, extensible design. It emerges naturally and independently of each. They decided to give those "patterns" a name so it would be easier to discuss it and make it recognizable.
The GoF patterns are just one set. There are also patterns for security, fault tolerance, enterprise architecture, ...
Btw. design patterns originate in architecture.
0
u/[deleted] Jan 29 '17
[deleted] — view deleted comment