← Back to context

Comment by scrollaway

11 years ago

It's quite ironic how you're lecturing people about dependencies and bandwidth when you yourself don't seem to have a good grasp in your mind of how immense even 5 kilobytes is (you talk about 5kb functions). 5 kilobytes (well, KiB) is 5120 bytes. That's about 200-300 lines of code. If you're talking about minimized code, maybe up to 500 lines.

While a 5kb function is immense, I work on a legacy code base and I have seen functions up to 2000 lines long. You possibly overestimate the quality of code that people in business actually write. I've worked in a few places and all have parts of the code which I would thought were made up if submitted to the dailywtf.

Also, have you ever seen a commercial library require >2MB of minified JS? Here's an example:

http://cdn.wijmo.com/jquery.wijmo-pro.all.3.20153.84.min.js

That file is almost 2MB minified (5.6MB unminified).

And that is is only 1 of the few different files required for our dependency on it, there is a bunch more javascript/css also required. Would I use that library on a new product? I'd probably advise against it due to the size, but a legacy product has dependencies and you don't have the freedom to rewrite everything all the time.

  • I've dealt with such functions, but they're seldom the type of functions that other GGP is talking about (small, simple, exportable functions).