How to boast about amount of code written?

Keep it clean but fun.
Post Reply
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

How to boast about amount of code written?

Post by Callan S. »

A bit of a light hearted topic. And it's not so much boast, but how do you sort of say you accomplished something today, re coding, as much as others might say they got the shopping done? The number of lines in code, is it representative? For good formatting you have spaces in between in many places? And some lines are short echo statements, while others are nuanced logic management.

What do you think, indie-resource? :)
Fight Cycle : My latest Browser game WIP
Driftwurld : My Browser Game WIP
Philosopher Gamer : My Blog
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: How to boast about amount of code written?

Post by Jackolantern »

Whenever I want to measure what I have done, I usually look at the problems I solve, some kind of complex processing or some complicated output to the screen. I don't know why, but I have rarely ever considered how many lines of code I have written. You touched on the fact that C-style languages are kind of verbose when it comes to lines of code compared to languages such as Python or BASIC (mostly due to curly-braces and white-space freedom to make things more readable). So line counts are really kind of relative :cool:
The indelible lord of tl;dr
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: How to boast about amount of code written?

Post by Callan S. »

I guess when I'm coding a game, most of the time I don't feel I'm solving a problem. Sometimes when I can't get it to do what I want, it becomes a problem - but you don't really want those times to occur (certainly the better you get at coding, the less often they occur - and if you spend several hours typing code but have no problems - well, did you do nothing? Surely not?). And when they aren't occuring, I don't feel like I'm solving a problem that needs solving as I'm writing a game.

Not that alot of TV shows or movies don't exactly need to be made as they don't solve any particular problem.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: How to boast about amount of code written?

Post by Jackolantern »

I guess "solving a problem" was a little vague, because I meant it in the computer science terminology. Kind of like how everything that does something is a "solution", that solution is the solution to the problem of not having it. Kind of odd, I know, but in that way, every major piece of functionality you need is a problem or a "requirement". Solutions solve requirements. So basically, when you write a level editor (or possibly even a smaller part), you have solved a problem. :ugeek:
The indelible lord of tl;dr
Cayle
Posts: 272
Joined: Fri Jul 03, 2009 4:45 am

Re: How to boast about amount of code written?

Post by Cayle »

Measuring your progress by lines of code is problematic. The metric that I use is bug free unit tests.

Sometimes I’m in a groove and write a lot of code quickly. That quickly written code often gets thrown out and replaced by something more efficient and smaller. Lots of code can mean spaghetti code. On the other hand, overly concise code can be just as spaghetti-like in its own infuriating way. If you are careful and write easily readable/understandable code that you’ll easily understand when you revisit it a year or two later, you’ll inflate your line count. If you are a defensive programmer who does lots of error checking and writes in lots of try/catch blocks, your line count will explode.

But lots of lines or few, the real measure of a method, clad or module is its ability to survive being beat on by unit tests that are designed to push it to its limits. Your test harness is possibly the most important piece of code in your project. :ugeek:
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: How to boast about amount of code written?

Post by hallsofvallhalla »

I measure my progress by how many villages I raided and dragons I slayed in the day....

hehehehe actually for me it is internally set milestones. I guess I kind of set some goals for the session and see how much i have done and how much I have learned. I could get nothing donw but spend the day fighting a problem and learn a ton and feel more progressive than writing a ton of code and not really learnng anything.
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

Re: How to boast about amount of code written?

Post by vitinho444 »

I like to see the lines like, you have a project with 10k
I think you should be happy if all works like you want :)

In my code i usually do like this (php and c++)

if(halls == "cool")
{
//Infinit Loop :)
}
else
{
//If you reach this part, you are not talking about the same halls as i am :D
}
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
Cayle
Posts: 272
Joined: Fri Jul 03, 2009 4:45 am

Re: How to boast about amount of code written?

Post by Cayle »

Ohhhh... now we can have a coding style holy war! AWESOME!

I find opening curly braces on their own lines breaks up the code too much and makes it less readable. So I do this.

Code: Select all

if(halls == "cool"){
    //Infinit Loop 
}
else{
    //If you reach this part, you are not talking about the same halls as i am 
}
These are the two main competing styles in curly brace languages. Naturally, civilized people use Python instead and there are no curly braces to argue about. :mrgreen:
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: How to boast about amount of code written?

Post by hallsofvallhalla »

hehe i am more a fan of

if()
{

}

than

if(){


}
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: How to boast about amount of code written?

Post by Callan S. »

hallsofvallhalla wrote:hehe i am more a fan of

if()
{

}

than

if(){


}
Very zen!
Post Reply

Return to “Off-Topic”