Try it Out!


#1

To piggy-back off of my recent post: this is another request to PLEASE be clear in your assignments. This example did not give explicit instructions (in the INSTRUCTIONS sections) to make sure the function handles the situations if the ages of the persons were the same. However, it did 'suggest' it in the general exercise notes. This hint should have been part of the INSTRUCTIONS section. Again I'm a big fan of CA, but I'd rather not get stuck in situations where the errors are due to misguidance rather than actual flaws in code; the latter I could learn from the prior is just a hassle.

Screen shot: http://i.imgur.com/5OnsSfm.png


#2

I think that in general notes you have full description and in Instructions section just a declaration what you need to do. Does it metter where instruction is?


#3

If the general notes have have the entire assignment, I don't think there's a need for the instructions section. However since there's both, one would assume that you need to follow the instructions, by the definition of the word. If you have both instructional sections —one being the full blown explanations and instructions and the other being the summary of just the instructions; wouldn't it make sense that the common denominator between both sections be that they have the same instructions? I don't mean to be pompous, this me asking the instructors to help students concentrate on learning the language not and not the way each individual instructor conveys information. I would hope there was or will be a common standard for these modules.


#4

Just my opinion. Every lesson have description or explanation secton and instructions. So in this lesson we have exectly what I said. When I was doing this lesson I didn't read description part, just instruction because it was clear for me what I need to do. So what I did? I read instruction and wrote the function.
As a rule, every time when I need to pass the lesson first of all I read instructions section, I try to understand what I need to do and how it should be implemented. If I need explanation or have some questions I can read description part to find the answers.

So, my first version was very simple:

var olderAge = function(person1, person2) {
   if(person1.age > person2.age) {
      return person1.age;
   } else if (person1.age > person2.age) {
      return person2.age;
   } else {
      return person1.age;
   }
};

But I rewrite it. My second version:

var olderAge = function(person1, person2) {
   if(person1.age > person2.age) {
      return person1.age;
   } else {
      return person2.age;
   }
};

And final version:

var olderAge = function(person1, person2) {
    return person1.age > person2.age ? person1.age : person2.age;
};

I mean that if the lesson will have only one section with all instructions what to do so where is learning process? Can you be critical to your code?

So, I think that generally lesson should have two parts: description or explanation about smth what we need to learn and short and clear instructions part.

Why did you use an empty else statement? Does it make sense?


#5

I think I'm losing you in your English. The point I was making, including the screen shot, was that the instruction section did not indicate that the function needed to provide for the situation when both persons had the same age, while the general lesson section did 'suggest' it. I strictly followed the instruction section, like I've done with other lesson tracks. When I executed the code I got an error saying that I'm missing the provision for the persons being equal. This requirement was not explicitly stated. This is where the confusion came in.

With regards to the empty else; just habit; it doesn't technically hurt (unless you're bench marking load time). Will eventually quit doing this.


#6

In my practice I often need to create functions and often need to handle some situations which are not described in the task.
If talk about this lesson we have situation when instruction is just like a summary of explanation part. And I don't think that situation should be replaced there because then we need discribe all situations in instruction part.


#7

In the real world, in my experience, there are many iterations to the requirements of a project, before those requirements become specifications. Within requirements you can 'suggest' things, add or remove them, but when the requirements are finalized, you really don't deviate from them. In any case. I think I made my point clear. I think you did a great job with this lesson, but you just need to tighten it up a bit. Cheers.


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.