Design Patterns in Mozilla Contest
Heikki Toivonen writes " The "Design Patterns in Mozilla" contest is now underway. The goal is to find and document as many design patterns as possible in the Mozilla source, with the chance to win an autographed copy of "Design Patterns: Elements of Reusable Object-Oriented Software" by Gamma et. al. and gift certificates to Amazon.com. Visit the contest rules page to learn about the details, regarding the two phases of the contest, the submission rules, the source you need to use, and the prizes. "
About design patterns. Read the GoF book by all means, it's a classic, and it provides a new level of vocab for talking about software design...
BUT:
it's kinda boring - especially if you have enough experience for the patterns to be familiar.
Worse, it encourages people to think of software design as a kind of mix and match mechanical process. That is, I believe people should focus on coming up with elegent solutions for their particular problem, and if at the end they say - oh I've used a singleton here and a factory there... then great. The problem arises when people start thinking, well i've got a design
problem here - what category of pattern fits best ? Er, lets see, well I think I should use a "composite object" here, now what group of classes are used to implement that...
Next thing you know someone has churned out a whole shitload of classes, with only the vaguest notion of what they are for, AND THAT'S THE DESIGNER, but with a preposterous belief that he has a good design because he "followed the rules of OO design". And don't even get me started on that Rational Rose/UML crap.
Don't get me wrong. I believe understanding patterns is a good thing. But, it's often used as one more straw to clutch for people who don't really know what they're doing. Like every other technique in software - someone smart creates
something to make life easier, but quite a few people will then take that and use it as an excuse to think less.
Software has gone through this process frequently (assemblers, compilers, procedural software, OO, patterns) at each stage the bar is lowered you make it possible for idiots to create more complex software. It's dangerous. This is why many people prefer C to C++ (not me). Show some piece of MFC based crap to an experienced C programmer and they will recoil in horror, I don't blame them. The more powerful the tools, the bigger piece of vaguely working rubbish an idiot come up with. There is no antidote to sloppy thinking.
Powerful tools make life easier, but paradoxically
require more, not less experience to use well. Having seen what utter crap can be produced when lousy programmers get their hands on OO languages, I shudder to think what monstrosities will be around in a few years time as a result of patterns.
Basically, I'm saying anyone who designs/writes OO software should be aware of patterns, (and UML etc), but then ignore them and concentrate on the actual specific problem. If you're good you will find your own patterns.
To summarise: if you let children play with power tools, you end up with a big fucking mess.
http://rareformnewmedia.com/
Should be 2 competitions, the other to find the Anti-Patterns in the project too.
Projects are improved by a bit of push-me pull-you, too much self-congratulation makes you go blind.
I spent a lot of money on booze, birds and fast cars. The rest I just squandered. - George Best
Alas, no one ever wants to read someone else's code because it's not up to their own high standards. Yes, my boy, we live in a world with different multiple high standards.
Same sentiments with double strength when it comes to
- documenting
- testing
- debugging
- maintaining
some else's code.Anyway, I suggest an escalation of the contest from a mere editorial review (kind of like looking for gemstones in the barn). Some of those reviewers are damn good coders in their own right! Give them extra credit for submissions of design patterns patches (judged according to how much they show elegence, less lines of code, more extensible, less memory, fewer bugs in future) that could usefully be employed where they are not at present!
Deciding on appropriate prizes is difficult. I haven't seen the Netscape cheerleaders on TV lately, so a group photo with the celebs is probably out of the question. However, I'd say some recognition and acknowledgement is due those who contribute to Mozilla the most. A little semi-official defacement of the Netscape portal to include a Top Tech News Story headline like "Studly Programmers Tire of Success" might be in order.
"Provided by the management for your protection."
Man! Wouldn't I love to use patterns named Fist of the Firemonkey, etc. That should would liven up meetings and code reviews...
"As you can see here, I'm using the FISTOFTHEFIREMONKEY pattern...this pattern integrates well with the previous FLAMINGLIZARDBREATH and OMIGODTHESEAMONKEYSAREHATCHING patterns."
It's 10 PM. Do you know if you're un-American?
Lets all step back 50 feet and see what is happening at /. the great Open Source/Free Software forum.
We gets endless complaints about stuff not being open source, not being free, companies that gets patents on software, proprietary (sp?) software, etc. (Crowd screams) "Give me the source, I need the source code".
Netscape sucks, it crashes, Mozilla will never be out, M$ has won the browser war, blah blah blah.. (Crowd Sreams)"I want a standards complant browser that is better than IE"
I could go on but I won't, i assume you get the point. This is an opportunity to get into the source that everbody must have according to the posts before. Ya it might be dirty work, coding is not glamourous it is work and sometime it is tedious. So instead of being a bunch of hypocryts (sp?) either SHUT UP about wanting stuff to be open source, or take the advantage of an opportunity to further a software project that can make a difference.
Come on people, decide which side of the fence you sit on. You want the source so you can help, OR you can't be bothered to actually help nor do you plan on it.
When you write a line of code for teh kernal you are doing someone work.. When you write a line of code for apache you are doing someones work.. When you help with Mozilla youare doing someones work..
-7021
Okay, I don't get it. Loki had a contest where you get to see the code to Civ and muck around with it. People complained that it was the corporation trying to screw us because they were going to take our work for free. So what? If I could have afforded to the trip to Atlanta, I would have done it, because it was geeky and fun. I could have cared less if they provided a prize.
... (1) no one is forcing you to take part (2) it is a learning experience (3) it is bragging rights and (4) you get a neat prize.
Now Mozilla is saying, look through the code and see how many design patterns you can come up with. That sounds neat. Yeah, they benefit from it, so what? Of course, we get the same outrage.
Here's my take on both
If I can find some time, I'll do it.
-Seth
Is it just me or does the prize seem a bit redundant? If you already have the ability to find all the design patterns in source code, do you really need a copy of a book on design patterns? This is almost like setting up a "crack-me" server and giving away copies of "Network Security for Dummies" to the people who manage to hack it...
---- I made the Kessel Run in under 11 parsecs.
I think it's interesting to note though, that there are a lot of very complex open source (free or otherwise) out there that are getting a lot more devloper support. The Linux kernel obviously springs to mind. So does Apache. So why aren't people complaining about the complexity of these projects?
Anyway, on the competition page, they say patterns are a new thing. I though the idea had been around for ages.
-Mike
-- "So, what's the deal with Auntie Gerschwitz et all?"
I'd say you're right about the GoF pattern book not being much incentive for folks who would be the best contributors to their documentation project. I was hoping that if you found an interesting new pattern, the Mozilla folks would let you name it (at least as far as their documentation went). But the rules state that only patterns from the book are acceptable.
That's too bad. I'd bet some heavy coin that the exceptional kind of pattern hunters who won't be tempted by Design Patterns would be exceptionally tempted by the possibility of finding a new pattern and then naming it something like Fist of the Firemonkey.
Yes, too bad.
Cheers,
Tom
Easy, automatic testing for Perl.
However, I quite like the idea behind this. It sounds like a wonderfully geek contest! I don't recall seeing other contests which relied on technical capabilities (if you exclude cracking contests), and I'm wondering if it's possible to design a contest which is not someone else's work, and relies on ingenuosity and technical skill.
Say, perhaps, useless things like programming a specific program under a certain amount of memory, or somesuch...
"There is no surer way to ruin a good discussion than to contaminate it with the facts."
Theres a whole lot of code to look at in there, just to win a little book.
*sticks tongue in cheek*
Just be sure to run it all thru a code beautifier first.
Then: cat source and watch the pretty patterns scroll by...
What? Whad'ya mean design patterns? It's open source fer chrissakes! You think it's designed ???
-- What you do today will cost you a day of your life.
Alexander suggests that the designs you produce should be whole and harmonious and appropriate, and they should fit in their environment. So it seems ironic to me that advocates of such a wholistic ideal should tempt people with a reward that people find so irritating. This indicates that something is wrong with the design of the contest.
We just have to keep those two separate. Working on both projects at once could be catastrophic.
-- What you do today will cost you a day of your life.
Check this out. It's a programming contest archive. If anyone has similar pages, post the url.
Though the GOF Design Patterns book is relatively comprehensive, it was never intended to be an exhaustive list of all the patterns in existence, just a tour of some of the best ones. (see the Preface)
Is it the right thing to to do base the contest on how many *GOF* patterns can be found?
My Karma: ran over your Dogma
StrawberryFrog
As others have pointed out, there are a few things wrong with that contest; first, the fact it sounds as if you're doing someone else's work for cheap
So? There's a name for it, it's called "contributing".
Second, the fact that if you can win this contest, well, you don't need the damn book anyway.
Are you sure? I don't know about you, but no matter how good I get at something, there's always someone better, and someone who can tell me something I don't know. Or suppose I'm the one person in the world to whom this doesn't apply - I can always give the book to my kid brother, or keep it as a trophy.
The bottom line is, I want to be able to build and rebuild Mozilla, a little piece at a time, on my laptop, and I don't really care what process is used to accomplish that. The logical next step, after finding the patterns, is to implement them in a way that reduces the size of the source and the binary by some large factore. Keep going guys, this sounds terrific.
Life's a bitch but somebody's gotta do it.
Maybe I just don't have as much of an idea of what patterns are for as I thought, but...
Aren't you suppose to have the patterns in mind before you write the code? Going back through already "completed" source code and saying "Oh, look I think that's using a design pattern" seems a tad silly to me.
It's kinda like writing the requirements after the system is done (this often happens to be the way things end up for me, but, hey I'm not proud of it).