Inconsistencies in JS samples makes learning unnecessarily difficult

907
2
08-25-2010 07:55 PM
StephenLead
Regular Contributor III
This is some general feedback for the authors of the JavaScript API Samples pages.

There is often poor consistency between the samples, making it unnecessarily harder to copy/paste samples together as you're learning.

For example, the Featu
re Layer (On Demand Mode) sample uses: var mapLayers = [];  //array of layers in client map

The Time Slider With Dynamic Data sample uses: var layers = [];

This means you can't simply copy/paste code between samples, but have to debug it laboriously. This is a simple example, but it's repeated throughout the samples.

By contrast, the SilverLight samples are more consistent, meaning it's easy to copy/paste an item like the Overview map, to add to your growing sample application.
0 Kudos
2 Replies
KeithSandell
New Contributor III
stevel,

I feel ya. I just started using the JS API back in May 2010 and with what little knowledge I had, made some very minor applications with lots and lots of (unnecessary) code. It worked, but it was like using a sledgehammer to squish a marshmallow.

Anyways...I agree that the samples are differential in their approaches to presenting solutions, and I'm sure you know that this is because they were written by different people and there are well more than just a couple of ways to code.

However, the benefit of this is that it forces you to dissect the code to effectively merge samples, which ultimately give you a better foundational knowledge of the API and its functions. And as corny as all this sounds the frustration that you are experiencing now will pay dividens in the future.

You'll be able to make some really kick @$$ apps; a whole lot better than just some merged samples.

Happy coding.
0 Kudos
StephenLead
Regular Contributor III
Hi Keith,

Fair enough - I am definitely getting good at skimming the samples to work out the relevant bits.....

Cheers,
Steve
0 Kudos