Page 1 of 2
20K lines of code!
Posted: Thu Mar 19, 2015 3:19 pm
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 !!!!

Re: 20K lines of code!
Posted: Thu Mar 19, 2015 8:50 pm
by davido
@Num3,
How long does it take to compile?
Re: 20K lines of code!
Posted: Thu Mar 19, 2015 9:11 pm
by Fred
For info, the IDE is over 100k line and compile under 3 secs on a 5 year old PC
Re: 20K lines of code!
Posted: Thu Mar 19, 2015 9:22 pm
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.

Re: 20K lines of code!
Posted: Fri Mar 20, 2015 8:01 am
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.
Re: 20K lines of code!
Posted: Fri Mar 20, 2015 1:39 pm
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
Re: 20K lines of code!
Posted: Fri Mar 20, 2015 2:04 pm
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
Re: 20K lines of code!
Posted: Thu Mar 26, 2015 8:54 pm
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!
Re: 20K lines of code!
Posted: Thu Mar 26, 2015 8:58 pm
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?
Re: 20K lines of code!
Posted: Thu Mar 26, 2015 9:31 pm
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.
Re: 20K lines of code!
Posted: Fri Mar 27, 2015 11:51 am
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.
Re: 20K lines of code!
Posted: Sun Mar 29, 2015 1:02 pm
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.
Re: 20K lines of code!
Posted: Mon Mar 30, 2015 12:08 pm
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

Re: 20K lines of code!
Posted: Wed Apr 01, 2015 12:33 am
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.
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
Re: 20K lines of code!
Posted: Fri Apr 03, 2015 1:53 pm
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