object oriented programming - C
This is a discussion on object oriented programming - C ; what is actually object oriented programming ? whjy is it not used in c?...
-
object oriented programming
what is actually object oriented programming ? whjy is it not used in c?
-
Re: object oriented programming
On Thu, 24 Jun 2004 15:10:33 +0100, rockologic wrote
(in article
<05ea180656f5a9c777cec2358f15f283@localhost.talkaboutprogramming.com>):
> what is actually object oriented programming ? whjy is it not used in c?
See -
<http://www.amazon.co.uk/exec/obidos/...r_aps_books_1_
1/202-3164629-1247056>
Ian
--
Ian Robinson, Belfast, UK - <http://www.canicula.com>
Soapbox - <http://homepage.mac.com/ianrobinson/index.html>
-
Re: object oriented programming
On 2004-06-24 09:10:33 -0500, "rockologic" <shomnat_m@rediffmail.com> said:
> what is actually object oriented programming ? whjy is it not used in c?
Object oriented programming (OOP) is basically a scheme to make
programming more modular. It groups compound data structures (like C
structs) together with a set of a related functions (methods) in a
modular way. And yes, you can do object oriented programming in C, but
the language doesn't give you any special help with it.
There was a time when OOP was touted as the holy grail that was going
to revolutionize everything and drastically increase the productivity
of all programmers. It turned out to be well suited for creating GUI
interfaces and simulation software, but not a huge advantage to most
other programming.
Incidentally, back when I was in school (more years ago than I care to
contemplate), OOP hadn't been heard of yet, but "structured
programming" was being touted as the holy grail. From where I sit, OOP
is like structured programming taken to the next level. None of this
stuff is magic, it's just an ongoing search for better ways to organize
program code, especially when different people may have to work with it.
The other big idea for increasing programmer productivity is automatic
garbage collection. On the whole, it's probably more beneficial than
OOP.
--
Tony Belding, Hamilton Texas
-
Re: object oriented programming
Tony... You might want to add inheritence to that description
.
Without inheritance, you have object based programming. I would think
that it would be a lot of work to write polymorphic code in C.
http://www.geocities.com/jeff_louie/OOP/twisted1.htm
Regards
Tony Belding <zobeid@techie.com> wrote in message news:
> Object oriented programming (OOP) is basically a scheme to make
> programming more modular. It groups compound data structures (like C
> structs) together with a set of a related functions (methods) in a
> modular way. And yes, you can do object oriented programming in C, but
> the language doesn't give you any special help with it.
-
Re: object oriented programming
Jeff Louie wrote:
> Tony... You might want to add inheritence to that description
.
> Without inheritance, you have object based programming. I would think
> that it would be a lot of work to write polymorphic code in C.
No, macros allow to build easily polymorphic object in C:
#include <ooc/Object.h>
#include <mylib/Employee.h>
#include <mylib/Manager.h>
int
main(void)
{
Employee e = new(Manager);
protect(e); // protect against exceptions
callm(e, scan, stdin);
callm(e, print, stdout);
unprotect(e);
delete(e);
return 0;
}
Not much more complex than what you get in Objective-C.
ld.
Similar Threads
-
By Application Development in forum C
Replies: 168
Last Post: 10-21-2007, 08:00 PM
-
By Application Development in forum Software-Eng
Replies: 2
Last Post: 09-27-2007, 03:27 AM
-
By Application Development in forum Object
Replies: 5
Last Post: 09-11-2006, 11:30 PM
-
By Application Development in forum Object
Replies: 2
Last Post: 09-10-2006, 02:30 AM