The great GD.net collaborative coding horror experiment? (...and the results are in!)

Started by
64 comments, last by Ganoosh 10 years, 4 months ago

What is going to be interesting: Seeing how the advanced and the beginning type programmers work in the same exact file. We are bound to see some crazy obscure looking C++ code followed by some C++ code that seems to be written by a beginner.

And knowing me I bet I will think I can follow that obscure code and end up writing something that breaks that obscure code and ends up breaking a lot of things in the project. sad.png

Advertisement


What is going to be interesting: Seeing how the advanced and the beginning type programmers work in the same exact file. We are bound to see some crazy obscure looking C++ code followed by some C++ code that seems to be written by a beginner.

So just like production code in a AAA studio then :p

Here are the slightly revised "rules" - note that they are self enforced. Please abide by the spirit of the experiment.
  • There are two experiments, one in C++ and one in HTML 5
  • Each experiment will have a thread, to be created by me, which will be populated with a minimal, terrible program
  • Each experiment will have a separate but related theme. Strive to make a playable, or even fun, game!
  • The threads will act as a kind of revision control system, each post containing code is a commit
  • You must attempt to amend the current version of the code
  • If, having posted, you find someone has committed something new, please immediately edit your post to remove the code (to avoid confusion)
  • Posts must include the full source of the program so far, but please highlight what was changed
  • The program will be in a single file only
  • Dependencies are limited to the standard library and the multimedia library only
  • Assets can be procedurally generated, or inlined into the source file, do not refer to external assets
    • For C++, the GIMP has the ability to export images into C source
    • For HTML 5, you can use a data URI
  • Remember, any assets and source code must be free of copyright restrictions
  • You can only add new code, do not remove existing code
    You may alter existing code, but please be conservative. Here are some examples:
    • Changing numeric or string constants
    • Adding a new clause to a condition
    • Adding to an existing expression
    • Adding parameters to existing function declaration/definition/call sites
    • Adding a comment at the start of a line is allowed by this rule, but please minimise such use
    • You may also "insert" a newline after a single line comment (thus uncommenting such code)
  • The code must compile on your platform of choice, and should strive to be cross platform
    • A simple example in C++ is assuming that certain types have or share a particular size
    • Do not make OS or Browser specific calls
  • Your code must not crash (to the best of your ability)
  • Bad commits are ignorable under the "amend the current version" rule. Please clearly state if this step is taken
  • For the sake of the experiment, please:
    • Try keep each commit relatively small and cohesive - for example add or change a single feature at most
    • Avoid committing twice in a row (if the thread is quiet, feel free to ignore this one)
  • Have fun everyone!

I've made a repo (totally unofficial) which I'll use to track the history of the two programs. I plan on making two branches, "c++" and "web", where the two programs will be separately tracked. If you have any feedback/questions about the repo, please just let me know (either via thread or PM).

I'm excited for this!

[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

Sorry for the double post, but I want to point out that in the commit history, I plan on deleting all trailing whitespace and converting tabs to spaces. If you have objections, speak now.

As for rules... rip-off, do you care if indentation changes between commits? My editor automatically changes tabs to spaces for me and deletes trailing white space. If you don't want indentation to change at all (and to create a mix of tabs and spaces), I can change my editor, but I want to know before I make any changes to the code.

[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]


I've made a repo (totally unofficial) which I'll use to track the history of the two programs.

Great stuff!


As for rules... rip-off, do you care if indentation changes between commits?

Good point, I didn't think of that. No, I don't mind particularly. It will be interesting to see if the community follows the established coding standard or does it become a riot of styles.

why is


while(running)  

replaced with


void loop() {
...
if(running) { loop() } 

}

shouldn't that cause a Stack Overflow?

why is

while(running)  
replaced with
void loop() {
...
if(running) { loop() } 

}
shouldn't that cause a Stack Overflow?


tail-recursion, since the function doesn't return meaningful data, the compiler effectively turns it back into a loop.

edit: note that with no optimizations on, the compiler won't do this, and you'll get a overflow crash.
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.


edit: note that with no optimizations on, the compiler won't do this, and you'll get a overflow crash.

Note that I spent a good 20 minutes with optimisations disabled trying to get a stack overflow out of this, and ultimately failed.

That said, the stack frame just isn't very large at this point. It might take quite a while to actually reach the 8 MB stack limit.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

edit: note that with no optimizations on, the compiler won't do this, and you'll get a overflow crash.

Note that I spent a good 20 minutes with optimisations disabled trying to get a stack overflow out of this, and ultimately failed.


really? what compiler are you using? i got it very quickly when i ran your commit. I think the current crash is related to the spawnTicks variable, and the tail recursion, trying to figure it out now.
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

This topic is closed to new replies.

Advertisement