Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   C (functional programming) VS C++ (object oriented programming) (http://www.velocityreviews.com/forums/t541413-c-functional-programming-vs-c-object-oriented-programming.html)

Joe Mayo 10-02-2007 01:32 PM

C (functional programming) VS C++ (object oriented programming)
 
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?

--
-= Joe Mayo* =-
* This is a fake name.

Mark Bluemel 10-02-2007 01:36 PM

Re: C (functional programming) VS C++ (object oriented programming)
 
Joe Mayo wrote:
> I think I become more and more alone...


Try bathing occasionally...

> Everybody tells me that C++ is better,


For some value of "Everybody"...

> because once a project becomes
> very large, I should be happy that it has been written in C++ and not C.


No you should be sad that it was written in C++ not Intercal.

> I'm the only guy thinking that C is a great programming language and
> that there is no need to program things object oriented.


Really? You're the only guy thinking that? That's news to me...

> 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?


I think that that you should find a group which discusses the pros and
cons of various languages... This probably isn't it.

Richard Heathfield 10-02-2007 01:43 PM

Re: C (functional programming) VS C++ (object oriented programming)
 
Joe Mayo said:

> I think I become more and more alone...
> Everybody tells me that C++ is better,


Well, not everybody. The people who tell you C++ is better than C fall into
two categories:

1) the ones who have never spent the time necessary to master C;
2) the ones who /have/ spent the time mastering both C and C++, and who
have discovered that C++ fits the way they think about programming better
than C does.

Conversely, the people who tell you C is better than C++ fall into two
categories:

1) the ones who have never spent the time necessary to master C++;
2) the ones who /have/ spent the time mastering both C and C++, and who
have discovered that C fits the way they think about programming better
than C++ does.

<snip>

> I'm the only guy thinking that C is a great programming language and
> that there is no need to program things object oriented.


No, you aren't.

> Many people says also that they save more time by programming projects
> object oriented,


Great! Let them. Meanwhile, feel free to save more time by programming them
the way that suits you best. If that means using C, use C.

> What do you think?


They're programming languages, not religions.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999

santosh 10-02-2007 01:52 PM

Re: C (functional programming) VS C++ (object oriented programming)
 
Mark Bluemel wrote:
> Joe Mayo wrote:

<snip>

>> 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?

>
> I think that that you should find a group which discusses the pros and
> cons of various languages... This probably isn't it.


Such a group might be comp.programming

But this particular topic has been beaten to death countless times all over
the Net. Broaching it again is only likely to start yet another flame war.



jacob navia 10-02-2007 02:00 PM

Re: C (functional programming) VS C++ (object oriented programming)
 
Joe Mayo wrote:
> 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?
>


Customer: Look jacob, you wrote the stuff in C!
me: Yes why?
Customer: No structure, no classes, no nothing. Besides we do
not have anybody that knows C here!

At the same time, as more and more people decide that C is hopeless,
the C++ people advance, making progress in all directions.

I still believe that a simple non object oriented language like C
has a place in software development where it offers speed and
transparency.

Central to this situation is the standards committee, that for the time
being has decided to do... well nothing until 2019 or later. Small steps
are done, they declared "gets" deprecated, and there are some very
interesting TR in the pipeline but nothing is definitely adopted
into the standard. C 2009 is dead as it seems.

And this group, with the core "regulars" is an example of people
living in the past, without even noticing or acknowledging that
data processing is evolving, that all languages must adapt or disappear.

Both GNU and Microsoft agree: C is dead. Gcc still hasn't gotten to
accept the C99 standard fully, and Microsoft ignores it. At least
Microsoft tries to participate in the standards committee, they proposed
their "safer C" extensions to the library, what is a major advance.
The GNU people do not discuss C anymore, and their compiler is a C++
compiler, where all development is done.

There are no technical reasons for this situation. It could be possible
to clean and expand the standard library, one of the most glaring
deficiencies of the language. Designed in the 70s, it hasn't changed
since then, and it shows!

No abstraction, low level, dangerous procedures like strncpy, gets,
asctime, and MANY others. It knows nothing about containers, hash
tables, stacks, linked lists. The zero terminated strings are the only
string type supported.

Making a better string library, allowing for operator overloading for
containers and new numeric types, improving the language to adapt it
to the new hardware environment available is frowned upon, "that
wouldn't be C", as if C would disappear if we put strncpy and gets
in the trash can.

I have invested the last 12 years of my life working to improve the
situation. The lcc-win32 implementation of C99 is one of the most
successful around, and in August we passed the *half million*
downloads.

The interest for C is still big, but this has been an effort
of a few people, that have invested an enormous amount of work
into that implementation.

Will it be possible to turn this tide around?

Can a simple language like C exist?

Yes, of course. It needs a rewrite of the standard library, and
some syntactic sugar to accommodate containers, lists, stacks, and other
data structures into a standard library that could be much simpler
to use than the STL, but much more efficient and adapted to
smaller memory footprints.

This could be done with the extensions I have proposed here (and
in comp.std.c). They can be reviewed here:

http://www.q-software-solutions.de/~jacob/proposal.pdf

jacob


--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32

jacob navia 10-02-2007 02:05 PM

Re: C (functional programming) VS C++ (object oriented programming)
 
Mark Bluemel wrote:
> Joe Mayo wrote:
>> I think I become more and more alone...

