PDA

View Full Version : Largest Script


lumpie-wan
12-14-2004, 08:25 PM
I was just curious as to the largest script anyone has used for a website.
For instance if I copy and paste all my actionscript from the movie explorer and paste it into word I have 448 pages. And I would like to know if this is a little, average or way too much.

BTW the website runs smooth.

Thanks

mmm..pi..3.14..
12-14-2004, 10:10 PM
Oh my gosh!!! :eek: 448 pages?? Are you sure your not using a font size of 172?? :p :D

That seems like a ton of script to me, but I'm sure there habe been sites with more. I've never tested how many pages of script I've ever used in a site or presentation, but if I had to take a guess, I'd say it was about 20 pages. Don't really know what the average is, guess it kind of depends on how you write your script and how advanced an actionscripter you are. You could dramatically reduce the amount of script you use if you made alot of custom classes, then you might be able to get your script down to under 100 lines, but that would take alot of time :(

Eric :D

farafiro
12-15-2004, 02:11 PM
either show us the site or ............. the script
;)

JEBoothjr
12-15-2004, 04:58 PM
Sounds like way too much code, but I'd have to see the site. I've built full elearning shells that amount to MAYBE 40-50 pages but definitely less than 100. Show us the site.

CyanBlue
12-15-2004, 05:12 PM
Where does the page coming from??? I have never heard of people comparing the length of the code by the page... I thought that it normlally goes with the lines... Funny... :D

JEBoothjr
12-15-2004, 05:44 PM
Yeah, I've never done that either. I was just chiming in on the probably excessive amount of code.

jubei
12-16-2004, 12:23 AM
I reckon I would have had about a thousand lines at most.. but I'm trying to cut down. I'm more impressed by less lines of code than more :)

snapple
12-17-2004, 10:59 PM
Yes, fewer lines = better, simpler code = better, clear comments = better, human readable = better.

However, for some reason, within the Flash community i feel that people (no one admits to it) like bombarding fellow flashers with complex code and high line counts, somehow is a good thing (ego-less programmers are the best, number one rule!) -but they seem few in number in flash (compared with sometihng like C++).

Regards, snapple

petefs
12-17-2004, 11:18 PM
I'll admit to it just to make you wrong, snapple! : D

I bombard fellow flashers with the most complex code and highest line counts I can! ; )

Regaurding line-counts, however:

reducing line-count often results in LESS readable code. good commenting requires many extra lines, and while they're not actually code I'm sure they're included in line-counts almost always ^_^ There's also the matter of following best practices and adopting a good coding style, which often inflates line-count but improves the ability to work in a group and quickly understand code written by somebody other than yourself.

Unless I'm writing a quick little script, I try to keep my code as verbose as possible (within reason). It's difficult on a deadline, but when you come back to it you thank yourself profusely : )

Not to make this post any longer, but keep this in mind for example:
condensed: 1 line

function update(Void):Void { if (hasChanged==true) trace('bad?'); }

verbose: 7 lines

function update(Void):Void
{
if (hasChanged==true)
{
trace('good?');
}
}


Imagine a whole script done either way -- the verbose script may be 7,000 lines where the condensed script may be 2,000... but who in their right mind wants to read the first one? They'll compile the same : )

CyanBlue
12-18-2004, 12:13 AM
Hehe... My previous project was about 4000 lines long... (I took out the files and checked it just to see it... :D)
Well... I copied all the scripts to a text editor... and did a line sort which gave me 4xxx lines... I got rid of the blank lines, {, } and all the comment lines and it became about 2500 lines...

The bottom linie is that I avoid using condensed coding style as much as I can because it doesn't make me read the flow of the code... I even put { and } into separate lines to see where the script begins/ends... Extra lines for sure... But what do I care??? I want to read my codes and modify it as fast as I can to finish the project... :)

Speaking of which... There used to be one liner code contest for the BASIC language when I first put my hands on the PC... Mighty fun it was... :)

snapple
12-18-2004, 09:14 AM
petefs, very true about efficiant code being less readable, good point. Oh, even shorter version:


function update(Void):Void { if (hasChanged) trace('bad?'); }


CyanBlue, yeah, i always put my parenthesis on seperate lines, this is actually how it is meant to be done, however, books always inline one of them to save space on printing - and its gradually stuck - but large if else statements (i find) can be hard to interptet if there is not a newline for each brace.

How did the VBasic test go in the end ? ;)

Best regards, snapple :)

jubei
12-19-2004, 10:36 PM
By preferring less lines of code, I don't mean at the cost of readability. I was referring more to using functions and loops and all that fun to decrease the number of lines of code. It makes updating and changing the overall project much quicker..

For example, with http://www.followsam.com every time I add a city to the map, it's between 12 and 18 lines of code. If i'm adding an entry as well, it's quite a few more. If I had the time, I'd go back and write a few functions to to add a city was only one line of code, and save myself a whole swatch of time in updates. But because the updates only come every couple of weeks, it's not worth the time to clean it all up.