Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Longest program you have written?  (Read 2230 times)
0 Members and 1 Guest are viewing this topic.
Offline Jacob Pickens
« Posted 2014-06-16 16:25:19 »

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?
Offline junkdog
« Reply #1 - Posted 2014-06-16 17:03:46 »

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.

artemis-odb: bugfixing and performance optimized fork of artemis ECS
Offline Drenius
« Reply #2 - Posted 2014-06-16 17:16:21 »

I did never count and will not.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline PandaMoniumHUN

JGO Coder


Medals: 32
Exp: 3 years


White-bearded OGL wizard


« Reply #3 - Posted 2014-06-16 17:25:43 »

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. Smiley

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

My Blog | Jumpbutton Studio - INOP Programmer
Can't stress enough: Don't start game development until you haven't got the basics of programming down! Pointing
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 799
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #4 - Posted 2014-06-16 17:27:54 »

meaning the LOC to feature ratio decreases significantly.

I disagree ... leading to a higher feature/LOC ratio.

Decreasing LOC/feature == increasing feature/LOC Pointing

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline trollwarrior1
« Reply #5 - Posted 2014-06-16 17:30:21 »

Squaball might have been a little bit less than 10k.
Wilderness to home is over 10k probably.

Maybe I'm over counting a little.
Offline PandaMoniumHUN

JGO Coder


Medals: 32
Exp: 3 years


White-bearded OGL wizard


« Reply #6 - Posted 2014-06-16 17:31:03 »

Oops, you're right, my bad. Smiley

My Blog | Jumpbutton Studio - INOP Programmer
Can't stress enough: Don't start game development until you haven't got the basics of programming down! Pointing
Offline bogieman987
« Reply #7 - Posted 2014-06-16 18:18:06 »

How does one figure this out? Add up the line number of the last line in every class?
My current project is by far my biggest though.

Offline trollwarrior1
« Reply #8 - Posted 2014-06-16 18:21:29 »

There are some things called metrics or something like that. I installed one sometime ago.
Offline Roquen
« Reply #9 - Posted 2014-06-16 18:22:36 »

Bill gates: measuring code by number of lines is the same as measuring an airplane by weight.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Gibbo3771
« Reply #10 - Posted 2014-06-16 18:33:01 »

Heh, I got a little 2D space shooter that I work on every so often.

The Ship class is ridiculous, tons of fields and methods. Must be around 1500 lines just for that class. Not a whole lot but it is one, non-refactored class lol.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline AppleSauce
« Reply #11 - Posted 2014-06-16 18:47:23 »

 Shocked I thought I was cool with FlubberSpace being the biggest and only project I've ever made.(Only good one that is  Pointing). It has about 670.
Offline bogieman987
« Reply #12 - Posted 2014-06-16 19:01:41 »

Ok, so I installed Metrics.

It's telling me:
Total Lines of Code = 3190
Method Lines of Code = 1983

Does that mean almost 40% of the lines is fluff, just formatting and stuff?

Offline Rayvolution

JGO Kernel


Medals: 199
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #13 - Posted 2014-06-16 19:09:05 »

My largest project ever is my current, Retro-Pixel Castles.

