So I was reading up on the GetGamePlacesAsync
function of AssetService and I noticed that it returns the StandardPages object. It's not my first time seeing it, but it made me wonder: why not just use a multidimensional array? Does using StandardPages
have any benefits over an array?
A game can have a boundlessly large number of places associated with it. Having GetGamePlacesAsync
retrieve all the places associated with the game with one call as an array just doesn't scale too well (e.g. a game that has a million places will return a table with a million entries.) That's a dangerous waste of bandwidth and memory.
A good analogy would be video streaming. With video streaming, you can watch the video as more pixels (for a lack of a better term) are loaded, instead of having to wait for the entire video to download. Likewise, with pages, you can read each page as you go without having to load the entire table in one sitting.