Re: C++ Compiling Problems

From: John Summerfied (debian_at_herakles.homelinux.org)
Date: 05/24/05

  • Next message: John Summerfied: "Re: C++ Compiling Problems"
    Date: Tue, 24 May 2005 17:36:57 +0800
    To: For users of Fedora Core releases <fedora-list@redhat.com>
    
    

    Matthew Miller wrote:
    > On Mon, May 23, 2005 at 10:07:42PM +0800, John Summerfied wrote:
    >
    >>>Brian Kernighan and Dennis Ritchie. As I said before, C is an elegant and
    >>>small language, and this book is all you need. (Although you may also want
    >>>to pick up The UNIX Programming Environment by Kernighan and Rob Pike.)
    >>
    >>K&R C is no longer current, and I think it will give gcc severe heartburn.
    >
    >
    > As mentioned before, the updated second edition is ANSI C. That's not C99,
    > but gcc will be completely happy.
    >
    >
    >
    >>There are altogether too many mistakes a C programmer can make that will
    >>give rise to all sorts of program bugs including buffer overruns,
    >>pointer overruns and underruns and many more.
    >
    >
    > Same with C++. *shrug*.
    >
    >
    >>There are uses for C; it was originally designed for programming
    >>operating systems and such, and really is not well-suited at a
    >>general-purpose programming language.
    >>The act you _can_ write almost any program you can conceive in C doesn't
    >>mean you should do so.
    >
    >
    > The fact that you *can* write bad programs doesn't mean you shouldn't learn
    > a programming language.

    The fact it's so hard to write correct programs makes it a poor
    beginners' language.
    >
    >
    >>C doesn't do strings.
    >>C doesn't do fixed-point.
    >>Both are needed in business applications.
    >
    >
    > "Doesn't do" isn't correct at all. "Doesn't have as a language feature" is
    > better. And of course, C *does* have strings of a sort.

    It has arrays of characters, and the onus is entirely on the coder to
    choose appropriate functions, to keep track of string lengths, to test
    pointers and so on.

    COBOL and PL/1 which I've used most do have strings. Proper strings. So
    does Pascal, and (Borland) Pascal does make serious efforts to help
    programmers write good safe programs.

    >
    > Anyway, with open source, there are good libraries out there to do both.

    If they are not standard parts of the language many programmers will not
    find them or will choose to not use them to aid portability of their code.

    >
    >
    >>C++ is another matter altogether, and provided programmers use the C++
    >>features, code written in C++ is likely to be more reliable than
    >>equivalent code written by equivalently-capable C programmers.
    >
    >
    > It's not *all* altogether a different matter, but generally, yeah, this is
                 ^^^ I did qualify my statement.
    > why I advise getting a good book that teachs C++ as an object-oriented
    > langauge from the ground up rather than as a stepping-stone from C.
    >

    -- 
    Cheers
    John
    -- spambait
    1aaaaaaa@computerdatasafe.com.au  Z1aaaaaaa@computerdatasafe.com.au
    Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/
    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: John Summerfied: "Re: C++ Compiling Problems"

    Relevant Pages

    • Re: add support for other languages
      ... language DLLs or a single DLL with multiple language support, ... Just compile in Unicode ... You can create a hand-edited resource that contains Unicode strings, but you have to do it ... I don't know where is the language support comes into ...
      (microsoft.public.vc.mfc)
    • Re: Two Questions about "strlen", "strcat" and "strcpy"
      ... >>Important is that we have in the standard language a way of using ... > No. zero terminated strings is the whole problem in the first place. ... > programmer to think in terms of implementation and constantly respin ... The standards comitee refuses any change, ...
      (comp.lang.c)
    • Re: How come Ada isnt more popular?
      ... A language with a Hinldey-Milner type system ... fixed size strings, unbounded strings, suffix tree. ... container varies, the element does not. ...
      (comp.lang.ada)
    • Re: Substituting the main menu bar(s)
      ... I have tab-separated-value table of strings maintained with Excel, with a column for each language. ... All it does is replace the strings according to the translation table. ... I also have a batch file which calls the translation app, and then invokes the compiler on each resource-only DLL project. ...
      (microsoft.public.vc.mfc)
    • Re: Two Questions about "strlen", "strcat" and "strcpy"
      ... > length delimited strings in C. ... > Important is that we have in the standard language a way of using ... programming languages deal with strings (like Python, Perl, Java, ...
      (comp.lang.c)