By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,533 Members | 2,102 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,533 IT Pros & Developers. It's quick & easy.

object oriented programming language

P: n/a
Is C an object oriented programming language?
Nov 13 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
Rookie wrote:
Is C an object oriented programming language?


If you have criteria for "being an OOPL", apply them to C and find out.
If you need technical knowledge *about C* to apply them, here's a place
to find out.

If you don't have such criteria, answers (be they "yes" or "no" or "it
depends") won't help you, because you won't know what they mean.

If you're just after random numbers, I take C to be an OOPL on odd
days of the week, and not an OOPL on the remaining days.

--
Chris "It must be Thursday" Dollin
C FAQs at: http://www.faqs.org/faqs/by-newsgrou...mp.lang.c.html
C welcome: http://www.angelfire.com/ms3/bchambl...me_to_clc.html
Nov 13 '05 #2

P: n/a

"Rookie" <a@a.co> wrote in message news:3f********@news.iprimus.com.au...
Is C an object oriented programming language?


C was not designed to be an OO language, however it is possible to design
programs which behave OO. C++ was designed to be the OO language with
similarities to C, but even it is not truly an OO language, although it is
OO enough for most, including myself.
Allan
Nov 13 '05 #3

P: n/a
"Rookie" <a@a.co> wrote in message news:3f********@news.iprimus.com.au...
Is C an object oriented programming language?


Check out the huge discussion I started with a simple question 3 days ago.
There's a lot of info on how you can achieve to do OOP in C :
http://groups.google.ca/groups?dq=&h....c%26start%3D0

There's a lot of info on the subject, as well as a war on netiquette, which
can always be educationnal if you're new around here. :)
Nov 13 '05 #4

P: n/a
Rookie writes:
Is C an object oriented programming language?


No. Only by using sophistry can one say that C is an object oriented
language.

Saying yes is along these lines:

Q: Is an SUV a suitable vehicle to drive from Cairo to Cape town?
A: Yes.

But I also agree with the poster who said that an answer to the question
probably will not be terribly helpful to you.
Nov 13 '05 #5

P: n/a
"Rookie" <a@a.co> wrote in message news:<3f********@news.iprimus.com.au>...
Is C an object oriented programming language?


C does not provide any tools to make object-oriented programming
straightforward or easy (there's no concept of inheritence in the C
language, for example), so it's generally not considered an OOPL.

However, it's possible to write OO code in C. It just won't look much
like C++ or Java or any other OOPL.
Nov 13 '05 #6

P: n/a
"Rookie" <a@a.co> wrote in message news:3f********@news.iprimus.com.au...
Is C an object oriented programming language?


I'm going to be bold and just say screw all these "well, kind of" posts and
just say, NO. Nearly anything I can imagine doing in C to make it "kind of"
object oriented could be done in nearly all languages. So if that's the
case, all languages are "kind of" OO. My confusion is why anybody would
want to do this in the first place. If you need OOP and like, C, use C++.

Nov 13 '05 #7

P: n/a
"Rookie" <a@a.co> wrote in message news:3f********@news.iprimus.com.au...
Is C an object oriented programming language?


I'm going to be bold and just say screw all these "well, kind of" posts and
just say, NO. Nearly anything I can imagine doing in C to make it "kind of"
object oriented could be done in nearly all languages. So if that's the
case, all languages are "kind of" OO. My confusion is why anybody would
want to do this in the first place. If you need OOP and like, C, use C++.

Nov 13 '05 #8

P: n/a
"Rookie" <a@a.co> wrote in message news:3f********@news.iprimus.com.au...
Is C an object oriented programming language?


I'm going to be bold and just say screw all these "well, kind of" posts and
just say, NO. Nearly anything I can imagine doing in C to make it "kind of"
object oriented could be done in nearly all languages. So if that's the
case, all languages are "kind of" OO. My confusion is why anybody would
want to do this in the first place. If you need OOP and like, C, use C++.

Nov 13 '05 #9

P: n/a

