0

Welcome!
Then prepare a good piece of code, post it to the relevant sub-forum (as a code-snippet), and post a link to that code snippet on this thread (to make it "official").

0

Does everything have to be in one file and in one language? For example, what about, say, a C++ program that uses a class connecting to a Java program for the GUI. That's a main.cpp file, a .h class file, a .cpp class file, and the Java file, so that's at least four. Add a Makefile and a README and perhaps a text file for the programs to read from and you're up to seven (although, think about it, it's ONE zip file ;)). It could easily get out of hand, of course, but think about it. When was the last time you coded anything cool all in one file?

0

Does everything have to be in one file and in one language?

In my opinion, it should just be in one language, unless the other-language-code is a very common external library. But, it's Dani's call.

And it can certainly be in multiple files, but I would try to keep it within reason.

When was the last time you coded anything cool all in one file?

Well, one of the coolest piece of C++ code is the ScopeGuard, and it fits in about 30 lines of code.

0

my program would not fit in one snippet. it's an entire package. I guess I am disqualified. maybe I should submit it to sourceforge? I am considering that...

0

We are looking for single-feature snippets, not entire programs that consist of multiple files. They will remain in our code snippet library :)

1

The way I see it, every programmer has a bag of tricks that they use. To me, the point of the contest is to show off one such trick that you think is clever and/or useful. It can be a nice language-technical trick (e.g., doing something that people don't suspect can be done), a nice algorithmic trick (e.g., a clever tail-recursion, or something), or a very useful little tool (e.g., a kind of smart-pointer). When you program a library or large application, most of the code is boringly ordinary, but once in a while you come up with a very neat solution to a particular problem / application. The idea is to take one such trick (or come up with one) and formulate it in a self-contained snippet (like the class that implements the solution, and a basic program that demonstrates it use / purpose). Then, it will be part of the code-snippet library, and people that read it might think its just cool or a very nice way to solve a type of problem.

0

Going on what mike said, to make it official, I wrote a snippet in Java for dynamic class loading from XML files, to be found here: Click Here Curious what you think of it :)

1

The subject of the snippet is of your choosing, the programming language is of your choosing.
The only question for the contest is: Are you up for it?

Votes + Comments
;)
0

i guess its time to showcase what everyone has got . . . As my saying always goes "Let the codes do the talking"

0

It's the button to "Contribute a New Article to this Forum". It appears just above the thread list. Once you get to writing the "article", you can select "Code Snippet" as the type of article (as opposed to "Discussion Thread").

0

Without specifying what does 'most creative functionality', 'most elegant code' and 'most efficient algorithms' mean this contest is out of subject.

RE: 'most creative functionality' ... is it:
- creative uses of math functions
- new software utility for users
- improving the qualification and the productivity of the users ... or what

RE: 'most elegant code' .. is it:
- created with class & style
- what are the criteria to eveluate the code as being elegant or not, and how 'most' is applied to this
- if a code is clean, simple and easy to understand ... on paper, and 'tragedy in three acts' on a computer ... is it still elegant

RE: 'most efficient algorithm'
- where is the metrics to measure this efficiency - speed/running time; 'space' memory used in its operation; performance per watt/total energy used ... or something else

... and BTW what is the hardware platform.
If a code runs on i7 without problems ... and 'not igniting' on a Laptop Celeron, what are we doing.

RE: I don't dare to ask where is the Task
If the task was one and the same to all competitors (like for example 'how to land the financial system back on Earth') the code might be compared more easily.

0

Here is a program that I have written over 500 times. This is a far better starter program than any old "hello World" example. A practical program that can be easily extended in any language.

I have done over 50 cable and telephone billing system conversions. This program does a dump of the text data they sent. I.e. customer records and billing info etc.

http://www.telusplanet.net/public/stonedan/bestest2-1.JPG Screen capture of the program
http://www.telusplanet.net/public/stonedan/bestest2-2.JPG Screen with DATA and descriptions

