Author Topic: Really Long Source Code  (Read 18284 times)

0 Members and 1 Guest are viewing this topic.

SirCmpwn

  • Guest
Re: Really Long Source Code
« Reply #15 on: March 18, 2011, 09:24:03 am »
tiDE's folder encompasses 24.3 MB.  This includes images, source code, and other assets.
Of that, there are 869 files, and 225 folders.
Within the code files of tiDE, there are 26,082 lines.  This only includes actual code, no images or other files were included in my calculation.
This is in *one* project.
Don't believe me?  The source code is publicly available here.
I don't think anyone could possibly beat that.
If anyone would like a program that counts all the lines in *.cs files within a given directory, let me know ;)
« Last Edit: March 18, 2011, 09:29:55 am by SirCmpwn »

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Really Long Source Code
« Reply #16 on: March 18, 2011, 09:25:34 am »
:o
I'm not a nerd but I pretend:

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Really Long Source Code
« Reply #17 on: March 18, 2011, 09:30:02 am »
Yeah, Assembly programs have a frickin huge number of lines.

But even for that, this is huge!




SirCmpwn

  • Guest
Re: Really Long Source Code
« Reply #18 on: March 18, 2011, 09:41:32 am »
Here's a program to count all the lines of any code files in a specific directory.  Click Choose Directory to pick it, and Count Lines to get the line count.  Pretty straightforward.  Change the Filter text box with whatever kind of file you're looking for.  If you want *.cs files, type "*.cs".  If you're looking for *.asm files, type "*.asm".  If you're looking for any file called "test" with any extension, type "test.*".

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Really Long Source Code
« Reply #19 on: March 18, 2011, 10:19:54 am »
Wow, I can see why people are reluctant to discontinue ASM programs...

@Xeda:  I still don't know how you understand Hex more than Assembly.  ???  But thats just amazing.  :o

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Really Long Source Code
« Reply #20 on: March 18, 2011, 11:45:27 am »
I group the code together, so it makes it a little more compact and readable. If you read in your native language, if you know what to expect, you don't need to read the whole word and sometimes you don't even need to read the sentence! So when I type:
EFF142D878C0EB4E234623EB
I only read the "EFF" part and since it is unique, I know that the whole line is devoted to finding a variable and getting the size in BC. I then look at the last byte for an EB to see if the pointer to the data is returned in HL or DE (DE in this case). Or if I see:
3E30ED67FE3A3802C607121BC9
I can tell almost instantly by the "3E30" that it deals with numbers because 30h is the token for "0" and if I read further and see C607 I know the line is involved in converting hex, too. I find that a lot easier to pinpoint and recognise in a code than:
Code: [Select]
ld a,30h
 rrd
 cp 3Ah
 jr c,$+4
  add a,7
 ld (de),a
 dec de
 ret
It is just easier for me to understand as a language, I guess.

Ashbad

  • Guest
Re: Really Long Source Code
« Reply #21 on: March 18, 2011, 01:23:52 pm »
Wallball (the old slow assembly version, very unoptimized) was around only 1200 lines.  I look at it now and realized it could drop below 700.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Really Long Source Code
« Reply #22 on: March 18, 2011, 03:45:09 pm »
I don't know if data files count, but the unoptimized and uncompressed map for Black uses 1.5 million polygons and takes 81.5 MB.

As for the longest program I've ever written, it would probably have to be an AI program I wrote in Python that took around 2000 lines.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: Really Long Source Code
« Reply #23 on: March 19, 2011, 12:42:07 am »
Mimas is currently 16040 lines, not counting auto-generated files.  That's by far the largest assembly program I've ever written.

How do you people deal with source code when it starts getting over 4000 lines long? I feel like once it starts reaching this length, I start losing time by searching through the code for routines. At these sizes, the scroll bar is almost useless.

etags. :)  And occasionally grep.

And yeah, I'd say 4000 lines is too long for a single source file, no matter what language or editor you're using.

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Really Long Source Code
« Reply #24 on: March 19, 2011, 12:57:44 am »
@FloppusMaximus, by any chance did you ever try assembling Mimas with Mimas. I don't know if it's possible or not with all those macros and stuff, but it would be pretty cool.

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Really Long Source Code
« Reply #25 on: March 19, 2011, 10:39:54 am »
@FloppusMaximus, by any chance did you ever try assembling Mimas with Mimas. I don't know if it's possible or not with all those macros and stuff, but it would be pretty cool.

I don't think it would fit... It would be cool though.

Mimas is currently 16040 lines, not counting auto-generated files.  That's by far the largest assembly program I've ever written.

How do you get auto-generated files?
« Last Edit: March 19, 2011, 10:40:39 am by Deep Thought »




SirCmpwn

  • Guest
Re: Really Long Source Code
« Reply #26 on: March 19, 2011, 10:45:08 am »
How do you get auto-generated files?
I don't know about Mimas, but when I have a lot of code to write, I'll generally make a program to write it for me.

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: Really Long Source Code
« Reply #27 on: March 19, 2011, 04:02:50 pm »
I don't know about Mimas, but when I have a lot of code to write, I'll generally make a program to write it for me.
Exactly.  In this case, there's a Perl script to generate the instruction patterns and rules from a simple text description (which I could have done by hand, but writing a script was easier, and probably less error-prone), and another script to compile the built-in symbols (which involves compressing and sorting them, and there's no way I could have done it by hand.)  Since the results are generated automatically, I don't think those files count as part of the source code.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Really Long Source Code
« Reply #28 on: March 24, 2011, 03:50:59 am »
I wonder how many lines of code TI-Nspire OS 2.1 has and by how much percentage it would shrink down if 3rd-party OSes were possible and if one of the hardcore TI-Nspire programmers here optimized it? O.O
« Last Edit: March 24, 2011, 03:51:50 am by DJ_O »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Really Long Source Code
« Reply #29 on: March 24, 2011, 11:19:09 am »
Remember a lot of the extra space 2.1 needed was because of its Chinese character support.