Hey everyone,

We haven't done a good contest here on DaniWeb for quite some time, so I'd like to start one up again :)

Throughout the months of June and July, I'd like to encourage members to submit fully working code snippets to our library.

Throughout the month of August, we're going to vote on the best snippets fitting the criteria of most creative functionality, most elegant code and most efficient algorithm. The three winners will each receive Amazon gift certificates up to $250.

More details to follow shortly :)

Happy coding!

Everybody can take part? And what is the topic? And which language should it be done in (Java, C++, C etc) ?

No restrictions ... the only requirement is that the code be fully working and bug-free.

At the beginning of August, members will have the opportunity to vote on all code snippets submitted throughout the months of June and July.

Any topic? AWESOME!!!!!

The official annoucnement, including the rules and the submission deadlines:

Enter the first DaniWeb Code Snippet Contest

...
Can you code? Of course you can, this is DaniWeb after all. The question is how good can you code? Are you the best coder in the DaniWeb community? Now is your chance to find out by entering the first DaniWeb Code Snippet Contest!

It's really easy to take part, all we ask is that all code is fully-working and bug-free: code which does not work, or which is buggy, will be disqualified. All entries must be properly submitted as a code snippet using the article editor, code posted as a normal discussion thread will be disqualified.

The competition is open to anyone who is a registered member of DaniWeb, that includes newbies and old hands, regular forum contributors and lurkers, even moderators and admins. Anyone who can code is encouraged to show us what you are capable of. What's more, there are some great prizes to be won, including:

$250 amazon.com gift card for the most efficiently written code

$150 amazon.com gift card for the most creative functionality

$100 amazon.com gift card for the most elegant code

In addition, the winners and runners-up in all categories will be awarded some much deserved positive rep points!

The contest starts now, so get coding! You can submit code snippets in any language as long as they are fully working and bug free. Submissions will be accepted until midnight (EST) on Tuesday July 31st, 2012.

To submit a code snippet, simply head to the appropriate programming forum for the language your snippet is coded in. Click on the big yellow 'Contribute New Article to this Forum' button, and when the article editor appears select 'Code Snippet' from the 'Type of Article' drop down menu.

Member voting will commence on Wednesday August 1st, and end at midnight (EST) on Wednesday August 15th with the winners being announced the following day.

Good luck people, and remember this competition is open to everyone. The winners will be determined by the votes of the community itself; the wisdom of DaniWeb crowds will prevail rather than the opinions of one or two members alone. This is a great chance to show everyone what you have got, forget the prize money this is all about kudos: will you be crowned the best coder on DaniWeb?

Any restrictions on length since it's being called a snippet? One function, one class, one assembly, anything like that?

No ... but most efficiently written code cannot simply be hello world to garnish enough votes to win :)

Darn it, that's me out then :)

Careful! The relevant threads in the Software Development and Web Development forum categories are not sticky!

Or at least that's what I see...

not_sticky

Top level forums don't display stickyness, as a general rule.

Plus, Davey, double posting is a rule for a reason. It can seriously hurt our SEO. Plus, I don't want to have to keep up with multiple threads when people are asking questions about the contest. Just sayin' ;) ;)

^ Sorry for being cranky. Bad mood :(

Soz Dani, didn't realise that the top level forums don't get sticky. The questions across threads point was dealt with by

If you have any questions, please ask them in the Geeks' Lounge Code Snippet Contest thread here.

I posted them in the developer forums (now deleted) as that is where most people who are most likely to want to enter are going to see the announcement, surely? I'm not sure how many will see this thread here in the lounge.

Maybe the mods who deal with specific coding forums could post something, in their own words so as to avoid the SEO penalty, in those specific langage forums which inform members that a coding competition is underway and point them in the direction of this thread?

There will be an announcement in the DaniWeb Digest newsletter as well, of course, and I'm about to post something on my Facebook page.

For visibility, I added a link to this thread in my signature.

Maybe the mods who deal with specific coding forums could post something, in their own words so as to avoid the SEO penalty, in those specific langage forums which inform members that a coding competition is underway and point them in the direction of this thread?

How about a link back to this thread, as to avoid having to keep up with multiple threads about the same thing?

...and point them in the direction of this thread

How about a link back to this thread, as to avoid having to keep up with multiple threads about the same thing?

Same thing, surely? :)

Hmmnnn . . .

No restrictions as to whether the code is old or new?

Looks like an opportunity to dig up some old code and share it. It is well-tested and I know it works, but it is pretty specialized, so might not have broad appeal. (Can you guess what kinds of programs I write? See my sig for a hint.)

Are those gift certificates valid on amazon.ca? (Are you willing to barter? I'd go for an AdWords credit or something similar: Facebook PPC credits, etc.)

No restrictions as to whether the code is old or new?

As long as it's new to DaniWeb. :)

Looks like an opportunity to dig up some old code and share it. It is well-tested and I know it works, but it is pretty specialized, so might not have broad appeal.

As long as you have the authority to contribute it, and it can't be found elsewhere on the web (violating one of our site rules) ... Hey, it might win for most creative functionality!

Are those gift certificates valid on amazon.ca? (Are you willing to barter? I'd go for an AdWords credit or something similar: Facebook PPC credits, etc.)

As long as there is a gift certificate program available :)

Do not take me wrong, but I'm sort of dubious about voting for best snippet from less visited forum sections. For example I can do some snipped for Android, but how can I rich wide daniweb audience if only handfull people check Mobile Development section, and even less of them may be skilled with Android to understand what my code snippet is about.

I can see your point to the extent of that code snippets submitted to the more popular languages here will probably have an easier time getting votes. I think that's just the nature of the game, though.

Or should we implement something with Python, C, C#, VB and Java, but then the snippets would get separate votes, not total of all versions.... Of course I would need still to learn C# (and improve Java/C/VB)...

To help with the problem of getting votes on less visited forums, I would suggest that, at least, all snippets should have a link posted on this thread, and ask that moderators try to take the time to check out each submission, even if it is in a foreign programming language (as in, not the mod's preferred language). I don't know about you, but I can appreciate a nice piece of code regardless of the programming language (as long as I understand it, which I do for most languages). But beyond that, as Dani said, it's part of the game, if you choose a narrow language to code a piece of code with a narrow application area, then you can't expect as much of a wide-spread appreciation of it.

Also, I'm starting to think of ideas and I'd like to get a feel for the expected extent of the snippet. So here are two ideas I have, tell me if they are too much or too little.
(1) A logging system for exceptions in C++, with some predefined logging and handling behaviors. With configurable sinks, strong safety guarantees, and so on.
(2) An adjacency-list graph overlaid on a breadth-first tree layout to allow for efficient, cache-aware (or cache-oblivious) binary-search tree implementations over nodes of a general graph (adj-list).

The first is pretty simple (~200 lines or so). The second is pretty hefty (~1000 lines or so) with loads of advanced C++ techniques. So, are code snippets expected to be closer to the former or the latter? Or am I completely crazy?

So, are code snippets expected to be closer to the former or the latter? Or am I completely crazy?

I don't think we're "expecting" one way or another, as long as the code snippet is, indeed, a self-contained snippet.

My mind is churning with regards to potential other awards we can give for snippets such as most useful ;)

I do not know, but maybe there should be encouraged to be considerable discussion in Code Snippets posted this summer commenting the strong points and interesting features of snippets as well as any blemishes. This could be used as less knowledgable members to gain insight of language they do not use and give them possibility to evaluate second hand through other's comments the snippets outside of their comfort zone.

I think in Python terms the upper limit of Code Snippet to be around 200-300 LOC. Main thing for me is that other members can crasp the whole code in their mind. Writing with more verbose/lower level languages could mean narrowing the scope of snippet. One possibility would be modular design with simple short basic implementation for some parts. Then you could present gradually improvements to those implementations. That would also make very interesting and relevant reading. Or you could have program with only basic functionality implemented and clear road for impovents. Even you could leave some obvious point unimplemented and point it out to encourage the readers to expand on your post. This my snippet could be example of this kind of left in middle, "open ended", (even at start) post: http://www.daniweb.com/software-development/python/code/403873/text-based-english-solitaire-from-wikipedia

This said I have posted many very short 'trick' or example of technique style of posts as code snippets, including one liners http://www.daniweb.com/software-development/python/code/382803/one-line-vigener-single-decryptencrypt-function-with-generator

I do not know how about people feel about these snippets, however. Have to get inspiration to post something, so I can find out through this competition. I have though shared so many ideas as I have posted until moment of writing this post 94 snippets, so I have not anything up in my sleeve waiting. At least when somebody starts to post some snippet and I get to think "I can do this much better in Python", I should have some inspiration.

To help with the problem of getting votes on less visited forums, I would suggest that, at least, all snippets should have a link posted on this thread, and ask that moderators try to take the time to check out each submission, even if it is in a foreign programming language (as in, not the mod's preferred language).

I agree with this. I was worried about that problem too. I'm in the process of writing something that will help me automate as much of my work as possible and I'm considering submitting a (self-contained) part of it to the competition. I'm using haskell for this, as functional languages are better suited for writing programs like the one I write (I heavily (ab)use pattern matching). I found a way, though, to write the part I want to submit in c++ (yes, there is native support for (even nested) pattern mathing in c++ (those of you who understand what I mean, please don't tell the others what I'm talking about)), and that's what I'll be submitting. But even if this solves the problem for me, others might not have such an option, so, once again, I agree with mike's suggestion.

I have a couple of questions too:

-> Are we allowed to use freely available 3rd party libraries?
-> Are we allowed to submit more than one code snippets?

My policies of these things considered 'cheating' during studying:

  1. I consider using all possible libraries a plus when considering the efficiency of the snippet.
  2. Are you allowed more than one post to Daniweb? (hint: check my post count) ;) The purpose is not to stop me reaching 100 posted code snippets, I hope.

Another point is the disqualification points, few possible cases, would these be disqualified?

  1. poster posts code as discussion thread asking feed back, does some suggestions and own improvements and posts it result as code snippet.
  2. Poster posts a code snippet and posts a bug fix after one hour as reply
  3. Same as 2 but he is moderator and he edits the original post
  4. After post as colde snippet somebody notices missing newline in output in some corner cases.

poster posts code as discussion thread asking feed back, does some suggestions and own improvements and posts it result as code snippet.

No, it wouldn't be disqualified if they received help from the community on their code and, ultimately, decided to submit the final piece as a code snippet.

Poster posts a code snippet and posts a bug fix after one hour as reply

No, this wouldn't be disqualified. If anything, it's encouraged that members want to continually improve code they contribute to our code snippet library even after posting it. It can only help future DaniWeb members looking for the code!

After post as colde snippet somebody notices missing newline in output in some corner cases.

It would be up to the discretion of members whether they want to vote on a code snippet that has small bugs for corner cases and edge cases.

Members can submit as many code snippets as they like. Only code that was contributed during the months of June and July, and unique to DaniWeb, would qualify.

Hi,

I'm confused what you mean. I'd like to think that people want to ensure that any code submitted to our code snippet library is pretty much bug-free regardless of whether there is a contest or not, and that if a bug is discovered, it will be fixed regardless of whether it's June or August or October.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.