Tuesday, January 6, 2015

Day 6 - 30 Day Learning Challeng

Continuing with AngularJS at CodeSchool.  I sometimes get answers "wrong" because I added or am missing an extra semicolon.  This can be annoying and frustrating and it would be good if the "computer" would tell me visually (like some editors do).  These are the kinds of things that can frustrate students and use up time and cognitive load better spent on other tasks.

Here is an example that did not "pass" as correct:
The following code did not "pass":
  app.controller('GalleryController', function(){
    this.current = 0;
    this.setCurrent = function(imageNumber){
      this.current = imageNumber || 0;
    };
  });

Yet by simply adding a semi-colon it did pass (see below):
  app.controller('GalleryController', function(){
    this.current = 0;
    this.setCurrent = function(imageNumber){
      this.current = imageNumber || 0;
    };
  });

Now add to this from what I have read on recommendations "You shouldn’t put a semicolon after a closing curly bracket"

Of course any automated learning program that has to do checks will have issues as there is usually more than one right way to do things.  Now, it seems Code School is looking for specific formats and commands which limits the possible "right" answers.   But since there can be more than one way to do things it would be better to simply pass a set of tests and if they pass the tests you have solved the problem.  That said in the cases I am seeing for Angular the "end result" is exactly the same, but they are trying to teach you a specific way to code so I can see why they check the way they do.

I have also been thinking if Domain Specific Objects/Languages might be better approach for learning environments and also for providing ways for non-experts to "program" as part of expressing themselves and/or playing with ideas.  But right now that is just an idea germinating lets see where it leads.

Cheers,
Stephen


No comments: