Is necessary to switch to C++ or some object-oriented language?

A

ajba74

Hi fellows,

I am reading some books to learn the C programming language, and
sometimes I have the feeling that when somebody becomes a C expert, he
must learn a more modern and object-oriented language.

When I read things like "... C++ is an evolution of C ..." or "... C
is a subset of C++ ..." I tend to believe that I will have to learn C+
+ sooner or later. It sounds like C++ is the future and C is the past
(and will be no longer useful anytime soon).

And how about the other object-oriented language: Java. They say it is
very powerful and it seems to be everywhere.

So, I started to ask myself...

Is object-oriented better?
Is necessary to switch to C++ or some object-oriented language?
Is it true that C tends to be decreasingly used?
And finally ... why do people need object-oriented languages?

I am sorry for making so many questions.

Thank you all,

Arnaldo
 
U

user923005

Hi fellows,

I am reading some books to learn the C programming language, and
sometimes I have the feeling that when somebody becomes a C expert, he
must learn a more modern and object-oriented language.

When I read things like "... C++ is an evolution of C ..." or "... C
is a subset of C++ ..." I tend to believe that I will have to learn C+
+ sooner or later. It sounds like C++ is the future and C is the past
(and will be no longer useful anytime soon).

C++ is a fork in the language tree. C is not a subset of C++.
And how about the other object-oriented language: Java. They say it is
very powerful and it seems to be everywhere.

Java is very powerful and it is everywhere. It's a great thing to
write GUIs in.
So, I started to ask myself...

Is object-oriented better?

For some things it is.
Is necessary to switch to C++ or some object-oriented language?

No, it isn't.
Is it true that C tends to be decreasingly used?

I doubt it. Most of the C code will be in embedded applications. I
doubt if people will start writing most of their "toast pop-up
instructions" in C++ instead of C. C is designed for filter type
applications and the UNIX metaphor of doing things. It works fairly
well even with large tasks like operating systems (e.g. Linux) and
database systems (e.g. PostgreSQL).
And finally ... why do people need object-oriented languages?

Because they are more comfortable with an object model.
I am sorry for making so many questions.

Fortran and Cobol were both invented around 1950. Both are going
strong. If a language is useful, it survives and evolves.
I predict that most business code will still be in Cobol 25 years from
now.
 
A

Anthony Irwin

I am reading some books to learn the C programming language, and
sometimes I have the feeling that when somebody becomes a C expert, he
must learn a more modern and object-oriented language.

I am starting to find more apps are going to c++ in the linux world
although gtk apps are still mostly in C. And of cause there are still
tons of librarys and system stuff that is still written in c.

The c++ apps are probably c++ because there are more c++ toolkits.
e.g. qt, wx widgets, fltk, fox toolkit etc.
When I read things like "... C++ is an evolution of C ..." or "... C
is a subset of C++ ..." I tend to believe that I will have to learn C+
+ sooner or later. It sounds like C++ is the future and C is the past
(and will be no longer useful anytime soon).

I am still fine tuning my c skills and often wonder if I would be
better off doing c++. Not sure about this as I still like the idea of
c although c++ does seem to have some things I would like to use.

I think that I will end up learning c++ as there are a number of
projects using it and I am mainly learning c to work on free software
projects.

kind regards,
Anthony Irwin
 
M

Martin Ambuhl

Hi fellows,

I am reading some books to learn the C programming language, and
sometimes I have the feeling that when somebody becomes a C expert, he
must learn a more modern and object-oriented language.

You should know a number of languages in order to have the right tools
for any particular task. C is as "modern" a language as you could want.
Even so, assuming "modern" means something positive is an error.
Object-oriented programming is well within the capabilities of C. There
are many object-oriented languages, and some are better than others.
When I read things like "... C++ is an evolution of C ..."