Total lines of code as of today: 6,787

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.
  public int getMapWidth(){return map.getMapWidth();}
   public int getMapHeight(){return map.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.
  public int getMapWidth(){
      return map.getMapWidth();
   }

   public int getMapHeight(){
      return map.getMapHeight();
   }


or even (if they're C people who picked up this habit):
1  
2  
3  
4  
5  
6  
7  
8  
9  
   public int getMapWidth()
   {
      return map.getMapWidth();
   }

   public int getMapHeight()
   {
      return map.getMapHeight();
   }


So I think style can add/remove a lot of lines. Tongue


- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline kpars

JGO Wizard


Medals: 79
Projects: 4
Exp: 3 years


Extreme Typist.


« Reply #14 - Posted 2014-06-16 19:10:25 »

I'm more impressed by less lines of code.

Let's see some smaller numbers. Cheesy

- Jev

Offline Rayvolution

JGO Kernel


Medals: 199
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #15 - Posted 2014-06-16 19:12:33 »

I'm more impressed by less lines of code.

Let's see some smaller numbers. Cheesy

- Jev

1  
2  
3  
4  
5  
6  
7  
package rpc.launcher;
public class Launcher {

   public static void main() {
      System.out.println("ohai world!");
   }
}

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline kpars

JGO Wizard


Medals: 79
Projects: 4
Exp: 3 years


Extreme Typist.


« Reply #16 - Posted 2014-06-16 19:17:06 »

-snip-

public class Main{public static void main(String[] a){System.out.println("Hello World");}}


- Jev

Offline wessles

JGO Wizard


Medals: 66
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #17 - Posted 2014-06-16 19:19:55 »

MERCury is currently at around 10K LOC.

But these numbers don't mean too much. If anything, they loosely represent how long you have worked on this project.

-wes

Offline junkdog
« Reply #18 - Posted 2014-06-16 19:35:39 »

Let's see some smaller numbers. Cheesy

I recently stumbled upon this self-playing flappy bird clone in 155 lines, incl graphics: http://glsl.heroku.com/e#14407.0

artemis-odb: bugfixing and performance optimized fork of artemis ECS
Offline Rayvolution

JGO Kernel


Medals: 199
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #19 - Posted 2014-06-16 19:37:24 »

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.

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline Drenius
« Reply #20 - Posted 2014-06-16 19:41:52 »

Quote
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.

Quote
public class Main{public static void main(String[] a){System.out.println("Hello World");}}



Kinda pointless, isn't it ?...
Offline wessles

JGO Wizard


Medals: 66
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #21 - Posted 2014-06-16 19:44:41 »

They would make a really strict IDE cleanup configuration.

Then you could measure characters Smiley.

300K in MERCury! WooHoo!

Offline Agro
« Reply #22 - Posted 2014-06-16 20:09:26 »

I did never count and will not.

lrn2git brah

Online BurntPizza
« Reply #23 - Posted 2014-06-16 20:18:19 »

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.
Offline junkdog
« Reply #24 - Posted 2014-06-16 20:22:30 »

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.

artemis-odb: bugfixing and performance optimized fork of artemis ECS
Offline kpars

JGO Wizard


Medals: 79
Projects: 4
Exp: 3 years


Extreme Typist.


« Reply #25 - Posted 2014-06-16 20:22:52 »

300K in MERCury! WooHoo!

You shouldn't be proud of having 300k lines of code. If I were you I would be depressed.

- Jev

Offline matheus23

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Reply #26 - Posted 2014-06-16 20:23:30 »

Longest java code: RuinsOfRevenge (see signature)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
$ cloc .
     217 text files.
     183 unique files.                                          
    1750 files ignored.

http://cloc.sourceforge.net v 1.60  T=2.57 s (51.0 files/s, 6284.8 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Java                           111           1917           2809           9108
XML                             19             18              0           1980
Ant                              1             47             14            240
-------------------------------------------------------------------------------
SUM:                           131           1982           2823          11328
-------------------------------------------------------------------------------


My haskell programs tend to be much smaller, though. But I cannot compare so easily, because the kind of code I write in haskell is different from the code I write in java (mostly not about games).

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?

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Online BurntPizza
« Reply #27 - Posted 2014-06-16 20:26:21 »

You shouldn't be proud of having 300k lines of code. If I were you I would be depressed.
- Jev

He said it has 300K characters, above he said 10K LOC.

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?

Maybe, but then it's starting to get pretty subjective.
Offline kpars

JGO Wizard


Medals: 79
Projects: 4
Exp: 3 years


Extreme Typist.


« Reply #28 - Posted 2014-06-16 20:27:57 »

He said it has 300K characters, above he said 10K LOC.

Ah, my mistake. Woops!

- Jev

Offline matheus23

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Reply #29 - Posted 2014-06-16 20:28:03 »

Maybe, but then it's starting to get pretty subjective.

Subjective? It's not a single judge then, everyone who submitted is then a judge. That's just like LD 48, every submitter is a judge.

What do you mean by subjective?

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Pages: [1] 2
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (12 views)
2014-09-21 02:42:18

BurntPizza (11 views)
2014-09-21 01:30:30

moogie (13 views)
2014-09-21 00:26:15

UprightPath (23 views)
2014-09-20 20:14:06

BurntPizza (27 views)
2014-09-19 03:14:18

Dwinin (40 views)
2014-09-12 09:08:26

Norakomi (70 views)
2014-09-10 13:57:51

TehJavaDev (96 views)
2014-09-10 06:39:09

Tekkerue (49 views)
2014-09-09 02:24:56

mitcheeb (70 views)
2014-09-08 06:06:29
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!