The Diablog™

Why Javascript?

Living in the modern world invariably means living some form of an online life. While 15 or 20 years ago “getting online” was perhaps a novelty for most, the smorgasbord of searching, socializing, deal-making, commerce, and cat videos proves the internet is an endearing, and at times aggravating, experience most of us look forward to, or at least endure.

Take my mother, for instance. An affirmed technology Luddite, she recoils with epic melodramatic distaste at any mention of having anything (at all) to do with a computer. She’d rather eat a shoe dipped in motor oil than get on a computer. 

So when my brother gifted an iPhone 4 to her a year or so ago, I awaited the wailing and gnashing of teeth. The disconcerting phone calls, the disapproving tone, the indignation of being forced, or heaven forbid required, to use the darn thing. 

That really never happened. Sure, she complained, and made heavy sighs about light “failings” of the device she’s come to clutch happily 24 hours a day, seven days a week. Perhaps like many in my situation (programmer, technology prognosticator, affirmed computer user), I watched with smirking befuddlement as she learned to use the darn thing as if another appendage has suddenly sprouted from her body. Hours of personal tutelage upstaged by a phone.

The iPhone, crusher of technology barriers. 

What does this teach us? Technology works. When it works well, it can be so intuitive or at least self-instructing, even the most squinty-eyed technophobe can be won over without even putting up a fight. 

Another thing it shows us is that success is not overnight. The iPhone was a product years in the making, largely perfected through years of pre-release effort before any customer ever held one. I am old enough to remember watching with wonder movies showing video phone calls, thinking “when is THAT ever going to happen!” Then it did, on the iPhone. So yesterday, but years in the making.

An important aspect is that technology at it’s base connects us with information we need or desire. Whether personal, political, financial, or simply humorous (cat videos! hilarious goats! hamster’s eating tiny burritos! animals are funny!), technology has the ability to fulfill us, connect us, and help us accomplish something, big or small.

I might break the tender hearts of some web developers out there, but the way in which that information is delivered or presented is rarely the focus of the person absorbing or interacting with it; the internet as go-go gadget copter, it’s not meant to be. This is why the iPhone (really, iOS) works so great; it is techno-grease, easing our means to connect in such a way that it feels less constructed, and more organic. It is itself subliminal in that it attracts so little attention to itself, in that humble-brag way.

And thus, Javascript. Why Javascript? I would surmise that a full 95% of all consumers of web-based media have not an iota of a clue’s idea what Javascript really is, what it does, and why it matters. However, I would hazard a guess that of those 95%, many who have heard of it have been told it is dangerous and should be avoided.

Let me say, that is not true. 

Javascript is a programming language, first and foremost. Developed by Netscape early in the life of the world wide world (circa 1995), it was a means to augment the way content was presented with another language called hypertext markup language, or HTML. 

Example of HTML:

<p>Hello world!</p>

Example of Javascript:

<p id="hw"></p>
<script type="text/javascript">
document.getElementById('hw').textContent = 'Hello world!';

If you were alive and online in the early days of the internet, this form of the internet was a dreary place to be; content was static (except for infuriating scrolling marquees), pages were laid out like badly formulated newspaper copy, and for the most part it was ugly and dead (except for simple web forms). As in, you could not interact with the data like you did in other applications like word processors and image editors.

Initially came a language called Visual Basic Script, or VBS, introduced by Microsoft. Not particularly well-suited to the internet (techno-speak for don’t ask), it never really caught on and eventually died a silent death. Only aging web geeks remember’s nifty slide-out menu was written in VBS. 

This was at a time when the internet was still being explored like a strange, outer-space-like place. Tools hadn’t been hammered out yet, the browser was a crude space ship, and instructions were usually held in text-heavy “manuals”, read only by real geeks between raids on chicken farms. Anyone who truly understood this stuff was thought of as no less than a circus freak. And that was not a complement, then.

