Week02

Elvenware Logo

TOC

Prog 272 Week 02, 2017

A few key facts.

Primary Goals

We might also discuss, as needed:

  1. Privacy
  2. Before we can use it, I need to update this:

The list above is long, perhaps too long. To sum up, the emphasis is on JavaScript basics, unit testing, and Git. These will be our core "tools."

JavaScript basics include primitive types, objects and functions. You should be able to write unit tests that involve these key elements of the language. And finally, you should be able to check your code in and out of a git repository.

Grunt and Karma won't be used much this quarter. They are tools you can use to help ensure that you are writing valid JavaScript code. In particular, we use Grunt in conjuntion with JsHint, and Karma to automate the running of our unit tests.

JsHint is a syntax checker which we can use to confirm that our code conforms to basic rules, many of which are conventions enforced only to help you write code that is easier to maintain. We will use eslint in this course, because we are working with ES6. JsLint is for ES5.

But again, if you are overwhelmed, focus on learning JavaScript primitive types, objects and functions. That is the core of our work this first week.

Decks

You can learn more about JavaScript, HTML and CSS by viewing these decks:

The funny letters after each name are the Bitly URLS. If you need to manually reach the first link, write:

And these documents:

NOTE:* You will have to be patient with the documents you find on Elvenware. Someday they will mature, but for now, they are a work in progress. Don't expect anything fully polished, just take what you can get from them. One thing they do provide, is a good sense of what I think is important. Generally material that is assigned as homework is addressed somewhere on Elvenware.*

NPM

You can test if global npm packages are out of date:

Update all globally installed packages: npm update -g

IDE

We will also talk more about our primary IDEs and text editors, which include:

Sharing Files

Git

Git Elvenware overview

We are not using Git GUI anymore. I have another tool called Git Cola. I'll update this later.

Do a pull with GitGui:

Podcasts and Videos

I have a number of videos that you should watch:

Douglas Crockford on JavaScript and other subjects:

Unit Tests

describe("An Elvenware Suite of Specs", function() {
  it("shows true = true", function() {
    expect(true).toBe(true);
  });

  it("shows 1 + 1 = 2", function() {
    expect(1+1).toBe(2);
  });

  it("shows addMe(2, 3) = 5", function() {
    expect(addMe(2, 3)).toBe(5);
  });

  it("converts 9 feet to 3 yards", function() {
      var actual = xConvert(9, 'feet').to('yards');      
      expect(actual).toEqual(3);
  });

  it("converts 6 feet to 2 yards", function() {
      var obj = xConvert(6, 'feet');
      var actual = obj.to('yards');      
      expect(actual).toEqual(2);
  });

  it("converts 24 inches to 2 feet", function() {
      var actual = xConvert(24, 'inches').to('feet');      
      expect(actual).toEqual(2);
  });

  it("converts 4 gallons to 15.14 liters", function() {
      var actual = xConvert(4, 'gallons').to('liters');      
      expect(actual).toEqual(15.14);
  });
});

Week Two Day Two - jQuery

The goals for today are to:

Tips

In FireFox, install FireBug:

IE can sometimes turn on compatibility settings, particular on Intranets, even though our code is fully HTML 5 compliant. To stop this: