Omnimaga
General Discussion => Other Discussions => Miscellaneous => Topic started by: Munchor on March 18, 2011, 02:40:12 pm
-
Are you a multiple file user (Computer Programming or Calculator Programming)?
Or do you have 1000 lines in a single file?
What do you think is best?
Discuss.
----
I personally use a single file for pretty much everything, one file and print in each line debugging is for real man!
But organized code is best when using multiple files, I have to agree with that.
-
1000 lines is way too small for multiple files, IMO :P But if I'm doing it in a lang that lets me, I like to use multiple files, separated by their function.
Multi files also work better with others, for changes become easier to implement, and conflicts are less likely.
-
I use multiple files for Java, but my source for TaNF is ~3000 axe lines long, I prefer not to split up files unless nessicary on calc. multiple files can be quite messy.
-
(Computer Programming: Python/C++)I usually have one file but I try to make multiple files so I can add features/debug easier.
I try to create very organized code but usually it ends up being chaos, but working chaos
EDIT:(Calc Programming)On my TI-Nspire with TI-84 Emulator I try to keep it to one file. I don't like having to call extra files.
-
I generally use multiple files for anything other than Pure TI-Basic.
-
If I create TI-Basic programs, I use multiple programs for subroutines to cut down the size
-
Usually what I'll do for C++ is write everything in small multiple files, then before compiling I will copy and paste everything into one large file as it makes it easier to debug. And I can easily copy everything back because I use large distinctive headers for each file. Otherwise all those #include statements just seem to bug me.
-
My problem with using multiple files is that I don't know how to do it in most languages.
I know how to do it in Python and Java, TI-Basic and Axe, but nothing else.
-
I like #include and import statements they make life easier.
Especially in Python
-
I usually use many files, but it depends on the project, too.
-
I usually use many files, but it depends on the project, too.
That's right, if it's a simple projects, why would one use multiple files?
-
I usually use many files, but it depends on the project, too.
That's right, if it's a simple projects, why would one use multiple files?
well, in TI-basic, subroutines. I've used it once where a core engine had to be called from several different places before.
-
I'll use multiple files if makes something significantly more efficient or easy to implement. However, in order to avoid forcing the user to install 50+ files (As some people do), I set a fairly hard limit of three files, with two being my normal limit.
-
If I need to make something quick (a prototype) definitely one file.
-
I generally use one file except in the following cases:
-Memory constraints (good luck fitting Illusiat 13 in one file)
-Avoiding code repetition in TI-BASIC where speed is a must (otherwise you can include your sub-routines inside the main program)
-It's annoying to scroll 5 minutes through a TI-BASIC program to find a little mistake.
-1 page app limitation in Axe.
I think the most extreme case of memory constraint is Illusiat TI-81 Remake. Illusiat TI-81 Remake has 37 sub-programs and 3 matrices. One of the sub-program only contains the following code:
PrgmY:
Disp ""
By calling PrgmY instead of doing Disp "", I save about 35 bytes of RAM (the program is called 37 times in the game), because on the TI-81 you have to close quotes and program names won't count towards user RAM (There's no VAT). And I couldn't afford wasting these 35 bytes when this calculator only had 2400 bytes of user RAM.
-
In C# I like to use many source files, but in TI-Basic I try to limit it >.>
-
I generally use multiple files for anything other than Pure TI-Basic.
Same. I always keep everything for a BASIC project (data and all) in a single program.
For most computer projects, I also keep it in a single file unless they should be separated for practical reasons (such as to create a public class in Java). Same with my ASM projects, mainly because they're mostly really small.
But for Axe, it's completely different. I split the source up into insanely small portions -- Contra is currently at 21 subprograms, each of which is around 100-150 bytes. (I think XDE was at 15 or so.) It compiles a bit slower, but it's much, much easier to find and rewrite portions of the project, especially considering the way I compress my source x.x
-
I generally use one file if I'm programming on the computer, but multiple files if I'm programming on-calc. If I'm in Basic, I combine all of my files into one before the final release. ;)
-
I generally use multiple files for anything other than Pure TI-Basic.
Same. I always keep everything for a BASIC project (data and all) in a single program.
For most computer projects, I also keep it in a single file unless they should be separated for practical reasons (such as to create a public class in Java). Same with my ASM projects, mainly because they're mostly really small.
But for Axe, it's completely different. I split the source up into insanely small portions -- Contra is currently at 21 subprograms, each of which is around 100-150 bytes. (I think XDE was at 15 or so.) It compiles a bit slower, but it's much, much easier to find and rewrite portions of the project, especially considering the way I compress my source x.x
The shoot-em-up game you make had 6 files if I remember :S
-
I'm going to agree with Sir's general opinion here. TI-Basic, for small programs, is not, IMO, a good idea because you can only edit one program at a time, so when you switch sub-programs you have to scroll. It also fills the programs menu and the arch/del one too. Of course, that's not practical for larger programs, and in that case you might be working on a sub-program for long enough to make switching not a concern. The same general idea goes for most calculator things, I think.
As for computer languages, you can edit multiple files at once and using multiple files is generally painless. It provides for more organization and is simple enough to do, so why not? As for the many files problem, source (for non-interpreted languages) can be packed in an archive (like .zip) or put in a separate folder, and, in the case of Java, .jar files put everything into one file.
There's my two cents :) (This isn't meant to attack any others' posts, just to be certain :P)
-
Well, it's nice to see everyone agreeing on something :P
-
I'm going to agree with Sir's general opinion here. TI-Basic, for small programs, is not, IMO, a good idea because you can only edit one program at a time, so when you switch sub-programs you have to scroll. It also fills the programs menu and the arch/del one too. Of course, that's not practical for larger programs, and in that case you might be working on a sub-program for long enough to make switching not a concern. The same general idea goes for most calculator things, I think.
As for computer languages, you can edit multiple files at once and using multiple files is generally painless. It provides for more organization and is simple enough to do, so why not? As for the many files problem, source (for non-interpreted languages) can be packed in an archive (like .zip) or put in a separate folder, and, in the case of Java, .jar files put everything into one file.
There's my two cents :) (This isn't meant to attack any others' posts, just to be certain :P)
Unless if you program Basic/Axe on the computer like me.
-
Ah, yes, I forgot about that. Then nothing wrong there :)
-
Ah, yes, I forgot about that. Then nothing wrong there :)
But it's also boring to put *all* files on Wabbit.
-
You can just send them all in one go, just hold ctrl while you click on the files to send then drag. ;)
Myself, it depends on what type of project it is. Levels, definitely outside file, also I tend to split level editors from the games if they don't fit together.
I prefer to keep it to one file, tho--less stuff in the program list.
-
Ah, yes, I forgot about that. Then nothing wrong there :)
But it's also boring to put *all* files on Wabbit.
Yeah that's one of the reason why I prefered to code on-calc.
-
In most cases, it's better to have a single file, however if it is a major program, maybe up to 8 files are ok if each of them are major sections of the program. If there are levels, I'd prefer to have all levels in 1 file, but this may depend as it could be better if each level had a separate file. It's important to find a balance between 1 program or several programs.
(taken from my experience using a Casio CFX-9850)
-
Didn't the 9850G use like 2-4 bytes per BASIC token by the way? I remember hearing something about how 9850G programs were twice larger than 9860/PRIZM ones.