Wednesday, 23 November 2016

What is the maximum size of JSON data that web browsers could handle?

As you can see from my results, the browsers were all surprisingly close to one another. The most interesting part for me was that Internet Explorer failed to load the object after the 250,000 record test. I couldn’t find anything pointing to a size limitation here. If anyone knows as to why IE failed to load the 500,000 record object, let me know.
From this test, I am considering the sweet spot to be around 10,000 records at (1.55MB). The maximum number of usable records I would push to a browser would be around 25,000 records (3.87MB). Keep in mind there are numerous factors to keep in mind when determining how many records you should return to your JavaScript application. The purpose of this test was to help identify a general maximum number for conversations around large record sets with JSON.


Tuesday, 22 November 2016

Why JavaScript counts month from zero (0)?

One possible explanation:

They might've considered months to be an enumeration (first index being 0) and days not since they don't have a name associated with them.
Or rather, they thought the number of the day was the actual representation of the day (the same way months are represented as numbers in a date like 12/31), as if you could make a enumeration with numbers as the variables, but actually 0-based.
So actually, for the months, perhaps they thought the proper enumeration representation would be to use the month's name, instead of numbers, and they would've done the same if days had a name representation. Imagine if we'd say January Five, January Sixth, instead of January 5, January 6, etc., then perhaps they'd have made a 0-based enumeration for days too...
Perhaps subconsciously they thought about an enumeration for months as {January, February, ...} and for days as {One, Two, Three, ...}, except for days you access the day as a number rather than the name, like 1 for One, etc., so impossible to start at 0...