Author Topic: How big is yours?  (Read 13132 times)

0 Members and 1 Guest are viewing this topic.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
How big is yours?
« on: November 19, 2018, 01:25:07 pm »
Back in the day, when dinosaurs roamed the Earth and QBasic only had 64K worth of memory, about 4x that if you knew how to use the multi-modular capability, but I digress, coders had to figure out how to optimize large projects. Now that QB64 has been around about 10 years, those limits have been vanquished; so I was wondering... What is the largest (most lines of code) program any of you have written? I'll just add one criterion for reporting...

Please separate out DATA. In other words a program with 100 lines of statements and 100000 lines of copied and pasted data isn't "code" it's filler.

I'll start. My QBasic written office software project, whicj I consolidated when QB64 came out, turned out to be...

Code Statements: 86,000 lines (2.85 MB)
Data: Approx 1000 lines kept in external files.


I thought up this topic based on the discussion thread about embedding files: https://www.qb64.org/forum/index.php?topic=790.0

I think 10 years ago 80+ thousand line programs were pretty rare, but I bet a lot of you have had some pretty big or bigger monster projects over the past years, too. I know, I know, bigger isn't always better. Oh wait, who are we kidding!

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: How big is yours?
« Reply #1 on: November 19, 2018, 03:51:40 pm »
Wow! 86,000+ lines of code. Most impressed... I struggle just keeping a reasonable track of 100+ lines... You MUST have a secret...

J
Logic is the beginning of wisdom.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: How big is yours?
« Reply #2 on: November 19, 2018, 04:36:13 pm »
I used to have a secret, but I was afraid it would get out. So I sold all the used whips and chains, and started mega-coding! It's cheaper, and considerably more painful... I mean satisfying!

Pete :D
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: How big is yours?
« Reply #3 on: November 19, 2018, 06:41:07 pm »
Well Pete, you have a really big one, my GuiTools project counts to approx. 15000 lines, but is scattered over two dozens files. Data lines are negligible, but approx. 20-25% of it are just comments, as every sub/function has a description block noting its usage, inputs and results.
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: How big is yours?
« Reply #4 on: November 19, 2018, 06:51:09 pm »
A few years back, I got hired by the local historical society to help them organize their records, and that ended up being a program which was several hundred thousand lines long.  Data entry, sorting, indexing, searches, and a custom graphical interface were all required to meet their needs.  It took me a little over a month to write the data handling part, at which point I assigned two of my farm hands to data entry work which lasted them both for several years, and then I spent who knows how long working out the GUI and making small tweaks to the society's specifications.

I'd share the code, as I'm rather proud of how it all turned out, except they refused to allow any rights with it due to "security concerns".   The source code is stored in a non-password protected folder on their local server in the courthouse basement; it's written in BASIC; and they're worried over "security" from sharing the source to people who'll never be able to access their off-line system...   
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: How big is yours?
« Reply #5 on: November 19, 2018, 07:00:22 pm »
Do you recall approximately how many lines were code statements?
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: How big is yours?
« Reply #6 on: November 19, 2018, 08:12:57 pm »
This thread reminds me to either (i) invent, or (ii) ask Luke if there exists - a convention for calculating the "entropy" of source code. Things like comments, DATA statements, and oft-repeated patterns will have small representation compared to the actual statements that get things done... Because talking about raw numbers is a complete dead end.

Example: because who never saw The Shining? ... If I write 10 PRINT "All play and no work makes Jill a fun girl" a million times, that can be reduced to like, 2 or 3 unique items. The obvious reduction is to capture the work of pasting 999,999 instances of a line be imagining a loop structure doing the same thing... *provided* that the individual PRINT statements don't change the program state or interact with something in a nontrivial way (obviously not in the case of PRINT). Meaning this (as a counter-example): If I count all the times in a program that "i = i + 1" occurs, I don't get to lump all those together - context probably mattered in each case.

Anyway, we need a new measuring tool.

I propose we flip this on its head: instead of asking about our memory's biggest program designed for a big and specific task that doesnt work anymore (or is inaccessible), we should compare sizes by flaunting the *smallest* complete work we have that can do the *most*. Flip the competition on its polished little head, amirite?
« Last Edit: November 19, 2018, 08:20:23 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: How big is yours?
« Reply #7 on: November 19, 2018, 08:22:30 pm »
What are you trying to compensate for Bill?  Oh, you mentioned you needed a new tool. Toshiba!:D

Hey wait, this isn't actually a competition. It's more a census. Back in the QB45 era, programmers who wanted to make big applications got beat up bloody by the memory limits; so most coders back then didn't stick with that language if they wanted to accomplish a work that required a lot of code. Now we don't have those limits, so I was just curious how other programmers here have taken advantage of this major product improvement.

I do agree with your comments about quality vs quantity. I should have included that I left out comment lines, because back then I didn't use them. I'm older now, and finally appreciate the REM statement.

