Dave's Notebook

JavaScript Types Nuance

I was once teaching a class on JavaScript to a group of C# developers when someone asked a very logical question, “Are JavaScript Types all derived from Object?” I loved teaching this particular group because they were actively engaged in the material.  So many times, when I teach, the students simply absorb what I say, but they don’t interact with it.  They never ask the question, “What are the implications of what is being said.” My initial instinct was to say ‘no’ based on my experience with the language.  But then as I thought about it later, I thought, “But when I use the debugger on what seems to be a primitive, don’t I see it as an object?”  And as it turns out, my instinct was right.  Not everything in JavaScript is an object.  Although there is quite a bit that you wouldn’t think was an object that is.

Now that we’ve covered JavaScript Objects and JavaScript Object Fields, it is time to move on to the specifics of JavaScript types.

So, why is it, when I look at some primitive values, I see them as objects?  And which types are objects and which are primitives?

![](/uploads/2016/04/image-4.png "image") Photo via [Visualhunt](//visualhunt.com/)

Read More

Do This To Increase Your Client Side Web Development Speed

Over the last year, in particular, I’ve developed a technique for developing the client side of a web application using JavaScript, HTML and CSS that has significantly improved my development speed.  Once I tell you, it will be obvious.  At least, it is to me … now.  But as obvious as it is, I rarely see this technique used on any of the applications my peers are working on.

And while this technique is an outgrowth of my involvement with TDD, this particular technique can be used with or without TDD.

![](/uploads/2016/04/image-3.png "Do This To Increase Your Client Side Web Development Speed")
Photo credit: [JD Hancock](//www.flickr.com/photos/jdhancock/4367347854/) via [VisualHunt](//visualhunt.com) / [CC BY](//creativecommons.org/licenses/by/2.0/)

Read More

JavaScript MVVM - You’re (Probably) Doing it Wrong

If you are using one of the many frameworks that say they are using JavaScript MVVM, you might not be using it the way it should be used. Many of my clients aren’t.

This article will attempt to answer three questions.

  • What is MVVM?
  • What are the advantages of MVVM?
  • What are good MVVM coding practices?
![](/uploads/2016/04/image-1.png "JavaScript & MVVM")
Photo credit: [uka0310](//www.flickr.com/photos/uka0310/8038385310/) via [VisualHunt](//visualhunt.com) / [CC BY](//creativecommons.org/licenses/by/2.0/)

Read More

Ext JS 6 by Sencha - The Good, The Bad, The Ugly

Long time readers may remember that I started using Ext JS about 3 years ago.  At the time, I was using version 4.2.2.  I recently started a new contract where they are using Ext JS 6.0.1.  I have to say, this version solves a lot of the architectural issues I had with the 4.x series.  But, there are still problems.

Since I’ve provided an evaluation of Angular 2 and React JS, I thought providing an evaluation of the current version of Ext JS would be appropriate since these three seem to be the main players in the corporate world.

![](/uploads/2016/04/image.png "Ext JS by Sencha - The Good, The Bad, The Ugly")
Photo credit: [sanbeiji](//www.flickr.com/photos/sanbeiji/5606497634/) via [Visual Hunt](//visualhunt.com) / [CC BY-SA](//creativecommons.org/licenses/by-sa/2.0/)

Read More

An Explanation of the Flux Pattern

Over the last couple of weeks, I’ve mentioned that I’ve been learning React JS.  First in the article “Reaction to React JS and Associated Bits” and then last week in my article “Test Driven Learning”. 

In the first article, I mentioned that if you use React JS, you’ll probably end up using the Flux design pattern and since there are multiple ways of implementing flux, getting a clear definition of what it is and how it should work can be confusing.  At least, I found it confusing.

And now that I’ve figured it out, I thought it might be helpful both to myself and to the programming community at large if I offered my own Explanation of the Flux Pattern.  At the very least, it will give me one more way of solidifying the concept in my own brain.  Maybe it will be helpful to you as well.

![](/uploads/2016/03/image-5.png "Flux")
Photo credit: [jeffreagan](//www.flickr.com/photos/jeffreagan/22033828931/) via [VisualHunt.com](//visualhunt.com) / [CC BY](//creativecommons.org/licenses/by/2.0/)

Read More

Test Driven Learning - An Experiment

As I mentioned last week, I’ve been learning React JS over the last month or so. Up until the start of this project, I would learn a new framework, and then I would try to paste in Test Driven Development after the fact.  I would use the excuse that because I didn’t know the framework well enough, I wouldn’t be able to properly write tests for it.

But this time, I decided to do something different.  What if I wrote tests for my demo application as I was learning this new framework?  My reasoning was that learning how to test code written in the framework was just as important as learning the framework.

What follows are the lessons I learned from this wildly successful experiment.

image Photo credit: twm1340 via Visualhunt.com / CC BY-SA

Read More

Reactions to React JS and Associated Bits

I’ve been learning React JS over the last several weeks.  Currently, I now know 4 of the major JavaScript frameworks: Angular 1, Angular 2, EXTjs (4.2 – 6.0.1), and now React JS.  To be clear, I also know Knockout and JQuery.  But I don’t consider these frameworks so much as libraries.  They’ve helped me understand the principles used in the frameworks, but they are not frameworks.  What follows is a summary of what I consider React’s strengths and weaknesses.

React JS Photo credit: kristin osier via VisualHunt / CC BY

Read More

JavaScript Object Fields

Last week as I was discussing the basics of JavaScript Objects, I kept referring to the members of the object as “fields.”  Never did I call them properties or methods.  This is because all members that are hanging off of an object are treated the same, from a membership perspective.  It is the type of data it contains that makes it behave as what we would normally refer to as a property or a method.

This is an important distinction.

In a strongly typed system, we can say that a member of our object is a property or method simply because it was defined as one or the other when we defined our class. In JavaScript we have neither classes where we can define what something is, nor strong typing.

Read More

JavaScript Objects -- What You Don't Know CAN Hurt You

I’m assuming that anyone reading this blog has probably been using JavaScript for a while.  Many of you have used a number of the many frameworks that are available and most have used jQuery.  For the most part, you get what needs to be done, done.

But, I would also say that most of you have no idea how JavaScript works.  This is why I’ve written about JavaScript Variables, JavaScript Functions, and now JavaScript – Objects.

So, let’s start with the most basic of JavaScript questions.

image

Read More