object oriented programming language

C

Chris Dollin

Rookie said:
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.
 
A

Allan Bruce

Rookie said:
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
 
O

osmium

Rookie said:
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.
 
J

John Bode

Rookie said:
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.
 
F

Fao, Sean

Rookie said:
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++.
 
F

Fao, Sean

Rookie said:
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++.
 
F

Fao, Sean

Rookie said:
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++.
 
F

Fao, Sean

Fao said:
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.
 
J

Jack Klein

E

E. Robert Tisdale

Rookie said:
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.
 
A

Allin Cottrell

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.
 
E

Erik Trulsson

Rookie said:
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.
 
E

Erik de Castro Lopo

Rookie said:
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 (e-mail address removed) (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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,085
Messages
2,570,597
Members
47,219
Latest member
Geraldine7

Latest Threads

Top