<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556888#M51957</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had put this demo together a while ago, it's not exactly how I do things these days, but still gives an idea about breaking stuff up into modular pieces.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://github.com/odoe/AGSModularDemo"&gt;https://github.com/odoe/AGSModularDemo&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, I don't use "views" anymore, I changed it to controllers and my widgets are actually all done in Angular.js now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used to use r.js to build my apps from when I was still using requirejs, but since the API moved to 3.x, I just use Grunt now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://gruntjs.com/"&gt;http://gruntjs.com/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was finally convinced to go Grunt after talking with one of the AGRC guys about how they use Dojo to do their builds. It's just a lot easier for me to automate my tests, less compiles and minification.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://github.com/agrc/AGRCJavaScriptProjectBoilerPlate"&gt;https://github.com/agrc/AGRCJavaScriptProjectBoilerPlate&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If I find myself with a huge list of dependencies for any require() or define() call, I take that as a sign that it's probably time to refactor and that I'm trying to do too much at one time.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is always a good sign that something could probably be broken out. I've taken to writing lots of smaller functions I can string together, which I'm fine with, but a long define/require list makes me feel bad.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jun 2013 00:18:51 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2013-06-19T00:18:51Z</dc:date>
    <item>
      <title>ArcGIS JavaScript programming, single responsibility, singletons and best practices?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556881#M51950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I started my programming in two days, my "main.js" file starts getting gigantic and hard to understand.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you know any documentation that can help me with the Javascript programming with Dojo and ArcGIS API? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I believe that to minimize the problem will need to singleton for the object map. Questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- How do you guys organize your files (.JS)? Separate files for subsequent "compilation"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Do you use MVVM?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Do you use the single responsibility principle for the scope of require([]) (Dojo)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, any opnion is welcome!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 16:02:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556881#M51950</guid>
      <dc:creator>YgorThomaz</dc:creator>
      <dc:date>2013-06-18T16:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556882#M51951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We recommend using Dojo's tools for creating classes and modules to manage your code when you start building large apps. Our &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jshelp/inside_dojo_amd.html"&gt;Dojo and AMD&lt;/A&gt;&lt;SPAN&gt; page is the best place to start. You'll find links to writing classes and widgets from there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regarding MVVM, we don't typically recommend MVVM, MVC or any other flavor of MVW (model-view-whatever). You can use any MVW framework alongside our API, including Backbone, Angular, Ember...the list goes on. Here's a repo that Matt Driscoll and I put together for examples using Backbone, Angular and Knockout at the Esri Dev Summit earlier this year:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="https://github.com/driskull/framework-samples-js"&gt;https://github.com/driskull/framework-samples-js&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To your last point, about "single responsibility principle for the scope of require([])", I think the answer is yes, if I understand correctly. Typically, in things that I build, I create classes (one per AMD module) and then wire them up with a main.js or app.js file which contains a single require(). I don't typically put anything in the global namespace except when debugging. If I find myself with a huge list of dependencies for any require() or define() call, I take that as a sign that it's probably time to refactor and that I'm trying to do too much at one time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 17:10:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556882#M51951</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2013-06-18T17:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556883#M51952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;We recommend using Dojo's tools for creating classes and modules to manage your code when you start building large apps. Our &lt;A href="https://developers.arcgis.com/en/javascript/jshelp/inside_dojo_amd.html"&gt;Dojo and AMD&lt;/A&gt; page is the best place to start. You'll find links to writing classes and widgets from there.&lt;BR /&gt;&lt;BR /&gt;Regarding MVVM, we don't typically recommend MVVM, MVC or any other flavor of MVW (model-view-whatever). You can use any MVW framework alongside our API, including Backbone, Angular, Ember...the list goes on. Here's a repo that Matt Driscoll and I put together for examples using Backbone, Angular and Knockout at the Esri Dev Summit earlier this year:&amp;nbsp; &lt;A href="https://github.com/driskull/framework-samples-js"&gt;https://github.com/driskull/framework-samples-js&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;To your last point, about "single responsibility principle for the scope of require([])", I think the answer is yes, if I understand correctly. Typically, in things that I build, I create classes (one per AMD module) and then wire them up with a main.js or app.js file which contains a single require(). I don't typically put anything in the global namespace except when debugging. If I find myself with a huge list of dependencies for any require() or define() call, I take that as a sign that it's probably time to refactor and that I'm trying to do too much at one time.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello Derek,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm reading this article: &lt;/SPAN&gt;&lt;A href="http://jpenet.blogspot.ca/2012/11/using-amd-pattern-to-create-modular.html"&gt;http://jpenet.blogspot.ca/2012/11/using-amd-pattern-to-create-modular.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will take into consideration all your advice. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 17:30:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556883#M51952</guid>
      <dc:creator>YgorThomaz</dc:creator>
      <dc:date>2013-06-18T17:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556884#M51953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I work on a moderately sized application (&amp;gt; 50K LOC) that makes heavy use of the JavaScript API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We use an in-house MVVM library similar to Knockout because it allows us to cleanly separate UI and business code from markup and presentation. It also allows us to avoid writing DOM handling code, instead relying on data-binding attributes to do the work for us. This cuts down on a significant amount of code, and provides a great deal of organization.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We also rely heavily on compilation, compiling many small units of code/markup/CSS into a single JavaScript file. This allows us to keep a large number of modular components separate and organized during development. We find this approach is integral to maintaining non-trivial applications. Dojo's build system has similar functionality, if you go down that route.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I really recommend you take a look at &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://typescriptlang.org/" rel="nofollow" target="_blank"&gt;TypeScript&lt;/A&gt;&lt;SPAN&gt; if you're planning on writing large applications. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have recently ported a great deal of our code to TypeScript, as it allows us to write type-safe code and offers code completion in Visual Studio and other IDEs. TypeScript supports classes, modules, namespaces, interfaces, and the upcoming 0.9 release supports Generics. It's totally compatible with JavaScript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Check it out!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 18:42:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556884#M51953</guid>
      <dc:creator>JasonScharf</dc:creator>
      <dc:date>2013-06-18T18:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556885#M51954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ty Jason,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What do you use to compiling many small units of code/markup/CSS into a single JavaScript file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;TypeScript is amazing!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 18:53:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556885#M51954</guid>
      <dc:creator>YgorThomaz</dc:creator>
      <dc:date>2013-06-18T18:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556886#M51955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We use a fairly simple custom tool that glues together our code and encodes CSS and HTML into the output .js file, based on configuration files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, I just now got word that TypeScript 0.9 was released today. More info here: &lt;/SPAN&gt;&lt;A href="http://blogs.msdn.com/b/typescript/archive/2013/06/18/announcing-typescript-0-9.aspx"&gt;http://blogs.msdn.com/b/typescript/archive/2013/06/18/announcing-typescript-0-9.aspx&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 19:32:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556886#M51955</guid>
      <dc:creator>JasonScharf</dc:creator>
      <dc:date>2013-06-18T19:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556887#M51956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dynamic typing is one of the core concepts of JavaScript, which is powerful. Which one is better is arguable. But since JavaScript has dynamic typing nature, I'm not sure if adding a typescript upon it makes a lot of sense. I haven't compared the performance of typescript. But JavaScript normally has the reputation of "SLOW", you may not want to sacrifice more just for type safe. Once you get used to dynamic typing, you will find it's a very flexible and interesting feature.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 22:36:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556887#M51956</guid>
      <dc:creator>JianHuang</dc:creator>
      <dc:date>2013-06-18T22:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556888#M51957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had put this demo together a while ago, it's not exactly how I do things these days, but still gives an idea about breaking stuff up into modular pieces.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://github.com/odoe/AGSModularDemo"&gt;https://github.com/odoe/AGSModularDemo&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, I don't use "views" anymore, I changed it to controllers and my widgets are actually all done in Angular.js now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used to use r.js to build my apps from when I was still using requirejs, but since the API moved to 3.x, I just use Grunt now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://gruntjs.com/"&gt;http://gruntjs.com/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was finally convinced to go Grunt after talking with one of the AGRC guys about how they use Dojo to do their builds. It's just a lot easier for me to automate my tests, less compiles and minification.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://github.com/agrc/AGRCJavaScriptProjectBoilerPlate"&gt;https://github.com/agrc/AGRCJavaScriptProjectBoilerPlate&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If I find myself with a huge list of dependencies for any require() or define() call, I take that as a sign that it's probably time to refactor and that I'm trying to do too much at one time.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is always a good sign that something could probably be broken out. I've taken to writing lots of smaller functions I can string together, which I'm fine with, but a long define/require list makes me feel bad.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 00:18:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556888#M51957</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2013-06-19T00:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556889#M51958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;To your last point, about "single responsibility principle for the scope of require([])", I think the answer is yes, if I understand correctly. Typically, in things that I build, I create classes (one per AMD module) and then wire them up with a main.js or app.js file which contains a single require(). I don't typically put anything in the global namespace except when debugging. If I find myself with a huge list of dependencies for any require() or define() call, I take that as a sign that it's probably time to refactor and that I'm trying to do too much at one time.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Derek,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have any examples posted to this simple architecture that you described above?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I read all the recommended readings. I decided to start with a simple project, my first goal is to understand the process of initial load of my scripts and JS and how can I work with objects(singletons) that will be used in other classes or modules as the MAP object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am creating a prototype to convince the staff that work with javascript is a good idea at this time. But really I'm a little confused right now. I agree with Jian about "typescript" at this time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your attention!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 14:17:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556889#M51958</guid>
      <dc:creator>YgorThomaz</dc:creator>
      <dc:date>2013-06-19T14:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556890#M51959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jssamples/data_gas_prices.html"&gt;gas prices by state sample&lt;/A&gt;&lt;SPAN&gt; is a simple example that follows the conventions discussed in this thread. The JS API site itself is another example if you example the source.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 14:32:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556890#M51959</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2013-06-19T14:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556891#M51960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Dynamic typing is one of the core concepts of JavaScript, which is powerful. Which one is better is arguable. But since JavaScript has dynamic typing nature, I'm not sure if adding a typescript upon it makes a lot of sense. I haven't compared the performance of typescript. But JavaScript normally has the reputation of "SLOW", you may not want to sacrifice more just for type safe. Once you get used to dynamic typing, you will find it's a very flexible and interesting feature.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TypeScript compiles into pure JavaScript and there's no perfomance hit that I know of. If anything, it's skewed towards better performance and encapsulation. TypeScript produces JavaScript that is essentially what an excellent JavaScript developer would produce when working with namespaces, modules, and "classes".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The dynamic versus static typing argument is an old one. I can't imagine a reason not to want compile-time checking, code completion, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One of the beautiful things about TypeScript is that has strong type inference. Example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;// JavaScript:
var thing = "a b c";

thing = 5; // Totally fine!

var pieces = thing.split(" "); // Run time error: thing.split is not function&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;// TypeScript:
var thing = "a b c";

thing = 5; // Compile time error: Type of "thing" is string, not number!

var pieces = thing.split(" ");
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Strong type inference with TS makes porting existing codebases easy. You get compile-time checking, code completion, static analysis, and all the good things that come with these. The only thing that really changes in TS are namespace and class declarations, as well as method signatures. They gain type annotations.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;TypeScript also supports what are known as "definition files". These are a lot like C headers. They define objects and types and method signatures, often belonging to libraries outside of your control. We use them when coding against dojo, the ArcGIS JavaScript API, and jQuery. They are simply code contracts. They tell us what's available, and how to create objects and call methods upon them without making mistakes and wasting time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:03:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556891#M51960</guid>
      <dc:creator>JasonScharf</dc:creator>
      <dc:date>2021-12-12T00:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556892#M51961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, dynamic typing versus static typing is an old argument starting since LISP, and it's still an argument. Here is a good discussion brought up by Douglas Crockford:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://plus.google.com/118095276221607585885/posts/MgzNUSTwjRt"&gt;https://plus.google.com/118095276221607585885/posts/MgzNUSTwjRt&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;In my opinion, I think it's really a personal preference, and I want to write and maintain real javascript code directly so that I have control over everything. That doesn't mean I refuse the help of tools such as JQUERY or DOJO. Translating from another "language" is not my favorite option even though the result seems not unreadable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Intellisense might be a big plus for many people. Again, it's a personal reference. It's a nice to have feature, especially for programmers whose primary language is not JavaScript.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 20:27:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556892#M51961</guid>
      <dc:creator>JianHuang</dc:creator>
      <dc:date>2013-06-19T20:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556893#M51962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;TypeScript also supports what are known as "definition files". These are a lot like C headers. They define objects and types and method signatures, often belonging to libraries outside of your control. We use them when coding against dojo, the ArcGIS JavaScript API, and jQuery. They are simply code contracts. They tell us what's available, and how to create objects and call methods upon them without making mistakes and wasting time.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Care to share your d.ts file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this something that ArcGIS would contribute to the &lt;/SPAN&gt;&lt;A href="https://github.com/borisyankov/DefinitelyTyped"&gt;DefinitelyTyped&lt;/A&gt;&lt;SPAN&gt; project on GitHub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We're looking at this and want to see how this works with Knockout and how well it plays with Tyepscript.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We've been working quite extensively with the Google Maps API and currently have about a 4k LOC rich UI tool for mapping, demographic data, geographies etc.&amp;nbsp; I've encapsulated my interface with the google maps API to only a few objects so I'm hoping making the swap out won't be too bad if I can make them all play together well. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 06:20:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556893#M51962</guid>
      <dc:creator>MatthewWeyland</dc:creator>
      <dc:date>2014-02-27T06:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JavaScript programming, single responsibility, singletons and best practic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556894#M51963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;d.ts api js 3.9: &lt;/SPAN&gt;&lt;A href="https://github.com/Esri/jsapi-resources/tree/master/typescript"&gt;https://github.com/Esri/jsapi-resources/tree/master/typescript&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have written a post: &lt;/SPAN&gt;&lt;A href="http://nicogis.blogspot.it/2014/05/typescript.html"&gt;http://nicogis.blogspot.it/2014/05/typescript.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;samples: &lt;/SPAN&gt;&lt;A href="https://github.com/frett27/ESRI-TypeScript-Samples/tree/master/samples"&gt;https://github.com/frett27/ESRI-TypeScript-Samples/tree/master/samples&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@Jian: Strong Typing is a lifesaver on large projects&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://blogs.msdn.com/b/eternalcoding/archive/2014/04/28/why-we-decided-to-move-from-plain-javascript-to-typescript-for-babylon-js.aspx"&gt;http://blogs.msdn.com/b/eternalcoding/archive/2014/04/28/why-we-decided-to-move-from-plain-javascript-to-typescript-for-babylon-js.aspx&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2014 07:44:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-programming-single/m-p/556894#M51963</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2014-06-10T07:44:47Z</dc:date>
    </item>
  </channel>
</rss>

