Dojo said that "dojo AMD format, makes code easier to author and debug" (https://dojotoolkit.org/documentation/tutorials/1.10/modules_advanced/)
is there any one can show us an example code to prove this statement? tanks :)
AMD allows division/organization of your code in modules, which are loaded on demand, this have some advantages:
More information about AMD and module.
Example of simple module for a navbar:
// in "my/widget/NavBar.js"
define([
"dojo/_base/declare",
"dijit/_WidgetBase",
"dijit/_TemplatedMixin",
"dojo/text!./templates/NavBar.html"
], function(declare, _WidgetBase, _TemplatedMixin, template){
return declare([_WidgetBase, _TemplatedMixin], {
// template contains the content of the file "my/widget/templates/NavBar.html"
templateString: template
});
});