>
> Try bathing occasionally...
>
>> Everybody tells me that C++ is better,

>
> For some value of "Everybody"...
>
>> because once a project becomes very large, I should be happy that it
>> has been written in C++ and not C.

>
> No you should be sad that it was written in C++ not Intercal.
>
>> I'm the only guy thinking that C is a great programming language and
>> that there is no need to program things object oriented.

>
> Really? You're the only guy thinking that? That's news to me...
>
>> 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?

>
> I think that that you should find a group which discusses the pros and
> cons of various languages... This probably isn't it.


You are the typical example of many people here:

Arrogant and prone to verbal violence without any justification:

> Try bathing occasionally...


Ahhh how comic!

> I think that that you should find a group which discusses the pros and
> cons of various languages... This probably isn't it.


Of course not!

This group doesn't discuss C. It is just for people like you that
get their "kicks" by insulting others, being nasty, and just ignoring
the issues the OP raised!

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32

John Bode 10-02-2007 02:09 PM

Re: C (functional programming) VS C++ (object oriented programming)
 
On Oct 2, 8:32 am, Joe Mayo <joe.m...@supermail.tld> wrote:
> 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?


I think you need to look up the definition of functional programming,
because C is *not* a functional programming language. Haskell and ML
are functional languages.

Both procedural and object-oriented techniques (as well as functional
techniques) have their strengths and weaknesses. IME some solutions
are easier to visualize and express in terms of objects rather than
procedures (concurrency is one area where I think an object-oriented
approach is much cleaner and easier to understand).

I've been working with C++ for several years now, and there are a lot
of areas where I prefer it to C (string handling alone is orders of
magnitude less frustrating in C++). But there are times when I don't
need the overhead, and a straight C solution will work just as well.

Here are some lessons I've learned over the years, FWIW:

1. There are no magic bullets
2. All programming languages suck
3. It's always in your best interest to learn and explore as many
different programming languages as you can, because one size does
*not* fit all.


jacob navia 10-02-2007 02:29 PM

Re: C (functional programming) VS C++ (object oriented programming)
 
John Bode wrote:
> On Oct 2, 8:32 am, Joe Mayo <joe.m...@supermail.tld> wrote:
>> 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?

>
> I think you need to look up the definition of functional programming,
> because C is *not* a functional programming language. Haskell and ML
> are functional languages.
>


Important clarification. C is just structured programming, not
"functional" programming.

> Both procedural and object-oriented techniques (as well as functional
> techniques) have their strengths and weaknesses. IME some solutions
> are easier to visualize and express in terms of objects rather than
> procedures (concurrency is one area where I think an object-oriented
> approach is much cleaner and easier to understand).
>
> I've been working with C++ for several years now, and there are a lot
> of areas where I prefer it to C (string handling alone is orders of
> magnitude less frustrating in C++).


Yes, this is true. Hence my efforts to improve this part of C. But
many people here believe that the only possible string type is just
those zero terminated buffers!


> But there are times when I don't
> need the overhead, and a straight C solution will work just as well.
>


Exactly. And C could be the language that fills those needs, if
it had a slightly better run time and syntax.

> Here are some lessons I've learned over the years, FWIW:
>
> 1. There are no magic bullets
> 2. All programming languages suck
> 3. It's always in your best interest to learn and explore as many
> different programming languages as you can, because one size does
> *not* fit all.
>


I agree with that.


--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32

Mark Bluemel 10-02-2007 02:31 PM

Re: C (functional programming) VS C++ (object oriented programming)
 
jacob navia wrote:
> Mark Bluemel wrote:

[Snip]
> You are the typical example of many people here:
>
> Arrogant and prone to verbal violence without any justification:


Some degree of arrogance, I'm prepared to own up to, I suppose.

"Prone to verbal violence"? I'm not sure my record is that bad.

> > Try bathing occasionally...

>
> Ahhh how comic!


It amused me at the time. You are welcome to ignore or killfile me if my
postings consistently offend you.

> > I think that that you should find a group which discusses the pros and
> > cons of various languages... This probably isn't it.

>
> Of course not!
>
> This group doesn't discuss C.


Some of us try to... In this case I didn't and still don't see any
value in a "C vs C++" debate in this newgroup...

However, my last sentence in the paragraph you quoted deliberately left
room (by the use of the word "probably") for others who feel differently.

> It is just for people like you that
> get their "kicks" by insulting others, being nasty,


I don't think that in general my postings in this group are about
insulting people or being nasty. If I have given that impression, I'm
rather disappointed.

However, I do reserve the option of having an occasional jibe at someone
who I feel deserves it...

In this case, someone using an avowed false name posted something that
looks like provoking an unprofitable exchange of hot air.

> and just ignoring
> the issues the OP raised!


What issues did he raise? Nothing solid enough to really discuss. Just a
startpoint for airing prejudices.

jacob navia 10-02-2007 02:38 PM

Re: C (functional programming) VS C++ (object oriented programming)
 
Mark Bluemel wrote:
>
> What issues did he raise? Nothing solid enough to really discuss. Just a
> startpoint for airing prejudices.


And maybe looking earnestly into the C library and thinking a bit:

"Maybe we should reconsider this stuff" ???

Never occurred to you that many critiques of C are completely justified
and we should address those?

There is no point in "hot air" discussions but an earnest analysis
of the faults in the library would be a better starting point.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32


All times are GMT. The time now is 01:58 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.