Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript file size , what's too big?

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Is 2000 lines of code (including spacing / newline formating) too big?

or is that fairly small?

actual file size is @ 50kb , and there are two loaded JS files which equals @ 60kb in total.



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Is 2000 lines of code (including spacing / newline formating) too big?
there are tools to compress and minify formatted js files. this way it's easy for developers to read. The file deployed for production then gets the extra linebreaks and whitespaces removed. I think there are even applications to combine js files. so development can create separate js files to keep organized, for production the files are combined, compressed, and minified.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Too big.....

a)for execution.
b)for use in an acceptable commercial environment.
c)to run on a slow ass PC's
d)to run on a slow ass internet connection.

is there any other type of too big in computer web code terms?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Still too vague.

The execution time has nothing to do with size.

Code:
var i=0;
while (true) {
 i++;
 --i
}

This is less than 1K and will keep de CPU busy for a while.

If you're designing a web with some 200K jpegs, then a 50K Javscript is nothing. If you're using some kind of DSL, transimission time is ridiculous.

If you're planning to use a 49K RAM LCD to display it, then it's too big

Cheers,
Dian
 
I'm probably worrying about nothing then as I don't intend to write code that puts the browser in a loop, that would be a bug wouldn't it?

plus my target user/client is not a mobile phone.

I'll assume all is OK unless I hit a snag , then I'll post a specific code problem then.

Cross fingers it won't come to that though.

Thanks for the input.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top