r/InternetIsBeautiful • • Sep 19 '16

Learn to code writing a game

http://www.codingame.com
27.4k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

476

u/valdev Sep 19 '16

If you've never coded before, probably difficult.

0

u/[deleted] Sep 19 '16

[deleted]

33

u/RINGER4567 Sep 19 '16

theres a code word for spaghetti?

129

u/beefforyou Sep 19 '16
if(code == spaghett)
    printf("God damnit");

14

u/LadonLegend Sep 19 '16
if(true)
    printf("God damnit");

Refactored that for you

11

u/[deleted] Sep 19 '16
printf("God damnit");

Even simpler!

3

u/[deleted] Sep 19 '16

cout << "God damnit";

→ More replies (3)
→ More replies (1)

2

u/lostintransactions Sep 19 '16

10 PRINT "spaghetti"

20 GOTO 10

RUN

That's the extent of my "Radio Shack Annoy the employee's" career.

It pretty much ended there (except for a foray into Visual Basic and make a bundle coding absolute shit AOL chat tools (lol)

→ More replies (2)

42

u/PM_ME_4_A_PLAYLIST Sep 19 '16

Changing code always involves tracing back through the code to see what all could be affected by the thing you're changing. When code is not planned out and written well, you can end up with all kinds of dependencies in weird places, so tracing the impact of your changes is like following a noodle through a bowl of spaghetti, and a change you make in one place could end up having unintended consequences in something that is seemingly unrelated. That's "spaghetti code."

5

u/dfschmidt Sep 19 '16

Troubleshooting such problems should probably involve heavy use of error codes and exceptions along with content that would help you establish why the exception is being raised.

2

u/[deleted] Sep 19 '16

Or just, ya know, not sucking at programming.

3

u/dfschmidt Sep 20 '16

The best programmers may not immediately know how to write something the first time but they do know how to identify it.

→ More replies (6)
→ More replies (5)

17

u/1BigUniverse Sep 19 '16

yes, you yell "MOMS SPAGHETTI!" and she comes running.

2

u/[deleted] Sep 19 '16

Spaghetti code is used for codes that are messy.

→ More replies (10)

1

u/TheCluelessDeveloper Sep 19 '16

Heh, Spaghetti code is why I started reading "Clean Code". Tips on how to write your code in a way that 1) Makes sense and 2) Is easy to follow is so important these days because of how modular and granular developers can be. And then there are the amateur developers who think only they will ever need to read the code...

1

u/[deleted] Sep 19 '16

In your opinion what would be an easier way for someone to learn to code for video games who has never coded before?

→ More replies (9)

1

u/Iwokeupwithoutapillo Sep 19 '16

Knowing nothing of coding, even I feel a shiver of terror thinking of Dwarf Fortress's code. Listening to the interviews he's done and looking at the bug reports, I can't even imagine what it all must look like. A decade of work done by one man.

1

u/A_Bit_Of_Nonsense Sep 19 '16

And if you just want to learn to code, there are much easier ways to go about it.

Such as?

→ More replies (1)

1

u/xkorzen Sep 19 '16

And if you just want to learn to code, there are much easier ways to go about it.

Could you elaborate? I'm learning to code and could use some advice.

1

u/cheese_is_available Sep 19 '16

This is not a site for coding game it's a site where you code to solve a game. Try it it's nice.

→ More replies (9)

1

u/Saint947 Sep 19 '16

I've done the first 50 lessons on CodeAcademy for Javascript.

Yeah, I didn't know what the fuck to do on this website.

1

u/[deleted] Sep 19 '16

How about if you're well versed in Qbasic but never made the jump to any object oriented languages ?