Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Gang of Satori

Name: Anonymous 2009-12-28 1:42

What is your favorite design pattern and why?

I dislike MVC but I keep using it!!!

Name: sage 2009-12-28 2:46

my favorite and only pattern is "golden hammer"

Name: Anonymous 2009-12-28 3:04

i quite like MVC for web apps.
but otherwise i find it horrible; especially when there's a GUI involved.

Name: Anonymous 2009-12-28 3:07

RAII is the heartiest, chunkiest, and most delicious of programming metaphors design patterns. Every day I write two bowls full of RAII. Broccoli and cheese is my favorite kind but usually I get tomato, because if I eat too much broccoli, I hax myself. The tomato is very good as well, though. It has actual chunks of tomato, which is not something you'll find in a typical programming metaphor. The thought of those tomato chunks on my keyboard is enough to make my mouth water. Another good kind that I like is beef and barley. The beef has to be manually managed but the broth and the barley make up for it. Basically RAII is something everyone should try once, even if it kills them. My brother worked on a prototype of the THERAC-25 and he died of RAII, but his last words were "It was delicious."

Name: Anonymous 2009-12-28 4:28

>>1
I like the if...then...else design pattern. It's much cleaner than the gotos I was using previously

Name: Anonymous 2009-12-28 4:32

my favorite and only pattern is defmacro

Name: Anonymous 2009-12-28 4:47

I rather enjoy the push rax/pop rax design pattern. Sure, when I really need performance I lay out the map of register usage in advance and I don't need that pattern, but when I code something that is not performance critical, some scripting code basically, and I just need to use rax for something, then i just store/restore it on the stack and that is all. I find this pattern to be a real productivity booster!

Name: Anonymous 2009-12-28 5:00

I don't know what a design pattern is.

Name: Anonymous 2009-12-28 5:09

>>6
of course

Name: Anonymous 2009-12-28 5:27

>>8
you're the only pretender to achieve satori

Name: Anonymous 2009-12-28 10:31

>>5,7
lol'd

Name: Anonymous 2009-12-29 12:42

I hate the singleton pattern. It's a kludge to write procedural code in languages that force you to use OO, and so you get a lovely getInstance() peppered everywhere in your code.

Name: Anonymous 2009-12-29 14:15

I like the Adapter pattern because it lets me pretend that I am able to use function pointers.

Name: Anonymous 2009-12-29 14:25

>>12
No, static methods are a kludge to write procedural code in forced-OO languages.  Singletons are a way to share global state among a family of functions when initializing that state may be costly or impractical to do at load time, or may not be needed in every execution.  A non-OO language would solve this by requiring an init() call before the first use (which is prone to programmer error) or checking for a valid instance every time a related function is called (which is wasteful).  +sharedInstance exploits the type system to force an initialization check only when necessary.

Name: Anonymous 2009-12-29 14:30

>>14
+2, insightful

Name: Anonymous 2009-12-29 14:36

>>14
BACK TO /OOP_FAGGOTS/

Name: Anonymous 2009-12-29 15:11

>>14
Singletons are a way to share global state among a family of functions
Global variables are the way to share state between a family of functions. You're still thinking in OOP for a set of functions that clearly do not behave this way.

You think global variables are a worse solution? I've got news for you: your singleton IS a global variable. Shocking! I also find it hilarious that you think halting all threads and invoking the class loader is less wasteful than just checking for a damn instance. Besides, the best solution, that is forcing the user to call init(), is not a big deal; you can make it fail very loudly when the user forgets to do so, and you can anticipate exactly when your bulky initialization happens. Do you care about performance or don't you? Don't give me this half-way hack bullshit.

But all of these are really a violation of encapsulation, having you deal with an 'instance' you should know nothing about. Static methods (or plain old functions in non-shitty languages) is the real solution here. Do your class loader hack if you want; just hide it from the users of your module.

Name: Anonymous 2009-12-29 17:34

>>17
halting all threads and invoking the class loader
( ≖‿≖)
Troll harder, Ctard.

Name: Anonymous 2009-12-30 12:17

>>17
Unnh, god, yes, troll me harder. I need this. Unnnnnnnh, I'm about to blow. Just one more troll post. DO IT.

Name: Anonymous 2011-02-04 11:45

Name: Anonymous 2011-02-18 13:04

that's cool and all, but check 'em

Don't change these.
Name: Email:
Entire Thread Thread List