|
-
Nov 27th, 2001, 11:20 AM
#1
Thread Starter
Lively Member
Please explain the difference between ...
a Class;
an Object in that Class;
a Library
Please use an example
-
Nov 27th, 2001, 02:12 PM
#2
transcendental analytic
A class is a type of object. "Filly is a turtle"
A library is a interface (a tool or set of tools) for a programmer. Also known as API - advanced programmers interface.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 27th, 2001, 02:43 PM
#3
Monday Morning Lunatic
Originally posted by kedaman
A class is a type of object. "Filly is a turtle"
A library is a interface (a tool or set of tools) for a programmer. Also known as API - advanced programmers interface.
API = Application Programming Interface, and it doesn't necessarily have to be in a library.
As far as C++ goes:
Code:
class Turtle {
public:
Turtle(); // Constructor
~Turtle(); // Destructor
PublicMethod();
private:
PrivateMethod();
int m_iPrivData;
};
Turtle filburt1; // Object of the "Turtle" class
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 27th, 2001, 04:04 PM
#4
A class is like a cookie cutter (Oh, no! not the cookie cutter analogy again!). Objects are created from a class, like you create a cookie from a cookie cutter.
A Library is a collection of Functions, classes, or whatever that you can use. The STL is a good example. It is a library of various templated container classes.
There is also your Public Library, which is a collection of books =).
Z.
[edit]
Yes, I can type...
"collection fo Functions"
-
Nov 27th, 2001, 04:26 PM
#5
transcendental analytic
I think my filly is a turtle analogue is better 
ARgh, i always get that wrong, ok Application programming interface - can't miss it next time
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 28th, 2001, 08:49 AM
#6
Hehe, keda, sometimes it really seems like an "advanced programmers interface"
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|