JavaScript Ascendancy

Javascript has achieved ascendancy in Web development 

Over the past 26 years of Web Development, many programming languages have had reigns as the major language for Web development. Java had the support of major players like IBM, Oracle, Redhat and Sun but the decisive opposition of Microsoft which poisoned the well with J++ and a purposely defective JVM caused Java to falter on the browser and be use strictly for server side systems.   Microsofts own ASP.NET took claim to being the Web’s first language but failed to deliver a winning IDE and a non-proprietary API so it never took off. Next Open Source stalwarts like Perl, Python and PHP took turns at leading the Web Development parade. But JavaScript a key component of the second major browser, Netscape Navigator, quickly became an essential ingredient in all the major browsers of the late 1990s because of its client side capabilities.

Then 4 JavaScript  programming breakthroughs sealed its position as one of the essential Web Programming tools.
1)first was the application  of AJAX by Google and others in speeding up Web operations by requesting specific partial page layouts and data rather than a more costly complete page refresh;
2)the release in 2006 of jQuery simplified access the the DOM model and launched the development of thousands of JavaScript plugins from image sliders through form builders to UI widgets;
3)Google commitment to JavaScript was cemented with V8 engine introduced in the Chrome browser in 2008 and still refined to date as the fastest JavaScript engine;
4)Node.js brought JavaScript back to the Server as a major development tool used to manage applications and packages on the both client and server.many Web development taks
So now JavaScript has become the  Web programming language of choice on both client and server. Node.js ability to run several tasks asynchronously yet coordinate and synchronize operations with call backs and promises has made it much more efficient than rivals such as PHP and Ruby.

The Net result is that JavaScript now leads the way not just on the client  but also client/server  and into the Cloud as Web development  programming tool of choice. Here are the reasons why.

1)JavaScript  has prospered in direct proportion to the huge growth and success of  Web technologies. From client-server to SaaS to Cloud to IoT, a basic Web stack of HTML/CSS/JavaScript has been a key player in every new Web technology.

2)JavaScript has been the beneficiary of Java’s demise. When Microsoft poison-pilled Java  on the desktop and  as the Web’s application programming language, other tools like PHP on  servers and JavaScript on the client filled the void. JavaScript became the most frequently used programming language for web applications on the client browser.

3)JavaScript profited from  the Java expertise in JVM-Java Virtual Machines and JIT-Just-in-Time compiling . The result has been a steady improvement in JavaScript performance on both client and server such that it outperforms all its major Web programming contenders: Ruby, Python, TypeScript, Perl, Dart, PHP etc. JavaScript engines on both client browsers and servers outperform its major programming competitors with the exception of native assembly code plus C, C++, C# as statically compiled code. And JavaScript continues to see runtime performance improvements.

4)JavaScript’s runtime performance has been further enhanced by coding algorithms such as AJAX, other asynchronous processing requiring fewer updates to the server,  and virtual-DOM technologies that slash the number of times that a web page must either go back to the server or traverse a large DOM-tree associated with larger web pages. The net result is that JavaScript’s performance is further enhanced beyond the initial speed capabilities of  JavaScript engines like Chrome V8.

So JavaScript has not only very fast processing JS engines but also a further speed advantage based on how it processes Web data. And as we know  the Killer App on the Internet is  website speed. And right now JavaScript  is the programming language best able to deliver fastest access on the Web.  This is what is driving the continuing  ascendancy of JavaScript in Web development.

But note this measure of JavaScript’s runtime performance makes no reference to how well JavaScript delivers security, runtime stability, creative features  or ease of development. The next part of this review will look at how well JavaScript delivers on broader web development criteria.

JavaScript’s Advantages and Disadvantages

In order to get an overview of the other features of JavaScript  we examined a number of  reviewers for their list of  key JavaScript advantages and disadvantages. As you shall see below there was consensus  on  some factors but not all: Dzone [DZ], FreeCode[FC], JScripters [JS], MarkupBox[MB], Namasteui [NM], KnowledgeHill[KH], WPMUDev[WP]

Advantages of JavaScript

  • Speed and Server Load Relief – DZ, FC,JS, MB, NM,KH, WP  Repeats the  speed arguments made above;
  • Simplicity – DZ, FC, JS, NM,KH. JavaScript is relatively simple to learn;
  • Easy Debugging – MB,   JavaScript is easy to debug and implement;
  • Popularity – DZ, FC, MB, KH, WP JavaScript runs on every major browser and Operating System,  is used on 95% of all websites in the World and is available on servers as well as clients;
  • Interoperability – FC, KH, WP JavaScript interfaces with other languages and can be used in a huge variety of applications and other languages such as Perl and PHP;
  • Interactive Events – MB, NM tracks and reacts to wide range of sensors and events;
  • Inexpensive – DZ, MB requires only text editor & browser plus huge Open Source  development toolsets;
  • Updates – FC. Had a 10 year hiatus from 1999 to 2009  in updates [thanks again to Microsoft]. Since EcmaScript 2015 (the standardized version of JavaScript) Ecma International has dedicated to updating JavaScript annually;
  • Versatility – DZ, FC, JS, WP Runs on client browser and servers with a broad range of add-on libraries for both platforms.

Disadvantages of JavaScript

  • Security Vulnerabilities – FC, JS, NM, KH, WP wide range of coding risks including XSS-cross site scripting defects, cookie forgeries, defective sand-boxing, SQL injection, misaligned trusts, etc requiring  coverage  by JS Security Analyzers;
  • JavaScript Disabled – NM, KH,WP, KH Users can turn off Javascript in their browsers;
  • Rendering Incompatibilities –  FC, JS, NM, KH major JS engines still differ in some behaviours;
  • Sandbox Limits – FC, NM,  database, file, networking access is strictly limited.

