UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » The Lounge
  • » just for fun: lines of code (LOC) in your product

#1 2005-11-01 07:36 AM

angoyal
Member
Registered: 2003-05-23
Posts: 31

Re: just for fun: lines of code (LOC) in your product

find . -name *.cpp -exec wc {} \; | awk '{a+=$1;print a}' |tail -1
find . -name *.h -exec wc {} \; | awk '{a+=$1;print a}' |tail -1

Offline

#2 2005-11-01 03:38 PM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,239

Re: just for fun: lines of code (LOC) in your product

More useful would be the ammount of used memory (and/or CPU usage, file sizes, etc.) devided by the functionality it provides. This ratio should give a nice number how bloated your software is. Of course something similar can be done with lines of code versus functionality.

Offline

#3 2005-11-02 01:08 AM

angoyal
Member
Registered: 2003-05-23
Posts: 31

Re: just for fun: lines of code (LOC) in your product

Offline

#4 2005-11-02 04:55 PM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,239

Re: just for fun: lines of code (LOC) in your product

If doing that unique part takes halve of the resources (lines of code, mem usage, whatever..), and the rest is used to implement, say, some bells and whistles, then it's easy to point out the bloat within your program. You're right that comparing different programs is less useful to do if they don't do the same and haven't the same main features.

The thing is, comparing lines of code says even less. Maybe lines per code per programmer or something, but bare line numbers is more like boasting how awfully lot light bulbs your building has.

Offline

  • Index
  • » The Lounge
  • » just for fun: lines of code (LOC) in your product

Board footer

Powered by FluxBB