20K lines of code!

For everything that's not in any way related to PureBasic. General chat etc...
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

20K lines of code!

Post by Num3 »

You know your project is big once you're working on it for 14 months...

I hit the 20K lines of code a few days ago, and soon i'll reach 21k!!!

Executable size: 812Kb !!!!

Image

Image
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: 20K lines of code!

Post by davido »

@Num3,

How long does it take to compile?
DE AA EB
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: 20K lines of code!

Post by Fred »

For info, the IDE is over 100k line and compile under 3 secs on a 5 year old PC
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: 20K lines of code!

Post by Shield »

I think my largest PB project (long time ago) topped at 15k, without comments and empty lines.
Number of lines usually means very little as it is very depending on code quality and structural quality. :)
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: 20K lines of code!

Post by netmaestro »

fred wrote:For info, the IDE is over 100k line
And for all that it's very solid and extremely functional. Professional quality work from the team at Fantaisie, you should be proud. I can say without hesitation, I'm proud to own a license for it.
BERESHEIT
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: 20K lines of code!

Post by applePi »

Procedure offTopic()
i'm very sorry: now i know where i saw Veni, vidi, vici. in the netmaestro post above. it happened i have watched this video a few days ago: Maximus, Cantara (Carlo Siliotto) - Julius Caesar:
https://www.youtube.com/watch?v=5zrjL6NiGoo
at the bottom of the video 7s there is sentence Veni, vidi, vici, i told myself where i saw it before??. thats great.
another version may be the original: https://www.youtube.com/watch?v=dX5RAub7JGY
the film Julius Caesar 2002 and the greatest music ever at its end from composer Carlo Siliotto
https://www.youtube.com/watch?v=IYYS70eZSmE&t=1h04m01s
EndOfOffTopic
Last edited by applePi on Fri Mar 20, 2015 3:42 pm, edited 1 time in total.
User avatar
StarBootics
Addict
Addict
Posts: 1006
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: 20K lines of code!

Post by StarBootics »

Hello everyopne,

To date my biggest project has 25444 lines started 9 years ago. I'm not developping new feature for this program just maintenance and optimsation.
The current project I'm working on has 8848 lines and the program is completed at 35%.

Yeah programming project can be big even if they are created in Basic language.

Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Re: 20K lines of code!

Post by Num3 »

davido wrote:@Num3,

How long does it take to compile?
Takes 2 seconds... But i guess part of it is because of the AV scanner!
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Re: 20K lines of code!

Post by Num3 »

@FRED,

From what i've figured, the line count information displayed on the Compilation progress windows is relative to real code lines, and does not count comment or spaced lines, i'm i correct?
uwekel
Enthusiast
Enthusiast
Posts: 740
Joined: Sat Dec 03, 2011 5:54 pm
Location: Oldenburg (Germany)

Re: 20K lines of code!

Post by uwekel »

Num3 wrote:@FRED,
From what i've figured, the line count information displayed on the Compilation progress windows is relative to real code lines, and does not count comment or spaced lines, i'm i correct?
I noticed that this is not true. Comment and even empty lines are counted as well.
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
Thorium
Addict
Addict
Posts: 1308
Joined: Sat Aug 15, 2009 6:59 pm

Re: 20K lines of code!

Post by Thorium »

uwekel wrote:
Num3 wrote:@FRED,
From what i've figured, the line count information displayed on the Compilation progress windows is relative to real code lines, and does not count comment or spaced lines, i'm i correct?
I noticed that this is not true. Comment and even empty lines are counted as well.
I don't now what the line count realy means. It doesnt count everything. I have a 8K lines project with a lot of comments and empty lines and it shows around 4,5k lines if i compile.

Edit: What i wrote was wrong, sorry. Just checked it again and i added a include file to the line count which is not included yet. The lines that the compiler shows are in fact the source code lines with empty lines, comments and even excluded procedures (excluded by the compiler because they are not called).

So including includes of your code base with a lot of procedures that are not used blows the line count up.
Amilcar Matos
User
User
Posts: 43
Joined: Thu Nov 27, 2014 3:10 pm
Location: San Juan, Puerto Rico

Re: 20K lines of code!

Post by Amilcar Matos »

Some metrics:
On the business side; Twenty thousands lines in fourteen months means a labor investment of $60,650 (at a minimum wage rate of $25 per hour), so this whole project should be around $150,000 investment.

On the technical side; the project througput is around 1,428 code lines per month which means a typing rate of more or less one key click every five seconds.

Code maintenance will require (as a gross estimate) 250 hours per release ($6,250 labor).

From the given data;
1. No code reuse metrics can be computed.
2. No delivered bugs estimate can be computed.
3. No marketing perspectives can be budgeted (either on a national or international markets).
4. No payback period can be computed.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Re: 20K lines of code!

Post by Num3 »

Amilcar Matos wrote:Some metrics:
On the business side; Twenty thousands lines in fourteen months means a labor investment of $60,650 (at a minimum wage rate of $25 per hour), so this whole project should be around $150,000 investment.

On the technical side; the project througput is around 1,428 code lines per month which means a typing rate of more or less one key click every five seconds.

Code maintenance will require (as a gross estimate) 250 hours per release ($6,250 labor).

From the given data;
1. No code reuse metrics can be computed.
2. No delivered bugs estimate can be computed.
3. No marketing perspectives can be budgeted (either on a national or international markets).
4. No payback period can be computed.
Interesting!