Pete

« Last Edit: November 19, 2018, 08:24:36 pm by Pete »
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: How big is yours?
« Reply #8 on: November 19, 2018, 08:26:29 pm »
Yeah no worries - not attempting to derail the confidence contest here.

To answer the question on hand, no program o' mine has ever surpassed say, 8000 lines.

Oooey, I just thought of another metric. This one may be useful actually - and that is to create a histogram of the indentations of each line. The first layer in a DO...LOOP or IF...THEN is indented once, nested things once more, and so on. I wonder what the shape would be. Gaussian?
« Last Edit: November 19, 2018, 08:29:31 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: How big is yours?
« Reply #9 on: November 19, 2018, 08:39:51 pm »
You know I never used to indent, either. I think a few years ago a particularly heavily nested loop caused me to change my mind on that, too. If I had to guess, it would probably have been 14 or more loop/next/then/case situations. Probably 800 lines of nests.

8000 is no small matter. That would have maxed out QB45 with modules.

I'd like to take a peek at Steve's, but he keeps insisting I show him mine, first.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: How big is yours?
« Reply #10 on: November 19, 2018, 08:40:17 pm »
@STxAxTIC: Have you ever seen a program written by ARB.  (You probably remember him as Anthony for Walt's site.  Pete will remember him as, "Crazy Ass Spammer-Dude over at N54.)

He writes the longest programs I've *EVER* saw, and it's all for one reason:  He doesn't understand arrays, so he doesn't use them.  One of his lottery prediction programs had a sort routine in it which astounded me at the complexity behind it...

If Var1 < Var2 THEN SWAP Var1, Var2
If Var1 < Var3 THEN SWAP Var1, Var3
If Var1 < Var4 THEN SWAP Var1, Var4
.... Copy/paste for Var1, 100 times...  Then Var2, 100 times...  Then Var3, 100 times...  And on till Var100, 100 times...

And the whole program was like that.  No LOOPs as he didn't use arrays, so trying to follow program flow was utterly baffling to me.  By the time I scrolled from one action to the next, I'd forgotten what the heck was going on in the program.

If we're comparing LONGEST programs, ARB wins hands-down...

***************************

Comparing code is almost always a waste of time.  I can write a nice BMP image routine for screen capture in 100 lines of code...  Somebody else might DECLARE LIBRARY and do it in 4 lines of code.  If I save it as an $INCLUDE, I can do it in 2 lines of code...

Which does the most?  Which is "shortest"?  "Best?" 

Do we count all the lines from a library as adding to our program length?  If not, then can't we just cheat and wire a 1-line program for:  $INCLUDE:'QB64.BAS', and then say, "Look, I can do EVERYTHING QB64 does in one line!"

Of course, if we DO count library lines, then why don't we count all the lines in the font/sound/graphic libraries which QB64 uses behind the scenes?  By that definition, PRINT "HELLO WORLD" is probably a 100,000 line program...

The only real criteria that's useful when discussing programs is, "Does it work and fulfill the user's needs." 

Anything else is just trivialities.  ;D
« Last Edit: November 19, 2018, 08:42:31 pm by SMcNeill »
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: How big is yours?
« Reply #11 on: November 19, 2018, 08:44:28 pm »
Dammit Bill, apparently you did manage to throw the train off the track here. People who do that without interjecting politics into the thread really piss me off! :D

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Bert22306

  • Forum Regular
  • Posts: 206
    • View Profile
Re: How big is yours?
« Reply #12 on: November 19, 2018, 09:59:15 pm »
You guys put me to shame. Actually, years ago, using QBasic, I wrote a program so long that QBasic got upset and told me it was too long. I had to break it up into subroutines.

Since then, that program has evolved in many ways. It's now 4105 lines of code, although perhaps 25% are comments. The main program is 599 lines.

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: How big is yours?
« Reply #13 on: November 19, 2018, 10:17:46 pm »
Holy damn do I remember ARB... the paradox of that guy...

So yeah, his code was horrendous. He did the computer's work for it far too often. Yyyyuuuuuck. But yall remember that he championed himself as having made an ARB Chess System, which routinely bet the best chess AI in the world? I have suffered the chess problem in BASIC (stopped before implementing checkmate or castling before calling it "done enough" so its actually useless), and that whole kind of problem is not only a mindfap to implement, but staggeringly unimaginable to do without arrays. I want to know how deep his delusion really went, in a bittersweet way. Has he been banned from *.org yet?

(Sorry to flame when a person isn't around. ARB is a real exception though...)
You're not done when it works, you're done when it's right.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: How big is yours?
« Reply #14 on: November 19, 2018, 10:27:04 pm »
Yeah, that guy used every character code in the chart... You might say he was a real ascii-whole.

And now, back to our regularly scheduled topic...

Pete :D
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/