Page 2 of 2

Re: What is it about javascript?

Posted: Sun Feb 05, 2012 1:51 pm
by Kerafym
Are you having trouble with the object orientation in general?

I raged when I read the word "instantiation" in my CPP book. The FUCK does that even mean?

Re: What is it about javascript?

Posted: Sun Feb 05, 2012 6:21 pm
by Laser
object orientation seems to be my downfall!

oh and its java and javascript, plus AS3

Re: What is it about javascript?

Posted: Mon Feb 06, 2012 1:55 pm
by Max Rambone
Just keep at it and it will eventually just click.

That's been my experience anyway.

~archi

Re: What is it about javascript?

Posted: Mon Feb 06, 2012 3:53 pm
by Kerafym
Have you tried talking to your instructor personally about this? Maybe outline some stuff in particular you're struggling on and they can help you out more.

Re: What is it about javascript?

Posted: Mon Feb 06, 2012 8:58 pm
by Maximus
Object oriented design is actually really logical and nice to yews once you understand it.

A "class" is a concept, a general class; like Car-ness. The class "Car" will list the possible attributes of Cars; what a Car can have. A Car can have a number of doors (int num_doors), a gas tank size (float gas_capacity), or audio systems (boolean has_satellite_radio). The class Car will also list the functions that apply to a Car; things a Car can do, or things that can be done to a Car. A Car can be started (void start()), have its AC turned on (void enable_aircon(boolean enable)), or report to user the current speed (int get_speed()).
An "object" is an instantiation of a class; a particular Car. My Nissan Rogue is a particular car. This car can be instantiated by using the constructor method and the "new" keyword; Car myCar = new Car(). It has a number of doors (num_doors = 4), a gas tank size (gas capacity = 15.0), and an audio system (has_satellite_radio = false). My Car can be started (myCar.start()), have its AC turned on (myCar.enable_aircon(true)), or report to me its current speed (mySpeed = myCar.get_speed()).

As an aside, this conforms pretty directly to the Greek philosophers' (Aristotle et al) view of understanding the world as abstract and universal Forms (classes), and specific and concrete Matter (objects). Matter/objects are particular things that exist, and Forms are the ideas that our intelligence abstracts from them. I hold the Form of my car in my mind; I do not hold the Matter of my car in my mind.

Re: What is it about javascript?

Posted: Thu Feb 09, 2012 2:57 am
by GUARD!AN
No offense bob, I think you just made it even more confusing for him...

What I usually tell noobs is:

A class is the recipe you have for a cake. The final cake you have when you are done is the object.

The final cake (AKA object) has everything the recipe told you the cake needed to have in it (the ingredients AKA the data) and the instructions for making the cake (the methods).

It is somewhat alarming that you don't seem to realize that actionscript IS javascript (it's a superset), and the original post seemed to imply that being bilingual would mean you are more likely to be good at computer languages...

The problem is clearly that you don't understand the concepts. I think you are spending too much time focusing on the syntax and code, and not on the concepts of computer science (look up encapsulation, inheritance, polymorphism, etc)

Re: What is it about javascript?

Posted: Tue Feb 21, 2012 12:45 am
by zeun4749
really want to pin it down to something, so my question is this: what is it about javascript that is stopping

Re: What is it about javascript?

Posted: Sat Feb 25, 2012 5:45 am
by GUARD!AN
zeun4749 wrote:really want to pin it down to something, so my question is this: what is it about javascript that is stopping


Well you specifically should just quit if that's your attempt at coding a bot.