In terms of lines of code, what is the longest program you have ever wrote? My longest program was Project Raft standing at a tiny tiny 1900 line of code. I plan on blowing that away though because Zombie Nauts is already to 1702 lines of code and im about 5% done with that game. So, what is the longest program you have ever written?

Not sure, somewhere in the 50k-100k range. The code tends to be more expressive the longer you've programmed though, meaning the LOC to feature ratio decreases significantly. I remember back when I was somewhat fresh at programming - I could easily spew out 2-3k LOC per day; I rarely write more than 500-700 on a good day now, yet I manage to implement a lot more functionality in that same timeframe nowadays.

In the end, LOC isn't really a useful metric of anything - even if some backward companies encourage such nonsense.

The code tends to be more expressive the longer you've programmed though, meaning the LOC to feature ratio decreases significantly.

I disagree. The more you've already programmed the more utilities and abstraction you (should) have, meaning that with a good design you should be able to reuse bits and pieces of your code leading to a higher feature/LOC ratio.

Edit: Just to answer the topic - around 2000 LOC, which was (obviously ) a game engine. Dang, I have to stop making engines and start producing some games now.

but kinda like junkdog said, lines of code really are only a hint at complexity, but really someone could have a 5k lines program someone else can write in 500. Personally I feel my code is fairly fluff free. Although there's a few places where I could probably shave off a few lines.

Also coding style comes into play, for example I write all my one-liner getters and setters like this:

1 2 3

//Get total height and width of map in tiles.publicintgetMapWidth(){returnmap.getMapWidth();}publicintgetMapHeight(){returnmap.getMapHeight();}

where as someone could easily write them like this:

1 2 3 4 5 6 7 8

//Get total height and width of map in tiles.publicintgetMapWidth(){returnmap.getMapWidth(); }

That would make for a fun java game jam/contest. Instead of "under 4k", "in 48 hours", etc, we could have a "best game with less than 500 lines of code" contest. It would have to include external settings/config files so no one cheats and stuffs all the meat into a .properties file or something.

That would make for a fun java game jam/contest. Instead of "under 4k", "in 48 hours", etc, we could have a "best game with less than 500 lines of code" contest. [...]Could be a fun idea down the road.

That would make for a fun java game jam/contest. Instead of "under 4k", "in 48 hours", etc, we could have a "best game with less than 500 lines of code" contest. It would have to include external settings/config files so no one cheats and stuffs all the meat into a .properties file or something.

Could be a fun idea down the road.

This would work only if everyone used (or someone who verifies used) the same [eclipse] formatter settings. It could be done though.

That would make for a fun java game jam/contest. Instead of "under 4k", "in 48 hours", etc, we could have a "best game with less than 500 lines of code" contest. It would have to include external settings/config files so no one cheats and stuffs all the meat into a .properties file or something.

Could be a fun idea down the road.

This would work only if everyone used (or someone who verifies used) the same [eclipse] formatter settings. It could be done though.

A more interesting approach would be to only measure the opcode count: this way it wouldn't encourage excessively obfuscated code or discourage meaningful naming conventions.

That would make for a fun java game jam/contest. Instead of "under 4k", "in 48 hours", etc, we could have a "best game with less than 500 lines of code" contest. It would have to include external settings/config files so no one cheats and stuffs all the meat into a .properties file or something.

Could be a fun idea down the road.

This would work only if everyone used (or someone who verifies used) the same [eclipse] formatter settings. It could be done though.

How about simply a character limit like, idk, 100000 characters and then make all the coders review the coding style / beautifulness of the code and the game that has the nicest code wins? maybe?

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org