Clearly there is a consensus among the reviewers on two advantages. Speed and Server Load Relief is a JavaScript features that is hard to argue with. Likewise Popularity is clearly obvious with use on 95% of the  World’s websites. And on the downside there is a consensus that Javascript has experienced serious security problems that must be sand-boxed and scanned for hacks using an array of Web Vulnerability Analysis tools.

Two other disadvantages were also flagged consistently. JavaScript Disabled  is a nuisance browser setting given that 95% of web programs use JavaScript. With JavaScript Frameworks like Reactjs and Vue gaining wider presence, to turn off JavaScript will be a folly, like not using CSS for styling. Expect this limitation to quietly disappear. Unfortunately the same can not be said for Render Incompatibilities.  The browser vendors always seem to be out of sync in support of Internet Standards. In the late 1990 to 2009,  Microsoft’s IE browser with its JScript deviant was the big offender. Now it is Apple that shamelessly has taken up the role of being standards tardy not just on JavaScript but also CSS and HTML. It is a pity. Finally, the Sandbox Limits are also less inflammatory because with the REST API, AJAX Routines, and GraphQL there are now several secure paths for JavaScript to files, databases and other information resources.

Dubious Advantages?

There are three areas where the JavaScript is credited with advantages which are subject to reconsideration. The first is Simplicity. Yes indeed, JavaScript is easy to get on board with because of simple typing [Numbers, Strings, Booleans, Objects, Arrays and Functions] and its similarity to C, C++, C#, Java and PHP for its basic conditionals, looping, event handling, assignment statements and try-error trapping syntax. So users familiar with these languages will adapt fairly quickly to JavaScript coding.

However, lurking behind the scenes JavaScript is also much like the above Web  languages for the fragility of its syntax. Omit a comma,  forget or add one too many closing parentheses, misuse a keyword, mistakenly make a variable global, get an anonymous function expression wrong – the result is that you  unleash a torrent of error statements that oftentimes lead you away from the true cause of the problem. Thus color coded and line-by-line editors are constantly trying to warn of potential problems. This syntactic frailty seems to be the price to be paid for modern web development.

However, hidden within JavaScript are its own unique coding traps and gotchas. Implicit coercion on assignment and comparison can lead to unexpected results for type conversions. Likewise users need to master the Falsy states of false, “”, zero [yes, 0], null, undefined, and NaN when getting return values and doing comparisons in JavaScript. Also watch for lazy evaluation of logical expressions where function calls or incremental expressions [i++, –i, etc] do not get evaluated because  an early truth or false value terminates full evaluation of an expression [the classic cases: if(false && evalValid(form)) or while(true || incr++) neither of the second expressions are evaluated]. The problem is there are more JavaScript gotchas to be found in hoisting anomalies, Array and Object operations plus function and prototyping mechanics.

The question is whether this is more complicated than what developers see in say Perl or PHP. Having used both I can say that each one has its own equivalent entanglements. More interesting to see is the rapid development of tools like Babel, VSCode and Webpack to help JavaScript developers navigate through its syntactical thickets.

As well, if you consider Ease of Debugging JavaScript comes up short in a number of areas. First for direct I/O to the developer or user there are only three commands available: alert(), prompt() and console.log(). Developers must rely on setting up a browser’s watch and breakpoint capabilities to get immediate incremental change feedback on code validity. And of course each of the major browsers have a different setup and unique operations for their debuggers. So the bottom line is that developers will need to know all the browser debugging tricks available.

Complicating the debugging effort will be  two factors :
1)the the huge amount of code to track – so users will have to get used to techniques like blackboxing where good scripts are ignored while new scripts are carefully tracked;
2)the need to learn your operating systems CLI interface. For Linux coders this is  a natural; but for Mac and Windows users used to GUI based tools like Netbeans and Sencha, the CLI interface adds a new layer of tool mastery. In sum, JavaScript debugging is already difficult  client-server debugging with a new and wide range of methods and tools to master.

The last factor to consider is Updates. Now one would think that timely updates would be a good thing for JavaScript coders. But of course, thanks to Microsoft, JavaScript was held  back for a decade and so updates are now coming fast and furious – so much so that the browser vendors have not been able to implement all the new JavaScript commands uniformly. So that has forced developers to use Transpilers like Babel that transform unimplemented Ecmascript 2015, EcmaScript 2016 and EcmaScript 2017 code into whats called Vanilla.js or ES5 code of vintage 2009. It works but adds another layer of complexity in delivering state of the art JavaScript apps.

Add this to the new learning necessary to keep up with all the debugging methods required plus the flood of new JavaScript frameworks, networking and data  access tools  – it is no surprise that JavaScript developers are just a little “update weary”.

Summary

JavaScript has delivered the Web’s killer app, outstanding performance speed. JavaScript works mightily to deliver code reliability and  easier development. But in the latter case it has yet to come up with DIY development ease that popular WebBuilders like SquareSpace, Wix , Weebly and the WordPress MultiLayout Theme and Pagebuilder combos deliver where end users can do some, part or all of the webpage design and  delivery work. This is in stark contrast with JavaScript webpage design which is strictly for developers only.

True, with tools like Mobirise and  Gutenberg for WordPress, there is every intention to bring rapid  JavaScript GUI Design into the world of DIY  Development. But it is not available yet. But there is a vast array of JavaScript libraries from jQuery through D3 to the Angular/React/Vue  trio, such that JavaScript should stay at the top of Web Development.

Leave a Comment

Your email address will not be published. Required fields are marked *