Username:
Password:
JavaScript Libraries Tutorials

Brief Review / Good Practices

Subtitles of the Movie

In this tutorial we begin to discuss good design and development principles. Now, while this topic is well beyond the scope of this series, there are some principles of design that are applicable to our JavaScript Libraries. Most of the JavaScript Libraries apply and adhere to the principles we're getting ready to discuss. Now, these principles are not definitive but are commonly used by industry professionals and we are all encouraged to examine these principles and others, if we're interested, more in depth. Now, briefly, these topics include modularity. Now, modularity refers to the idea that we want to keep things separate. This means that we want to have clean HTML that is separate from our Cascading Style Sheet information and have those two elements free from JavaScript information. So in essence, we want to have our HTML, Cascading Style Sheets and JavaScript information all in separate files. Now, this makes it a whole lot easier for us to maintain our applications if these things are separate and centrally located. Now, the reverse of this is essentially spaghetti code, where you end up having HTML with in-line Cascading Style Sheet information as well as script blocks in the middle of an HTML page. Now, while it does get the job done, it does make trying to find trouble spots more difficult because you don't know exactly where to look. With the approach of modularity, where you're keeping your like elements together, it's a whole lot easier to find out where the problem is and to fix those problems. So modularity is a great concept and it's going to be a good thing if you maintain this idea of modularity. Now, because your JavaScript Libraries are in their own separate JavaScript file, this modularity is going to be easy to maintain. However, it is recommended that any JavaScript code that you create reside in a separate file as well. Now, the second topic we're talking about is progressive enhancement. Progressive enhancement deals with this idea that we need to progressively enhance our pages, meaning that we need to layer our different technologies. So this allows us to build solutions that are scalable depending on the consumer. So what we end up doing is we create applications that function for the client as plain HTML documents leveraging server-side technologies to create the HTML. So what we have as a foundational basis is a clean HTML document that can go to any device. Then we're going to layer our CSS on to control the appearance on a variety of different platforms, including screen, brail readers, screen readers, TVs and so forth. Then we further layer on the JavaScript to compliment and or replace some of the server-side code. Now, in general, a lot of people will refer to this as fault tolerance for functionality, meaning that if a browser does not handle JavaScript, then you're still going to get the functionality of the web page provided by the HTML document itself. Also, some browsers allow you to turn off Cascading Style Sheets and some browsers don't even understand Cascading Style Sheets, depending on the device that is reading the page. Now, this idea of fault tolerance is a great idea because it allows your end users to experience your applications at some level. So it's kind of like opting in for the additional features, depending on what platform they're actually viewing the pages at. So this approach provides a layer of fault tolerance so the application scales to those users. So those are the two concepts here that our JavaScript Libraries kind of work with and we're going to be in a better position if we keep those things in mind as well.

Tutorial Information

Course: JavaScript Libraries
Author: James Street
SKU: 33984
ISBN: 1-935320-39-4
Release Date: 2009-04-06
Duration: 12.5 hrs / 157 lessons
Work Files: Yes
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 81,350 Video Tutorials (20,800 free)
  • Video Available as Flash or QuickTime
  • Over 782 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available