Joe Mayo said:
I think I become more and more alone...
Everybody tells me that C++ is better, because once a project becomes very
large, I should be happy that it has been written in C++ and not C.
I'm the only guy thinking that C is a great programming language and that
there is no need to program things object oriented.
Many people says also that they save more time by programming projects
object oriented, but I think its faster to program them in a good
structured functional way.
What do you think?
You mean "procedural". Functional programming is what lisp does.
By "object-oriented programming" we mean a program with abstracted entities
which enter into relationships with each other. Eg if a car, motorbike, and
truck in the program all have ways of being "driven", and that has a point
of commonality, then the program is object-oriented. The method is
independent of language, but in practise to write a non-trivial
object-oriented program in C ylou need to write an interpreter for another
lanauge, whilst in C++ it is easy.
I'd say that something like 80% of programs are naturally procedural, with
20% lend themselves to object-oriented design. Procedural design is easier
to do than object-oritented desing, and usually easier to document. However
object-oriented design is more tolerant of unpredicated extensions. Claims
that object-oriented programs are easier to debug or more reusable are in my
experience unfounded.
An adventure program, for example, has objects like swords, daggers, and
arrows, which are all "weapons", and object-oriented design is a powerful
competitor here. It is also very good for GUIs where all the windows work in
much the same way, but have little idiosyncracies that are better expressed
by code than by parameters. However object-oriented design can lead to
traps. For instance if you want to sort a list of strings using three or
four functions, it is a lot easier to pass the appropriate function to
qsort() than to override inequality operators. You also get subtle bugs
where the interface isn't quite adhered to, for instnace a light might have
colour, position and intensity. Which is fine, until you want to implement a
monochromatic yellow laser.
If you are not doing object-oriented desing, it is better to avoid C++. The
reason is that people are always tempted to play with the language. When you
embed a few C++ features in a basically procedural program the result is
almost always a kludge. C marks the program very clearly as a structured
program.
To be fair to C++, the projects that benefit from object-oriented design
also tend to be the larger ones.