RSS

Defining some terms (JS)

27 Jun

After playing with codecademy’s JS course for about two weeks, I’m nearly finished. That said, I am not ready to go on with the next subject, I need some serious review and practice.

I’ve talked about this before with respect to MasterMind, but I thought I would pursue this a little more explicitly. I also thought that since I am working on making the MasterMind project as a way to practice what I’ve learned, apply it to another coding language (to get some flexibility) and develop the whole thing as an app, I might as well also use this app as a step-by-step in making an app and getting it into the app store.

That’s what this blog is supposed to be about anyway, perhaps by following a specific example in real time, it might be a lot easier for me to focus my thoughts and outline the process more clearly. I’ll outline that process as a series of goals in my next post.

This one is meant to be a place where I can post what I understand about JS as an object-oriented programming language. Specifically, I wanted to define some terms in plain language. 

This is important because I would like anyone who reads this to help edit these definitions for me to make sure they are both accurate and clear.

These definitions are also important so that I can use these terms in my discussion about constructing the MasterMind program.

_________________________

My definitions:

Arrays are collections of items (that may be objects)

                  Example:

                  var contacts = [bob, mary];

                  where bob and mary are objects with a variety of characteristics.

Classes are templates to create objects with similar qualities. (classes are what constructors make)

 

Objects are (self contained units) things that have:

                  Properties (these can be values, variables or other objects)

          Methods are functions that operate on Objects

          Members are the specific examples of Objects

          Properties are the characteristics of each object

 

Prototypes  ???

 

 

Constructors are specialized Methods that are used to create groups (or Classes) of Objects

                  Example:

 

                  function Person(first,last,age) {

                                     this.firstname = first;

                                      this.lastname = last;

   this.age = age;

   var bankBalance = 7500;

where three parameters are sent in as variables and one is set within the constructor

 

                  Constructors are called to create new objects as below:

 

                  var john = new Person(‘John’,’Smith’,30);

where john is the new object of the type Person and he has the characteristics listed –these match up to parameters in the constructor.

 

 

_______________________________

 

OK… next: map out Mastermind.

 
Leave a comment

Posted by on June 27, 2012 in Uncategorized

 

Tags: , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: