🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.games.programmer
Article #2005

Re: Should I learn C or C++ first?

#2005
From: vancleef
Date: Sat, 19 Aug 1995 09:20
148 lines
7825 bytes
In article <1995Aug16.205658.59134@cc.usu.edu>, slmyv@millville.declab.usu.edu (Denys Larry) writes:
> In article <1995Aug16.145426.8003@ohstpy>, vancleef@ohstpy.mps.ohio-state.edu writes:
> 
> |>In article <1995Aug15.233327.59035@cc.usu.edu>, slmyv@millville.declab.usu.edu (Denys Larry) writes:
> |>> In article <1995Aug15.014740.7996@ohstpy>, vancleef@ohstpy.mps.ohio-state.edu writes:
> |>> |>I have written more C code than you can shake a stick at, I have written
> |>> |>object-oriented code in C, and, being a recent C++ convert, C++
> |>> |>has improved the quality and maintenance requirements of my work by
> |>> |>so many orders of magnitude it isn't even funny.
> |>> 
> |>>   Let's not exaggerate here.  How many times is it?  100? 1000? 10000? 
> |>
> |>It feels to me alot easier than debugging code all day long. I say 100. SO
> |>I should have said a couple :) Why do you care?
> 
>   Sidetrack off the issue:  Hype in the computer industry is a pet peeve
> of mine, and I don't think it does the cause of C++, whether that cause
> is good or bad, any good at all.  After numerous arguments with people
> about C++, some of which involved people looking me straight in the eye
> and claiming outrageous gains productivity, I remain unconvinced that
> the gains are very significant for a lot of problem domains; in some 
> problem domains, ones that have a natural object oriented structure like 
> GUI coding, the gains are very good.  But I don't think the final chapter
> has been written in the analysis of C++.
>   Hype, in the computer industry, has a way of building on itself.
> While I am not going to cry any tears for the advocates of Eiffel and
> C+@ and their opinion that their cherished languages have been steam-
> rolled by the C++ express train, I do think they have a valid point
> that the industry is too obsessed with C++ to give their languages
> a fair shake.  But, pehaps, Eiffel will probably have it's time in the 
> sun sometime in the future.
> 
>   As quality and maintenance of C++ code, I think it's a mixed bag.
> I do think that the worst, convoluted C++ code is far worse to work
> with than the worse, convoluted C code.  For some naturally object
> oriented problem domains, C++ code would be clearly superior than
> trying to kludge object oriented properties into C.  For most problem
> domains, I don't think there is much of a difference.
> 
> 
> |>> |>The amount of code you need to write in C vs. C++ is about 20:1
> |>> |>by an estimate I did last year. If you like to type alot
> |>> |>and debug code, C is the way to go. If you liek to do the same
> |>> |>thing over and over and over again, only slightly different, use C. 
> |>> |>If your time is valuable, then use C++. 
> |>> 
> |>>   BULLSHIT!!   If you saw a 20:1 improvement, then you are an incomp-
> |>> etent C programmer.  Do you think that C++ invented code reuse?  Ever
> |>> used ar?  (Lib tool for PC heads.)  A good C programmer will have
> |>> made many libraries of commononly used routines and will simply be
> |>> able to link with his existing libs or modify code that he has lying
> |>> around.
> |>
> |>Actually I meant 2:1, but the delete key doesn't work with this link, 
> |>again why do you care?
> 
>   I'd believe 2:1 for some types of programming.  But this thread is
> also running in rec.games.programmer (where I responded to it), and 
> since that group is mainly concerned about programming low-level
> graphics routines, I don't believe a 2:1 improvement for that kind of
> programming for one second.  Most of the problems discussed in that
> group are about as un-object oriented as you can get.
> 
> 
> |>>   You write more code in C++.  You carefully craft each object in 
> |>
> |>Actually I write less.
> 
>   Without knowing what kind of programming you do, It's hard to argue
> the point.  But I'd like to know what kind of justification you have
> for that statement.  Is it because of extensive use of objects similar
> to what is contained in STL?  Or some other reason?
> 
> |>> the hopes that the extra time you spend today will pay off three
> |>> months down the road if you need to use the object again.  This
> |>
> |>Actually it begins paying off immediately.
> 
>   This I also don't believe.  I think that each language has its own
> ambiance, tradition, and "feeling" about it.  While, as the saying
> goes, the determined programmer can write FORTRAN in any language,
> each language has a different "feel" to it.  When I write assembly
> code, cycle counts of routines become the most important thing.  C
> sort of engenders writing just the functions that are necessary for
> getting the job at hand done.  

I am leaving all of this regurgitated commentary as a tribute
to the C programming language. Real C++ programmers will
know what I am talking about :)


> I won't say C++, but I'll use object
> oriented languages instead; but they stress code reuse.  To make a
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
        
	as opposed to, 'reinventing the wheel' every time you
	want to make some small logic changes? You are going to
	have alot of work to do to convince me that I should
	'get back to C'. BTW, if you think wring a 'few C function'
	is going to get you anywhere in the real world, let me
	stress you would never pass the interview screening for
	my ($G) company I happen to be a slave of :)

> properly designed and implemented object takes longer than writing
> the few C function that it might otherwise take.  I don't think it
> pays off immediately, but it is an investment in the future.  Some-
> times it's not worth making that investment.



Writing a bunch of C library functions is notan 'investmen in the
future' for me. Just as an example, at me real job, I had a need
for some file IO functions, but I was able to, at lunch time,
to grab some stuff I usiing to manage my fantasy football league
in a matter of minutes when I found I needed that. This included
the ability to do complex file I/O and
database specific structure indexing.

Try that with C. Have fun. Tal to you next week when you get the
first prototype running (meanwhile clientes have $200K waiting for
you to debug your C code).

Reality and books are two diffeent worlds pal.


> 
> BTW, I program in a mix of object oriented C++ and straight C and, 
> when time permits, assembly.  Even for straight C code I use a C++
> compiler and I think that anyone who has a choice and doesn't use a
> C++ compiler is a fool.  There are just too many amenities that C++
> adds to C to pass up.  Compared to using olod K&R C compilers, C++
> is a dream come true. But I also don't see the reason why people like
> you denigrate C so much.  You treat it and speak of it as if it's out
> of the dark ages.  The heart of C++ is C.
> 
>   And back to the subject at hand:  Do you think you'd be a worse,
> better, or the same C++ programmer you are today if you hadn't spent
> the time you did programming in straight C in the past?
>   I believe that the time I spent programming in straight C was
> immensely valuable, and I think I would have been poorer to have
> jumped right into object oriented programming.
> 
> 
> |>-Garrett
> 
> 
> LDDenys
> 
Technical Details
Message-ID: <1995Aug19.052025.8015@ohstpy>
Path: arc1-ca.pugleaf.net!ohstpy.mps.ohio-state.edu!vancleef
References: <3v6qkj$8ak@news1.best.com> <3v713f$2bd@ixnews6.ix.netcom.com> <1995Aug16.205658.59134@cc.usu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!ohstpy.mps.ohio-state.edu!vancleef
From: vancleef@ohstpy.mps.ohio-state.edu
Newsgroups: rec.games.programmer,comp.lang.c++
Subject: Re: Should I learn C or C++ first?
Message-ID: <1995Aug19.052025.8015@ohstpy>
Date: 19 Aug 95 05:20:25 -0400
References: <3v6qkj$8ak@news1.best.com> <3v713f$2bd@ixnews6.ix.netcom.com> <1995Aug16.205658.59134@cc.usu.edu>
Distribution: world
Organization: The Ohio State University, Department of Physics