Here's some more info:
  • - I make this project on my spare time (i only code a few hours a week).
    - It's not a commercial project, it's proprietary software so costs are irrelevant.
    - Code base allows lot's of code reuse and quick updates (I converted the entire code from PB 4.2 to PB 5.3 in a couple of hours).
    - It has 18 individual forms and the main window (more to come as features are added).
    - It has 35 individual reports using PDF output (more to come as features are added).
    - Uses 2 Mysql databases (live and tests)
    - Uses 53 tables with a little over 291.000 records
    - Compiles and runs on linux, with a few less graphical features.
    - Bugs are usually addressed and solved in a few minutes, and new versions are made available over the company cloud!
    - It has a fully working PHP web front end
Image
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: 20K lines of code!

Post by Samuel »

I use this to check how many actual lines of code I've written. It should exclude empty and commented out lines.

Also according to Purebasic one of my programs is about 40,000 lines long, but this code reports only 15,000 lines.
But I guess that's what happens when you comment your code thoroughly.........or keep falling asleep on the keyboard. :D

Code: Select all

;This shouldn't ever mess up your files, but to be on the safe side
;always make sure your PB files are backed up before running this code on them.
;
;I won't be responsible if something happens and your files get ruined.
;Use this code at your own risk.

Enumeration
  #File
EndEnumeration

FullPathName$ = ProgramFilename()
Path$ = GetPathPart(FullPathName$)

Pattern$ = "PureBasic (*.pb)|*.pb"
File$ = OpenFileRequester("Please choose file to load", Path$, Pattern$, 0)
  
If File$
    
  ReadFile(#File, File$)
  
  If IsFile(#File) <> 0
    
    While Eof(#File) = 0

      Result$ = ReadString(#File)
      
      Result$ = Trim(Result$)
      Chr$    = Left(Result$, 1)
      
      If Chr$ <> "" And Chr$ <> ";"
        CTR + 1
      EndIf
      
    Wend
    
    Filename$ = GetFilePart(File$)
    
    MessageRequester("Information", Filename$ + " has " + Str(CTR) + " lines of code.", 0) 
    
  EndIf
    
Else
  MessageRequester("Information", "The requester was canceled.", 0) 
EndIf
Amilcar Matos
User
User
Posts: 43
Joined: Thu Nov 27, 2014 3:10 pm
Location: San Juan, Puerto Rico

Re: 20K lines of code!

Post by Amilcar Matos »

More metrics:
Previous code maintenance estimate is validated by the more info comments: few hours per week, couple of hour conversion time, few minutes bug solving time.

According to the more info provided this software should approximately have;
a) 3,600 code lines on the 19 screens forms.
b) 1,000 code lines dedicated to the reports generation.
c) 6,000 code lines for the 53 sql tables.

If those numbers are consistent with this application then;
1. At least fourteen (14) bugs should have been delivered on the first release, five (5) of which were directly related to the reports.
2. At least seven hours (7 hrs) were invested in fixing all those bugs.

From the given data;
1. No code base reliability can be assessed. Although your comment that “I make this project on my spare time”, might mean that the whole project is dependent on one coder memory.
2. No application endurance can be estimated. Application endurance answers the questions; Can this application survive an operating system version change?; Can this application be used in mission critical business?

Still 20,000 code lines for a spare time programmer surely is an accomplishment, no doubt about it! As a Basic programmer I’m proud to be your friend.

Code: Select all

;{- Program header
;==Code Header Comment==============================
;        Name/title: CodeLineCounter.pb
;   Executable name: CodeLineCounter.exe
;           Version: 1.0
;            Author: Samuel
;      Collaborator: Amílcar Matos Pérez
; Release date/hour: 03/Apr/2015
;  Operating system: Windows  [X]GUI
;  Compiler version: PureBasic 5.31 (x86)
;         Copyright: (C)2015 Samuel.
;           License: This shouldn't ever mess up your files, but to be on the safe side
;                    always make sure your PB files are backed up before running this 
;                    code on them.
;                    I won't be responsible if something happens and your files get ruined.
;                    Use this code at your own risk.
;         Libraries: None
;       Explanation: To count the lines of code, excluding comments and blank lines.
;       Limitations: Colon separated lines and line continuations not accounted for.
; ==================================================
;.......10........20........30........40........50........60........70........80
;}
EnableExplicit

Enumeration
  #File
EndEnumeration

Define FullPathName$, Path$, Pattern$, File$, Filename$, Result$, Chr$
Define LineCount.l

FullPathName$ = ProgramFilename()
        Path$ = GetPathPart(FullPathName$)

 Pattern$ = "PureBasic (*.pb)|*.pb"
    File$ = OpenFileRequester("Please choose file to load", Path$, Pattern$, 0)
LineCount = 0

If File$ <> ""
   
  ReadFile(#File, File$)
 
  If IsFile(#File) <> 0
   
    While Eof(#File) = 0

      Result$ = ReadString(#File)
     
      Result$ = LTrim(Result$)    ; trim left side space characters.
      Chr$    = Left(Result$, 1)  ; get first character in the line.
     
      If     Chr$  <> ""    And 
             Chr$  <> ";"   And
         Asc(Chr$) <> 65279
        ; line is not empty, not a comment, not a 65279 character.
        LineCount = LineCount + 1        
      EndIf
     
    Wend
   
    Filename$ = GetFilePart(File$)
   
    MessageRequester("Information", Filename$ + " has " + Str(LineCount) + " lines of code.", 0)
   
  EndIf
   
Else
  
  MessageRequester("Information", "The requester was canceled.", 0)
  
EndIf

End
Post Reply