Netscape was in competition with Microsoft for control of this space ship-like browser market (you paid for Netscape Navigator, ho ho, remember those days?!?). Whereas Microsoft was wed fairly tightly to their own (misfitted) Visual Basic technology, Netscape was not, and thus, the weird fever dream of Javascript was born.

(Contrary to it’s name, Javascript has absolutely no relationship with Oracle’s Java programming language. The name was a misnomer for a language that barely appears to look like Java, yet other than a fleeting glance, is not anything like it. My opinion is it was a marketing decision to confuse the two.)

Javascript, then, is not new. Microsoft, although it had a competing technology in VBS, adopted Javascript only a year after debuting in Navigator. All modern browsers support Javascript. Indeed, running the majority of most websites without Javascript will give a uniquely dystopian experience, seemingly transporting the user back to a 1995-era internet (depending on if a styling language called CSS is also disabled). 

Today we live in a 2001-the-movie-like internet reality. While not impossible, it is difficult to build a modern internet experience without Javascript augmenting that experience in fundamental ways. Like the iPhone experience, it is a culmination of years of development. Only when it does not work, do you notice it (unless you’re a geek like me). 

Javascript has become the language of the internet.

Concerning whether Javascript is dangerous or not, I understand the consternation. For people like my mother, it is easier to keep her away from all threats posed by the internet, than it is to model her behavior to keep her on the internet and safely away from those threats. My sister and I have been somewhat relieved that she is not on the wider internet (the font size on the iPhone is too small for her to do much free surfing).

So how do you protect yourself? First, Javascript is not the evil. The attacks that use the web browser utilize Javascript as an intermediary or delivery mechanism; in fact, the reason Javascript cannot be “fixed” to block the attacks is because it is an intrinsic way in which the browser is designed to work. If fixed, many other, useful things would break. Like YouTube. No cat videos? No bueno.

Second, you should only have browsers installed that are setup to automatically update. Having software that is patched with the latest security measures significantly reduces the threat. Attackers are mostly lazy; they want unpatched browsers with big security holes that are easy to exploit. Don’t be lazy.

Third, do not auto-enable browser plugins to run automatically. The exploits used in Javascript threats are actually delivering “payloads” of ActiveX, Java applets, Shockwave/Flash or PDF documents. This is why Javascript is blamed for other technology’s bad behavior; you cannot wipe a hard drive or install a root kit (both Very Bad Things when done by someone other than you) with Javascript, but you can with the technologies I cited above.

Fourth, consider using a browser that allows you to easily disable plugins. Chrome allows a lot of control over what is allowed to load in the browser. There is no simpler means to protect yourself than to go in and disable entirely any Java from running in your browser. Only specialists need it anyways. All other plugins should be set to ask before running, and Chrome allows you to whitelist sites so it doesn’t need to ask over and over.

Fifth, be skeptical of installing any browser add-ons (especially search bars from shady-sounding third parties). The more add-ons you have installed, the slower the browser can run oftentimes, so keep it only to what you need, and don’t install on a whim. The same advice applies to smartphone apps.

Finally, if you really are afraid of the unknown, there are tools out there like NoScript that allow you to disable Javascript and then enable on a per-site basis. 

Dialogs uses Javascript on all of the sites we develop; it is simply a reality of the modern internet experience. It is omnipresent to the point that much of the experience users have come to expect is only available by leveraging Javascript. 

That gadget on the Facebook page that notifies you (without reloading the page!) that Grandma Harrell commented on your son’s skateboard mishap? Javascript. That scrolling news tool on your favorite homepage? Javascript. That menu that allows you to look for a page simply by manipulating your mouse or finger? Javascript. Image galleries? Javascript. You forgot to enter your password before logging in? Javascript.

Javascript is less wonder these days. It simply is there, working its magic, unobtrusive, useful. Why Javascript? Because it works.

Dialogs customers expect solid advice, and we deliver. Talk to us today about how we can improve your presence on the web or with a mobile app.