Quantcast
Viewing latest article 7
Browse Latest Browse All 20

Dr. Scriptlove: SharePoint and JavaScript

COLD-WAR SATIRE REFERENCES ASIDE, I HAVE ALWAYS HAD A CERTAIN AMOUNT OF DREAD FOR JAVASCRIPT.

It’s not because…

I’m an old curmudgeon that resists new things; after all, I do consulting and teaching, and staying up on the latest technologies is an important and enjoyable part of my professional life.

It’s not because…

I’m a zealot for a particular language; I think most modern languages have pros and cons.

Really, my dislike boils down to this:

JavaScript feels like a major step backward in the evolution of programming, and I see it as an easy path to brittle, buggy, unmaintainable code.

SO WHY HAVE I HAD A CHANGE OF HEART ON THIS SUBJECT?

Well, I recently attended a training class on SharePoint 2013 and the instructor made an excellent case on writing SharePoint Hosted apps (if you’re not familiar with the application hosting models in SharePoint 2013, please reference this article).

BUT, THE THING IS, SHAREPOINT HOSTED APPS CAN ONLY BE WRITTEN IN JAVASCRIPT.

Image may be NSFW.
Clik here to view.
tumblr_ln7nptHNcF1qfg0kfo1_500

SO THE TIME HAS COME FOR ME TO PUT ASIDE MY BIASES AND EMBRACE WRITING JAVASCRIPT.

But, if I’m going to do that with any sort of professional satisfaction then I want to really feel like I’m writing elegant, beautiful, maintainable code that I can be proud of.

If you find yourself in a similar circumstance, then let me recommend a three-step process to get you jump-started.

  1. Read this book. More than any other text I’ve seen, JavaScript: The Good Parts does a good job of acknowledging my concerns about JavaScript and providing real answers to address them. Beyond that, it’s just a treasure trove of good practices to engage and bad practices to avoid. It opened my eyes to some of the expressiveness of the language, and while I’m not sure I can call it “love” yet, I’ve certainly gotten past my loathing.
  2. Embrace jQuery. Sure, the old-hands at JavaScript know about this already, but if you’re new to the party then don’t bother wondering whether or not you need this: you need it, and doing any kind of browser-based programming without it just seems unthinkable at this point.
  3. Don’t abandon your architectural roots. Those of us that are schooled in programming know that certain patterns work on building scalability, reusability, and maintainability into our code. Your multi-tiered, loosely-coupled, MVC, MVVM learning still apply here. (By the way, Knockout is an excellent way to implement some of these patterns). It just may take a little more effort on your part to stay architecturally sound since the language and the tooling makes it easy to pollute your architecture.

SO, JAVASCRIPT ISN’T SOME KIND OF “DOOMSDAY MACHINE.” IT’S JUST A NEW FRONTIER, ANOTHER CHAPTER IN THE SAGA OF PROGRAMMING.

Go forth and write some elegant code!

Image may be NSFW.
Clik here to view.
tumblr_mb2784Cksk1rggns2o1_500

The post Dr. Scriptlove: SharePoint and JavaScript appeared first on ThreeWill.


Viewing latest article 7
Browse Latest Browse All 20

Trending Articles