"Fao, Sean" <en**********@yahoo.comI-WANT-NO-SPAM> wrote in message
news:se**********************@news1.news.adelphia. net...
"Rookie" <a@a.co> wrote in message news:3f********@news.iprimus.com.au...
Is C an object oriented programming language?
I'm going to be bold and just say screw all these "well, kind of" posts

and just say, NO. Nearly anything I can imagine doing in C to make it "kind of" object oriented could be done in nearly all languages. So if that's the
case, all languages are "kind of" OO. My confusion is why anybody would
want to do this in the first place. If you need OOP and like, C, use C++.


What in the world is wrong with my newsreader? I truly only sent this
message one time but for some reason it keeps getting posted again. I've
canceled all but the original message but I apologize for those of you still
received this message more then once.

Nov 13 '05 #10

P: n/a
On Tue, 14 Oct 2003 20:14:04 +1000, "Rookie" <a@a.co> wrote in
comp.lang.c:
Is C an object oriented programming language?


Depends heavily on YOUR definition of the term.

Yes, because an executing C program consists of only two things,
functions and objects. And most functions operate on objects.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Nov 13 '05 #11

P: n/a
Rookie wrote:
Is C an object oriented programming language?


No. According to Bjarne Stroustrup in
"Why C++ is not just an Object-Oriented Programming Language"

http://www.research.att.com/~bs/oopsla.pdf

3 A Broad Definition of ``Object-oriented''

Given these general criteria for a definition of ''object-oriented''
you can find several plausible candidates,
and several communities have their own definitions.
However, I suggest we stick to the traditional definition
of object-oriented used within broad communities of programmers.
A language or technique is object-oriented
if and only if it directly supports:
[1] Abstraction - providing some form of classes and objects.
[2] Inheritance - providing the ability to build
new abstractions out of existing ones.
[3] Run-time polymorphism - providing some form of run-time binding.
This definition includes all major languages commonly referred to
as object-oriented: Ada95, Beta, C++, CLOS, Eiffel, Simula, Smalltalk,
and many other languages fit this definition.

The C computer programming language supports [1]
but not [2] or [3] directly. This doesn't mean that
you can't write object oriented programs in C. Good C programmers
write and always have written object oriented programs.
For example, fscanf and fprintf work as expected
no matter what kind of stream is pointed to by the first argument.

Nov 13 '05 #12

P: n/a
Fao, Sean wrote:
"Rookie" <a@a.co> wrote in message news:3f********@news.iprimus.com.au...
Is C an object oriented programming language?

I'm going to be bold and just say screw all these "well, kind of" posts and
just say, NO. Nearly anything I can imagine doing in C to make it "kind of"
object oriented could be done in nearly all languages. So if that's the
case, all languages are "kind of" OO.


I see your point, but tend to disagree, on the grounds that C is more
flexible than most programming languages, and hence can serve OO
purposes well if that is what the programmer wishes.

As others have pointed out in earlier threads here, a common style
of savvy C programming is de facto object-oriented: where
implementation details are written into a given source file and
declared static, while a well-chosen public interface from the
translation unit is provided by a small number of functions
published in a header file.

--
Allin Cottrell
Department of Economics
Wake Forest University, NC

Nov 13 '05 #13

P: n/a
Rookie <a@a.co> wrote:
Is C an object oriented programming language?


No, C is not an object oriented programming language as that term is
normally understood.

It is, on the other hand, quite possible to write object oriented
programs using C. You can write object oriented programs using almost
any programming language, but it is easier in some languages than in
others.

Object oriented languages have features that are intended to make it
easier to write object oriented programs. Such features can usually be
"faked" in other languages, but it takes a bit more work and discipline
from the programmers side.
--
<Insert your favourite quote here.>
Erik Trulsson
er******@student.uu.se
Nov 13 '05 #14

P: n/a
Rookie wrote:

Is C an object oriented programming language?


Object Oriented Design and Programming is a methodolgy.
OOD and OOP can be done in any language but some languages
have features which were designed to make OOP easier.

Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo no****@mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
"Anyone who says you can have a lot of widely dispersed people hack
away on a complicated piece of code and avoid total anarchy has never
managed a software project." - Andy Tanenbaum in 1992 on comp.os.minix
Nov 13 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.