While true, it is a vacuous thing to say. Remember that the fact that
one thing evolved from another does not make it better. Don't let that
piece of religious mysticism cloud your mind. And the C that C++
"evolved" from was older than the *old* standard C (ANSI C89 or ISO C90)
or the current standard C (ISO C99). Standard C and C++ both evolved
from the same base language on different paths. So what?
or "... C
is a subset of C++ ..."

And that one is a lie.
I tend to believe that I will have to learn C++
sooner or later.

Why should an irrelevant statement and an outright lie lead you to
believe anything?
It sounds like C++ is the future and C is the past
(and will be no longer useful anytime soon).

And that is just silly.
And how about the other object-oriented language: Java. They say it is
very powerful and it seems to be everywhere.

So, I started to ask myself...

Is object-oriented better?

Not necessarily.
Is necessary to switch to C++ or some object-oriented language?

Not necesssrily.
Is it true that C tends to be decreasingly used?
No.

And finally ... why do people need object-oriented languages?

Mainly to know the buzzwords the job interviewers know.
 
A

arnuld

Hi fellows,

Hi, i still a newbie but the difference is that i live with
programmers, here on comp.lang.c, rather than with academics. so take
my advice with a "grain of salt"

:)
I am reading some books to learn the C programming language, and
sometimes I have the feeling that when somebody becomes a C expert, he
must learn a more modern and object-oriented language.

that shows that you are a PURE newbie, you need to throw away that
kind of feeling, it happened to me many times and it will waste yours
lots of time by putting you into lots of thinking instead of lots of
coding.

i speak from experience. you need to solve problems by coding, you do
not need another language. trust me.

When I read things like "... C++ is an evolution of C ..."

i will correct it:

"... C++ is a specially desired inherent complex evolution of C ..."

or "... C is a subset of C++ ..."

complete NON-SENSE

i tried C++ for 4 months, never been able to learn it and now i am
learning C from K&R2. it is a completely different experience of
solving problems.


I tend to believe that I will have to learn C+
+ sooner or later. It sounds like C++ is the future and C is the past
(and will be no longer useful anytime soon).

in corporate world, C++ is being used at many places today. e.g. in my
country (India), if you search for C jobs,you will get very few but
for C++, Java or .NET you will get loads of hits on monsterindia.com,
naukri.com, clickjobs.com

but i need to mention that corporate world do NOT use good tools to
solve problems. they use the FADs most of the times.

And how about the other object-oriented language: Java. They say it is
very powerful and it seems to be everywhere.

which "everywhere" you are referring to:

corporate - yes
UNIX culture - definitely NO
GNU tools - definitely NO
schools - yes


as is said, if a language is used everywhere, it doe snot mean it is
good, may be it is good but most of the times, it is not.

Is object-oriented better?

sometimes and not some other times. OOD is a method of solving
problems by coding, so is procedural, logic, declarative, functional
and generic programming.

every method(or paradigm, or style) is good for solving some problems
but bad for others, OOD is not an exception here.
Is necessary to switch to C++ or some object-oriented language?

for Job, YES you have to
for your business may be, may be not

Is it true that C tends to be decreasingly used?

"decreasingly used" where corporate, schools, research etc.

in corporate yes but still you need C for that because you will always
come across with C code when working as a C++ software developer

And finally ... why do people need object-oriented languages?

because OOD solves some kinds of problems, in an excellent way.

why do some people like Common Lisp?

because it solves a large amount of problems in an excellent way
I am sorry for making so many questions.

Arnaldo, you need to *code*, trust me. i was in the same situation and
i askedmany questions like the one you asked but now i got out of it.
i am learning coding in C

:)

BTW, "user-----" is right when he said:

"If a language is useful, it survives and evolves"

i see, same is true for Common Lisp, OCaml and Mercury.

i met a COBOL programmer a few days ago. she knows nothing except of
COBOL and she does coding for IBM mainframe located at the capital of
my country.


before posting anything make sure you "search" the archives.most of
the times, i found, my question was already asked and answered here.

good luck
 
I

Ivar Rosquist

Is object-oriented better?

