Javascript Meal Maker


#1

Has anybody else found this project difficult? Seems like the course material doesn’t satisfactorily cover the project requirements in enough detail.
From the view of a complete beginner to Javascript this project is rather impossible going off the course material and completely relies on the learner to use the hints.
Perhaps a more simple project is required or better yet an update to the course material making it more clear and concise.


#2

What isn’t covered then? Unless you can specify what is lacking, its difficult to make improvements.

The tricky thing about programming, is that its really difficult to explain how everything fits together. Explaining concepts (like getter methods) is easy, but how to apply it, that is the challenge. I am afraid you need to do that, that is what these projects try to achieve. This makes them challenging and frustrating, but a very worthy thing to do.

and of course you are always welcome to the forum when you get stuck in such a project for some additional guidance. That is what the forum is for


#3

I don’t think it is a case of what isn’t covered, it just seems to go from 0-100 really quickly. Maybe it is just me not grasping the general concept of object setters and getters but that is the point of this discussion, to see if I’m not the only one. Thank you for your reply though.


#4

Yep, the projects are a challenge. But somehow you need to get to next level

But that is why the forum is here, to help you. You are not alone.

The project uses quite a complex structure, i think that is the most challenging. I would highly recommend visualizing it? Drawing it with pen and paper and using arrows to indicate flow of program


#5

That is a great idea, and I do understand making things challenging. I will give it a try.


#6

I have to ask the other moderators, i finally completed the project from scratch (i helped people before, but never did the project from start to finish), and i am slightly puzzled, let me get back to you :slight_smile:


#7

Thank you for that. I would be most interested to know the outcome. I am restarting the subject objects to really get a handle on it.


#8

All the getter and setter methods do absolutely nothing. getters are useful when accessing property outside of object:

x = {
  _y: 3,
  get y(){
    console.log('getter')
    return this._y
  }
}
console.log(x.y)

we access y (property) outside of object x, as you can see, the getter is used (getter is logged to console)

we don’t do this anywhere within the mealmaker project, so all the getters and setters are redundant.


if we want to access property using a string (which you do in meal maker project), you need square brackets:

// from earlier example in this reply
// alternative way to access properties
console.log(x["y"])

if you know these two things (square brackets and getting rid of all getters and setters) its a very doable project


#9

That is an excellent response. I will give it another crack. Thank you for your help stetim94


#10

i had a discussion with the other moderators, which was very interesting.

the getter and setter methods for appetizers, mains and desserts should be part of the of the _courses object, so:

_courses: {
    _appetizers: [],
    _mains: [],
    _desserts: [],
   get appetizers(){

   },
   set appetizers(appetizersIn){

   },
   ....
}

this differs from the hint. And given getters and setters are used, you need underscore for mains and the other properties.

it could be done without getters and setters, given its currently mimicking existing behavior of objects.