Article View: rec.games.programmer
Article #1987Re: Should I learn C or C++ first?
From: Denys Larry
Date: Thu, 17 Aug 1995 02:56
Date: Thu, 17 Aug 1995 02:56
111 lines
6282 bytes
6282 bytes
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 won't say C++, but I'll use object oriented languages instead; but they stress code reuse. To make a 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. 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:
<1995Aug16.205658.59134@cc.usu.edu>Path:
arc1-ca.pugleaf.net!millville.declab.usu.edu!slmyvReferences:
<3v6qkj$8ak@news1.best.com> <3v713f$2bd@ixnews6.ix.netcom.com> <1995Aug16.145426.8003@ohstpy>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!millville.declab.usu.edu!slmyv Newsgroups: rec.games.programmer,comp.lang.c++ Subject: Re: Should I learn C or C++ first? Message-ID: <1995Aug16.205658.59134@cc.usu.edu> From: slmyv@millville.declab.usu.edu (Denys Larry) Date: 16 Aug 95 20:56:58 MDT Reply-To: slmyv@millville.declab.usu.edu (Denys Larry) References: <3v6qkj$8ak@news1.best.com> <3v713f$2bd@ixnews6.ix.netcom.com> <1995Aug16.145426.8003@ohstpy> Distribution: world Nntp-Posting-Host: millville.declab.usu.edu