Object-oriented programming is a fad, like many other fads that
have plagued to commercial computing application development world. That
does not mean it is useless. Rather, it just means it is not the magic
bullet that many would have us believe. Some problems are well suited to
an object-oriented approach, some others are not. Some people are
comfortable with an object-oriented approach, some other people are not.
Is necessary to switch to C++ or some object-oriented language?

If you want to do, say, GUIs or classify animals, maybe. If you
are interested in, say, working close to the metal, no.
Is it true that C tends to be decreasingly used?
No.

And finally ... why do people need object-oriented languages?

What people?
 
L

llothar

Hi fellows,

Looks like you are a complete newbie.

The future of C is questionable. It is or will be a niche language
soon.
Used only in embedded development or some low level tasks like
operating
systems etc.

The reason is simple: Most important libraries use at least some C++
features,
and it is a pain in the ass to use C for GUI codeing (with the only C
toolkit
GTK). So application development is C++ or another language (like
Java, Eiffel,
Fortran, Lisp) depending on problem area and your project leader.

If you want to be a good programmer you need to learn about a half
dozend or more
languages. My current project has about 7 different languages (C, C++,
Eiffel, Ruby,
Lua, Python, PHP) and i know about half a dozend more. So first learn
C, learn as much
C++ to understand the code and be able to use Templates, learn Lisp,
learn (or look at)
a functional language.

If you lazy and don't want to stick to one language only, please
become an system
administrator and not a programmer - i don't want see any one-language
person as
(theoretical) team colleagues. It a pain to work with them. Have done
this too many
times and often have to do there work too.
 
R

Randy Howard

Looks like you are a complete newbie.

The future of C is questionable. It is or will be a niche language
soon.

I remember hearing that shouted from all the trade rags far and near
starting over 20 years ago. C apparently takes longer to die than a
bad actor in a low-budget production of a Shakespeare play.
Used only in embedded development or some low level tasks like
operating systems etc.

Yeah, like every single operating system that is running outside of
university research lab. Pretty narrow presence there. IOW, C code is
running on basically every desktop, portable, workstation and server on
the planet. Very, very poor market penetration. If C was a stock on
the Nasdaq, it would definitely be plummeting.

[I hope everyone's sarcasm detectors are enabled]

If you want to be a good programmer you need to learn about a half
dozend or more languages.

You finally said something that isn't demonstrably false. I don't
totally agree, you don't have to do that to be a good programmer, but
I'm fairly convinced that it improves the odds quite a bit. Most of
the really good programmers I know have a lot more than that in their
toolkit, but that's partly a function of time. Most of them achieve
that status only after a lot of years in the practice of it, and
languages come and go during long time spans. C is the only one that
has been around during the entire time I've been programming and not
gone into the dustbin of history, and will pretty obviously outlive me
by a substantial time period.
 
L

llothar

I remember hearing that shouted from all the trade rags far and near
starting over 20 years ago. C apparently takes longer to die than a

Well and it almost reached this state in the last years.
Yeah, like every single operating system that is running outside of
university research lab. Pretty narrow presence there. IOW, C code is

So it is used in about 10 different applications. This does sound very
much like a niche for me.

And yes it the "specification language" of most operating systems,
except maybe MacOSX.
 
C

Charlton Wilbur

RH> Most of them achieve that status only after a lot of years in
RH> the practice of it, and languages come and go during long time
RH> spans. C is the only one that has been around during the
RH> entire time I've been programming and not gone into the
RH> dustbin of history, and will pretty obviously outlive me by a
RH> substantial time period.

Surely you aren't relegating Lisp, COBOL, and FORTRAN to the dustbin
of history?

Charlton
 
J

John Bode

On Mar 21, 12:18 am, (e-mail address removed) wrote:

[snip]
So, I started to ask myself...

Is object-oriented better?

Like everything else in software, the answer is, "it depends." Some
solutions are easier to visualize and implement using object-oriented
languages or techniques. Some solutions are easier to visualize and
implement using procedural techniques.

OOP comes with its own benefits and costs, and in practice some of the
more hyped benefits (increased productivity, decreased development
time, significant code reuse) haven't materialized to a significant
degree. One wag described inheritance as a good way to make sure that
the bad decisions you made at the beginning of a project stay with you
forever. Any code reuse is offset by the amount of code you have to
write to take advantage of it, and at best what you get is better
described as interface reuse. And increased productivity comes
through improvements in the overall development process, not just
choice of programming language.
Is necessary to switch to C++ or some object-oriented language?

No. It *is* possible to do object-oriented programming using C,
although it's not straightforward and you'll probably need some
additional tools. A language that's designed to be OO will make OO
programming easier (or at least more straightforward).

Having said that, I think it's a good idea to learn C++ and Java (and
Python and Haskell and Lisp and...); the more languages you expose
yourself to, the better able you will be to choose the appropriate one
for the task.
Is it true that C tends to be decreasingly used?
From what I've seen personally, yes; my company is using C# on the
Windows side and C++ and Java on the Linux side. However, my company
is just one of thousands, so that may or may not be as widespread as I
think.

