Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: djf

I have no idea what any of that means, LOL.


8 posted on 01/13/2012 1:25:56 AM PST by Sonny M ("oderint dum metuant")
[ Post Reply | Private Reply | To 6 | View Replies ]


To: Sonny M

It’s a program I copied and pasted but looking at it I’m not sure it does anything useful at all!

Basic is a good language to start with because you can easily learn the principles of programming like program flow, input output, if-then-else statements, etc.


11 posted on 01/13/2012 1:31:19 AM PST by djf (http://www.freerepublic.com/focus/f-chat/2801220/posts)
[ Post Reply | Private Reply | To 8 | View Replies ]

To: Sonny M
I have no idea what any of that means, LOL.

90 END mean "That's it, there is no more". For the rest of it, someone else will have to help you. That's as far as I could get :>

69 posted on 01/13/2012 6:00:23 AM PST by bcsco
[ Post Reply | Private Reply | To 8 | View Replies ]

To: Sonny M
I have no idea what any of that means, LOL.

Well, allow me to explain:

Class-based object-oriented languages, such as Java and C++, are founded on the concept of two distinct entities: classes and instances.

•A class defines all of the properties (considering methods and fields in Java, or members in C++, to be properties) that characterize a certain set of objects. A class is an abstract thing, rather than any particular member of the set of objects it describes. For example, the Employee class could represent the set of all employees. •An instance, on the other hand, is the instantiation of a class; that is, one of its members. For example, Victoria could be an instance of the Employee class, representing a particular individual as an employee. An instance has exactly the properties of its parent class (no more, no less).

A prototype-based language, such as JavaScript, does not make this distinction: it simply has objects. A prototype-based language has the notion of a prototypical object, an object used as a template from which to get the initial properties for a new object. Any object can specify its own properties, either when you create it or at run time. In addition, any object can be associated as the prototype for another object, allowing the second object to share the first object's properties.

In class-based languages, you define a class in a separate class definition. In that definition you can specify special methods, called constructors, to create instances of the class. A constructor method can specify initial values for the instance's properties and perform other processing appropriate at creation time. You use the new operator in association with the constructor method to create class instances. JavaScript follows a similar model, but does not have a class definition separate from the constructor. Instead, you define a constructor function to create objects with a particular initial set of properties and values. Any JavaScript function can be used as a constructor. You use the new operator with a constructor function to create a new object. Subclasses and inheritance In a class-based language, you create a hierarchy of classes through the class definitions. In a class definition, you can specify that the new class is a subclass of an already existing class. The subclass inherits all the properties of the superclass and additionally can add new properties or modify the inherited ones. For example, assume the Employee class includes only the name and dept properties, and Manager is a subclass of Employee that adds the reports property. In this case, an instance of the Manager class would have all three properties: name, dept, and reports.

JavaScript implements inheritance by allowing you to associate a prototypical object with any constructor function. So, you can create exactly the Employee — Manager example, but you use slightly different terminology. First you define the Employee constructor function, specifying the name and dept properties. Next, you define the Manager constructor function, specifying the reports property. Finally, you assign a new Employee object as the prototype for the Manager constructor function. Then, when you create a new Manager, it inherits the name and dept properties from the Employee object.

In class-based languages, you typically create a class at compile time and then you instantiate instances of the class either at compile time or at run time. You cannot change the number or the type of properties of a class after you define the class. In JavaScript, however, at run time you can add or remove properties of any object. If you add a property to an object that is used as the prototype for a set of objects, the objects for which it is the prototype also get the new property.

89 posted on 01/13/2012 8:10:41 AM PST by Lazamataz (Every single decision Obama makes is to harm America.)
[ Post Reply | Private Reply | To 8 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson