About Me

<script type='text/javascript'>
  var jeremyLikness = {
    age: '~40',
    yearsWritingSoftware: '2 (many)',
    yearsWritingEnterpriseJavaScript: 20,
    hobbies: 'Hiking and Rock Climbing',
    favoriteSport: 'Pool, if you can call 9-ball a sport',
    wife: true,
    children: 2
  };
</script>

About iVision—http://bit.ly/ivisionappdev

iVision
iVision App Dev

What is Enterprise JavaScript?

Enterprise software is simply code that is made extremely complex for no apparent reason other than to require you to hire a large team of overpaid consultants just to make small changes.
—Unfortunate Perception

Is Enterprise JavaScript Different?

  • The size and complexity is typically higher
    • Larger codebase to maintain
    • More components and objects, higher chance of name collision
    • Easier to duplicate code and effort
  • The team size is typically higher
    • More opportunity to step on toes
    • Need for highlyparallel development
    • Mixed skills require better fail safes (base classes, behaviors)

...so this is what we've learned.

1. Yes We Can!

Remember This? (When it was Glue)

if (navigator.appName.indexOf('Netscape') != -1) {
  document.write('To upgrade your browser go to ' +
    '<A HREF="http://home.netscape.com/download/">' +
    'http://home.netscape.com/download/<\/A><\/P>');
  if (navigator.appVersion.substr(0, 1) > 3) {
    document.write('You can use Netscape Dynamic HTML');
  }
}
if (navigator.appName.indexOf('Microsoft') != -1) {
  document.write('To upgrade your browser go to ' +
    '<A HREF="http://www.microsoft.com/ie/">' + 
    'http://www.microsoft.com/ie/<\/A><\/P>');
  if (navigator.appVersion.substr(0, 1) > 3) {
      document.write('You can use Microsoft Dynamic HTML');
  }
}

JavaScript is Enterprise Grade

It's Not Just Scripts. It's Apps. Yeah.

Case Studies

  • Talents and Rewards
  • Custom ERP
  • High End Retail
  • Internet of Things
  • Medical Audits
  • Emergency Dispatch

2. Dynamic Requires Strict Measures

Challenges with Larger Teams

  • Mixed Skill Levels (Make it Easy!)
     
  • Java or C# Background (Wait, {} Isn't Scope?)
     
  • Surface Level Knowledge (What's Hoisting? How Does the Event Loop Work?)
     
  • Addressed in ECMAScript 6 ... But ...
     
  • Case Study:
    • Large (25+ developer) Team
    • International
    • Multi-year Project
    • 4 Times Improvement (TypeScript)

How?

  • Contracts (Interfaces to Set Expectations)
     
  • Inheritance (Solve it Once, Use it Many Times)
     
  • Type Safety (Let the Right One In)
     
  • Discovery (Faster Ramp Up)
     
  • Tests are Easier to Mock!

3. Forget Java and C#

(Don't Really Forget)

But...

Why JavaScript on the Server?

  • One Language, Not Many
     
  • Problems Solved by Open Source Community
     
  • Scale
     
  • Simplicity
     
  • However...
    • Right tool, right job
    • ASP.NET MVC and Web API:
      »Ecosystem
      »Built-in Security

4. DOM === Demonic Object Matrix

JavaScript Gets the Blame

It's the DOM That Does the Deed

The Solution is Simple

Frameworks to the Rescue

Normalize the DOM

          $("#id").hide();
       
         <input ng-if="ctrl.show"/>
       

Versus

function hidediv(divId) {  
    if (document.getElementById) { // DOM3 = IE5, NS6  
        document.getElementById(divId).style.visibility = 'hidden';  
        }  
        else {  
            if (document.layers) { // Netscape 4  
                document.divId.visibility = 'hidden';  
        }  
        else { // IE 4  
                document.all.divId.style.visibility = 'hidden';  
        }  
    }  
} 
       

5. Live on the Edge

Compatibility Costs

Fight for the Edge

Why the Edge is Important

  • Most Browsers are Now Edge, not Version
     
  • Most Enterprises are Accepting Edge in Production
     
  • It's Worth Discussion when Perception is Otherwise

6. TypeScript is like Coffee

Why TypeScript?

  • Types
  • Interfaces
  • Classes
  • Modules
  • Generics
  • Targets (ES5, ES6)
  • "Because Angular."

7. Frameworks Save Lives

Example: Angular

8. Don't Just Write It. Build It!

JavaScript Package and Builds

  • Node
  • Bower
  • Gulp
  • Grunt
  • Native, Integrated IDE Support...

9. Be Testy. Be Very Testy.

Testing is Essential

For Users and Developers

10. XML is Dead. Long Live JSON!

SOAP isn't so Simple

JSON Writes Itself

      <old><school way="to do it"/></old>
      


        var x = {
          "the": {
            "new": "style"
          }
        };
        

<Thank You!>

https://github.com/JeremyLikness/Top10EnterpriseJS