What *is* true is that C is a product of the early 1970s, and its age
is showing. It was designed in the age minicomputers and glass ttys,
and so has no built-in support for graphics or networking or sound or
a number of other technologies that we now take for granted, but were
almost unheard of back then.

The cool thing about modern languages like Java is that they *do*
provide built-in support for all those things, and other stuff
besides.

And don't forget, while C may be decreasingly used for new projects,
there's over 30 years' worth of legacy software out there that has to
be maintained; there's plenty of work in C for anyone who wants it.
And finally ... why do people need object-oriented languages?

Again, some solutions are easier to implement in an object-oriented
language (concurrency is one area where I think the OO approach makes
life easier). There's also a claim that very large projects are
easier to manage using OOPLs, although in practice I haven't noticed a
huge difference.
 
R

Randy Howard

Well and it almost reached this state in the last years.

No it hasn't. Feel free to stop spewing BS whenever the mood strikes
you. You're not fooling anyone here.
So it is used in about 10 different applications. This does sound very
much like a niche for me.

Are you really a programmer? Your logic pin appears to be tied to
ground.
And yes it the "specification language" of most operating systems,
except maybe MacOSX.

What is a specification language? OS X is written in C, some assembler
and other odds and ends. Objective-C is recommended for app
development for the Aqua GUI environment, which is a different thing
altogether. You are not expected to understand this.
 
G

Guillaume

llothar said:
And yes it the "specification language" of most operating systems,
except maybe MacOSX.

Are you sure you know what MacOS X is based on?

The core: a BSD Unix: C code.
The GUI: Carbon: C Code; Cocoa: Objective-C.

No C++ around, and mostly C.
(BTW, Objective-C is, IMO, a far cleaner OOP language than C++.)
 
R

Roland Pibinger

complete NON-SENSE

Syntactically, C is a subset of C++ with minor exceptions. This fact
was the main reason for C++'s initial success.
"decreasingly used" where corporate, schools, research etc.
in corporate yes but still you need C for that because you will always
come across with C code when working as a C++ software developer

Actually, C++ is "decreasingly used". C is the only portable system
programming language and, for this reason alone, will outlive its
successors.

Best regards,
Roland Pibinger
 
U

user923005

Syntactically, C is a subset of C++ with minor exceptions. This fact
was the main reason for C++'s initial success.

Even Bjarne Stroustrup has admitted that this claim is false.
C is not a subset of C++ with minor exceptions.
Actually, C++ is "decreasingly used". C is the only portable system
programming language and, for this reason alone, will outlive its
successors.

C++ also has a standard, as does Fortran, and many others. Therefore,
these languages are portable.
GCC and G++ are pretty much available on anything you can think of and
some things you can't.
I guess that the places where there is a C compiler and no C++
compiler is limited to a few DSPs.

IMO-YMMV.
 

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
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top