http://www.telusplanet.net/public/stonedan/bestest2.txt The source code in VB
http://www.telusplanet.net/public/stonedan/bestest2input.txt The input file for the program
http://www.telusplanet.net/public/stonedan/bestest2.exe The executable program
http://www.telusplanet.net/public/stonedan/bestest2-1.bmp The required bitmap for the descriptions

How simple it would be to create an update version of these dump programs. Pretty soon you have a telephone or cable billing system.

0

The code you submit must be self-contained and submitted directly to our code library.

0

If I post a code snippet to DaniWeb, what ownership of the content do I retain and what do you obtain? As well, can I license code for usage with something like zlib?

I have a number of snippets from libraries I've written, but I remeber reading somewhere that all content on DW is copyright DW, and I assume that would inheritably be submitted content as well. That's why I rarely post snippets.

0

RE: 'most creative functionality' ... is it:
- creative uses of math functions
- new software utility for users
- improving the qualification and the productivity of the users ... or what

RE: 'most elegant code' .. is it:
- created with class & style
- what are the criteria to eveluate the code as being elegant or not, and how 'most' is applied to this
- if a code is clean, simple and easy to understand ... on paper, and 'tragedy in three acts' on a computer ... is it still elegant

RE: 'most efficient algorithm'
- where is the metrics to measure this efficiency - speed/running time; 'space' memory used in its operation; performance per watt/total energy used ... or something else

... and BTW what is the hardware platform.
If a code runs on i7 without problems ... and 'not igniting' on a Laptop Celeron, what are we doing.

RE: I don't dare to ask where is the Task
If the task was one and the same to all competitors (like for example 'how to land the financial system back on Earth') the code might be compared more easily.

Let's see...
1 most creative
2 most elegant
3 most efficient

Empirically, these three notions are interchangable...
all are interdependant, but the third one is somehow the master of them all.

You can't write an efficient code without it being elegant, nor can it be elegant, without being a creative one.
An efficiently written code will appeal as elegant; seeing an efficient and elegant piece of code (we haven't seen before) results in impression of creativity. And is creative for a fact.

The task: it should be productive, it must yield the biggest "bang for the buck", and it cannot achieve that without being 1. the most creative; 2. the most elegant and 3. the most efficient piece of code.

So,
finally my personal question is: where can I see/review snippets that are being posted for this contest?

Edited by Troy III

0

I would like to suggest to create a seperate sub-forum specifically for this purpose. Thus it will be more maintainable and easier to look through different snippets from different language. It also avoids that popularity advantage. This event needs to be so more formal. I really don't know what to expect and what's considered elegant/efficient. I mean one could make a case for why this or that is elegant/efficient but who says that people will geniunely understand that. I think we should have a topic to program against. Or a problem to solve. That way comparing elegant and efficiency and whatnot would become easier. Otherwise, it might become a popularity game or in essence comprimise the integrity of this event.

0

easier to look through different snippets from different language.

You can go into Software Dev, Web Dev, or any individual forum or subforum that is programming related, and click the Code Snippets tab to see code just in that language.

We plan on doing lots more contests in the future ... we're just getting our feet wet and we'll learn what works and what doesn't as we go along! :)

0

We plan on doing lots more contests in the future ... we're just getting our feet wet and we'll learn what works and what doesn't as we go along! :)

Well, I hope next time we can just have a programming contest and submit a fully working application and not just a code. :D

0

That's pretty hardcore Mike...

I just read through the description and thought WTF brain overload, this is something narue probably codes all the time...

Interesting contest nonetheless. With such a massive spectrum of possibilities it's going to be hard to judge. I wouldn't want to anyway.

Good luck to all those entering.

0

it's going to be hard to judge. I wouldn't want to anyway

Oh, but that's the beauty of it: you can judge it, along with every and any other member of the DaniWeb community.

Edited by happygeek: formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.