Design Patterns

Do you have your goto place when learning design pattrens?

Currently reading:
Head First Design Patterns
tutorialspoint.com/design_pattern/strategy_pattern.htm

and watching:
youtube.com/watch?v=v9ejT8FO-7I&t=149s

Also heard good things about:
Design Patterns: Elements of Reusable Object-Oriented Software

Other urls found in this thread:

norvig.com/design-patterns/
harmful.cat-v.org/software/c /linus
twitter.com/AnonBabble

I'm a neurotypical, no.

OO is a mistake, learning design patterns for the sake of it is getting it all backwards even for good intent.

You should not rape your code to accommodate factory factories, embrace kiss, no need to be buzzword compliant.

Sorry for the spoiler, I saved you a couple of months of dicking around if you can recognize good advice and not want to commit all mistakes on your own.

Just finished my Software Design course in college. It was entirely based around that book.
Definitely an interesting topic, it was pretty hard though.
I feel like it'll take a decent amount of time and experience to know what pattern to use in a given situation.

This. Design patterns are admission that your language is not expressive enough.

Sometimes they are useful so you should know the important ones (like composition, dependency injection, visitor...) but weight using them against the boilerplate and loss of readability.

why do you think it's a mistake?

>MFW using a flyweight instead of a visitor factory

Their most useful property comes from providing a common language in which you can explain to receptive individuals why you should not use them

>GoF

because bloat and complexity is all that comes out of it, but that is no wonder.
If you ever been to a Java interview you would now people can't agree on what does it mean for starters. Even Alan Kay has no idea: Maybe something to do with messaging. No wonder you can't build solid stuff on hot air.

do you think it's useless?

from a coding point? yes

earning a paycheck? no, they are useful for interviews if you don't want to polish your algorithms/data structures further. Still, in that aspect adding more JS/node, devops to your resume is more useful

Hmm as a undergrad with a few internships, I don't know if I follow. Most production code I've seen is much more readable with design patterns applied. Could you provide an example where design patterns make code unreadable?

why?

this

>goto place

Place:
Printf('GOTO is the most abused instruction in history yet its proper use the only true sign of competence'. "\n");

if you need design patterns, your language is too weak

You don't need design patterns.
Most so called design patterns are the result of a poorly designed language which doesn't have the right features.
You then have to come up with these engineered designs to express a simple pattern.
The only reason design patterns are popular is so that stupid pajeets can try contributing in a project without breaking everything.

Take a look at this for further insights:
norvig.com/design-patterns/

>mfw working on software with 100K active users
>mfw I don't give a shit about meme design patterns, planning or unit testing

t. expert fizzbuzz C programmer

this
git init then code away

yeah fuck unit testing amirite guise haha who cares if edge cases break your code and get your servers owned amirite haha

kek
Retards so used to the big black unit testing cock that they can't imagine life without it.

it's okay if you don't unit test your code, just don't get butthurt when pyotr builds a fuzzer to test your software for you :^)

You guys seem to always advocate for simplicity and bloatless software but when it comes to design patterns then suddenly you want more features in your language?

Java is notably featureless and that makes it so design patterns are almost essential. What would you rather have? macros so you don't need to implement de interpreter pattern? metaclasses so you don't need factories?

What if you need to use OOP? I don't think you guys would argue about the fact that in some fields it's easier and more natural to work with oop so suggesting C or Haskell is out of the question.

What would you suggest so you dont need design patterns in your OOP language? Python? C++? Is it worth it to have a bloated piece of shit for a language so you guys don't have to memorize or even look for how to implement an abstract factory?

reminder that you can write correct code without any testing, and shit code that no amount of testing can help

testing has its places, but when building a new product ttm usually trumps everything

>no, tdd does not make you move quicker

>more features
We don't want more features, we want the right ones.
>Java is notably featureless
maybe it was in version 1
>What if you need to use OOP?
Design patterns aren't what oop is about. Smalltalk or Self are examples for object oriented languages that work really well even without using design patterns.
>What would you suggest so you dont need design patterns in your OOP language?
Prototype based object orientation instead of class-based. First class functions instead of wrapper objects.

And if you really do need to use a design pattern, then that's fine with me.
I'd just be careful not to overuse them. And don't think you'll become a great programmer if you're just great at applying design patterns.

harmful.cat-v.org/software/c /linus

why do Linus is a fucking dick? I love him!