|
so does anyone know a good crash course on object oriented design patterns? i need it for a uh friend.
|
# ? Dec 6, 2018 21:54 |
|
|
# ? Jun 7, 2024 17:23 |
|
Mahatma Goonsay posted:so does anyone know a good crash course on object oriented design patterns? i need it for a uh friend. This seems dece and I found it by googling design patterns: https://www.geeksforgeeks.org/software-design-patterns/ But honestly, cramming design patterns has never worked for me. I only ever learned them by using them, which is a little hilarious because a lot of times I don't know I need them unless I learn them. The Terrible Programmer Conundrum.
|
# ? Dec 6, 2018 21:59 |
|
devs around me usually think I don't know much OO because I lived in functional land for so long. The trick I have is to mention that I have problems with OO because it tends to conflate types and classes such that you end up having "classes used as containers of a given type" and "classes as hierarchical state isolation construct" and you have to use both at once. Then mention something about multiple inheritance being hosed up, and how much you hate having to deal with covariance and contravariance issues and you much prefer traits instead. People tend to leave you alone about your OO opinions after that
|
# ? Dec 6, 2018 22:02 |
|
MononcQc posted:devs around me usually think I don't know much OO because I lived in functional land for so long. The trick I have is to mention that I have problems with OO because it tends to conflate types and classes such that you end up having "classes used as containers of a given type" and "classes as hierarchical state isolation construct" and you have to use both at once. Then mention something about multiple inheritance being hosed up, and how much you hate having to deal with covariance and contravariance issues and you much prefer traits instead. I know some of these words
|
# ? Dec 6, 2018 22:05 |
|
AggressivelyStupid posted:I know some of these words if you know only these people will assume you know the others
|
# ? Dec 6, 2018 22:10 |
|
Finster Dexter posted:This seems dece and I found it by googling design patterns: https://www.geeksforgeeks.org/software-design-patterns/ thanks! i have a whole week to figure this stuff out! maybe ill build a little app or something.
|
# ? Dec 6, 2018 22:40 |
|
Finster Dexter posted:But honestly, cramming design patterns has never worked for me. I only ever learned them by using them, which is a little hilarious because a lot of times I don't know I need them unless I learn them. The Terrible Programmer Conundrum. This. Knowing the fact that something called "template method pattern" exists is not nearly as helpful in learning to use it as seeing a real-world problem being solved by it.
|
# ? Dec 6, 2018 22:59 |
|
you know what pattern I loving hate? The visitor pattern. like you could just accept a single lambda, that chooses which cases it wants to deal with via pattern matching. oorrrrr you could accept 100 different overridden methods to deal with each case one at a time. it's cropping up in rust which does have good pattern matching and I'm at a loving loss to figure out why except maybe "c++ devs"
|
# ? Dec 6, 2018 23:06 |
|
Xarn posted:This. Knowing the fact that something called "template method pattern" exists is not nearly as helpful in learning to use it as seeing a real-world problem being solved by it. true but knowing patterns exist even if you dont know them inside and out does have value Ive never written my own pool in prod code but knowing the object pool pattern exists will keep me from doing a lovely version of my own from scratch if it does come up, for example
|
# ? Dec 6, 2018 23:32 |
|
op, a lot of patterns are actually simple and intuitive and you may have used them without realizing even in non-OO code reading the descriptions on wikipedia even might help you connect those dots
|
# ? Dec 6, 2018 23:35 |
|
MononcQc posted:if you know only these people will assume you know the others The entirety of my career is based on this, the "always have your bath towel" school of thought.
|
# ? Dec 6, 2018 23:37 |
|
c++ chat: i opened some c++ today for the first time in a while, and the first thing i saw was it calling std::string::data() and then using const_cast so it could modify the result. what could possibly go wrong?
|
# ? Dec 7, 2018 00:46 |
|
gonadic io posted:you know what pattern I loving hate? The visitor pattern. like you could just accept a single lambda, that chooses which cases it wants to deal with via pattern matching. yup visitor sucks. at least it's not 15 years ago so there are decent things like StAX. only time in the last few years i recall encountering visitor is with asm
|
# ? Dec 7, 2018 07:40 |
|
Xarn posted:"Well, it takes 23 hours to run the weather simulation for the next day, and the granularity is continent-scale, but there is no point in optimizing it further" twice as fast would still be too slow so im not sure what your point is look i don't see what's so hard to understand. factor of 2 doesn't matter, factor of 1000 does. therefore ruby is stupid, use java, and if you need to make a syscall write a little JNI lib in C
|
# ? Dec 7, 2018 07:44 |
|
Soricidus posted:c++ chat: i opened some c++ today for the first time in a while, and the first thing i saw was it calling std::string::data() and then using const_cast so it could modify the result. what could possibly go wrong?
|
# ? Dec 7, 2018 08:27 |
|
a factor of 2 in a 500 iteration loop is 1000x
|
# ? Dec 7, 2018 08:36 |
|
Kevin Mitnick P.E. posted:yup visitor sucks. at least it's not 15 years ago so there are decent things like StAX. only time in the last few years i recall encountering visitor is with asm antlr is the other major tool that Ive used recently that encourages visitor use for both antlr and asm I figure the tool is good enough to grit my teeth and use the bad pattern
|
# ? Dec 7, 2018 08:37 |
|
The way to 100x perf improvements usually consists of many smaller ones.
|
# ? Dec 7, 2018 08:38 |
|
Krankenstyle posted:a factor of 2 in a 500 iteration loop is 1000x what if each iteration takes 1 second then the loop takes 500 seconds. slow it down by a factor of 2: each iteration takes 2 seconds and the loop takes 1000 seconds what kind of alien math are you using where 500 x 1000 = 1000?
|
# ? Dec 7, 2018 08:41 |
|
Krankenstyle posted:a factor of 2 in a 500 iteration loop is 1000x well 2 * 500 = 1000 so your post still makes no sense
|
# ? Dec 7, 2018 08:43 |
|
Xarn posted:The way to 100x perf improvements usually consists of many smaller ones. dont you mean a rewrite in c++, which makes the code as fast as it can possibly be
|
# ? Dec 7, 2018 08:44 |
|
haven't had my coffee yet lol I meant this: Xarn posted:The way to 100x perf improvements usually consists of many smaller ones.
|
# ? Dec 7, 2018 08:52 |
|
In that case you only need 10 2x improvements.
|
# ? Dec 7, 2018 09:24 |
|
Been meaning to post this for a bit now:gonadic io posted:Only thing about rust is you have to use intellij. No other IDE is nearly as good. gonadic io posted:i mean it's fine but it's also not obvious to beginners that that's what you need to do Hello from 3 months ago and thank you! I tried out IntelliJ IDEA for Rust when you mentioned it back in September and you were absolutely right. Object/method scanning and suggestions are so much faster and more complete, git integration is equally easy, theming ecosystem is not quite there but the other stuff more than makes up for it. Now that I'm writing stuff large enough to actually rub up against the borrow checker it's saving me a lot of time by highlighting my trivial mistakes so quickly. I've gone ahead and also switched over to PyCharm for my production python work and regret nothing.
|
# ? Dec 7, 2018 12:09 |
|
gonadic io posted:you know what pattern I loving hate? The visitor pattern. like you could just accept a single lambda, that chooses which cases it wants to deal with via pattern matching. "design pattern" is just a term to describe a way to overcome a deficiency in a programming language. the GOF design patterns book was written to overcome deficiencies in 1994 java. except people read it now and think sprinkling design patterns in their code makes their code better in conclusion, don't read the GOF design patterns book
|
# ? Dec 7, 2018 19:15 |
|
game programming patterns is a good design patterns book that's mostly applicable outside gamesPie Colony posted:"design pattern" is just a term to describe a way to overcome a deficiency in a programming language. the GOF design patterns book was written to overcome deficiencies in 1994 java. except people read it now and think sprinkling design patterns in their code makes their code better i mean pretty much anything would make my code better
|
# ? Dec 7, 2018 20:03 |
|
I wonder if FartFactory, ButtBuilder, PenisPrototype, and OrificeObserver have been used in the medical software world.
|
# ? Dec 7, 2018 20:20 |
|
Not when everything is written in mumps or worse.
|
# ? Dec 7, 2018 20:33 |
animist posted:game programming patterns is a good design patterns book that's mostly applicable outside games This book seems pretty informative and well-written. Thanks for posting it!
|
|
# ? Dec 7, 2018 20:39 |
|
animist posted:game programming patterns is a good design patterns book that's mostly applicable outside games uh Service Locator and Event Queue patterns are trash garbage don't ever use those Our Russian outsourcers love those and I loving hate them and their code so much right now
|
# ? Dec 7, 2018 20:42 |
|
Mahatma Goonsay posted:Not when everything is written in mumps or worse. i wonder what ))<>(( means in medical brainfuck
|
# ? Dec 7, 2018 20:49 |
|
Krankenstyle posted:i wonder what ))<>(( means in medical brainfuck means you have a hemorrhoid healthy butt would be )x( I think
|
# ? Dec 7, 2018 21:15 |
|
Finster Dexter posted:uh Service Locator and Event Queue patterns are trash garbage don't ever use those fwiw the 'event queue' the book describes is for a single system's input, e.g. a deduplicating audio queue, which seems reasonable to me there's no excuse for service locator, though. it's just singletons but worse
|
# ? Dec 7, 2018 21:19 |
|
Finster Dexter posted:means you have a hemorrhoid you need to read up on your literature
|
# ? Dec 7, 2018 21:41 |
|
oE))O((3 is the one you really have to watch out for
|
# ? Dec 7, 2018 22:06 |
|
animist posted:fwiw the 'event queue' the book describes is for a single system's input, e.g. a deduplicating audio queue, which seems reasonable to me ok yeah, that sounds pretty tame... but the Russians have all of their microservices communicating via message bus, and then internally in some of them, they have their own bespoke event queue that can handle events from itself or from the message bus and lmao good luck following that mess
|
# ? Dec 7, 2018 22:35 |
Main Paineframe posted:oE))O((3 is the one you really have to watch out for mods
|
|
# ? Dec 7, 2018 22:37 |
|
Main Paineframe posted:oE))O((3
|
# ? Dec 7, 2018 22:46 |
|
please °∈)✹(∋
|
# ? Dec 8, 2018 00:00 |
|
|
# ? Jun 7, 2024 17:23 |
|
holy poo poo wait a sec isMain Paineframe posted:oE))O((3 or Krankenstyle posted:
a viable url now that they allow utf-whatever in urls???
|
# ? Dec 8, 2018 01:26 |