Re: C++ equivalent to spaghetti code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • James Kanze

    Re: C++ equivalent to spaghetti code

    On Jul 21, 9:02 pm, lawrence.jo...@ siemens.com wrote:
    Willem <wil...@stack.n lwrote:
    In other words: There cannot be any commercial applicaiton
    written in C, because in your view it is not well suited to
    one or two application types you can think of.
    I don't think that's what James meant. I think when he said
    "commercial application", he really meant "business data
    processing application". C really *isn't* well suited to most
    BDP applications, so his statement is much more reasonable
    when interpreted that way. But I still suspect that there are
    at least a few BDP applications written in C nonetheless.
    Exactly. And obviously, you can do it; I know one person who
    wrote relational data base code in assembler. But C isn't
    really appropriate; there are almost always better alternatives.
    C doesn't have any support for decimal arithmetic, nor any means
    of adding it comfortably.

    But I'd forgotten that today, "commercial " generally means the
    opposite of "open source", or "free", and doesn't refer to the
    application domain. I should have been clearer.

    --
    James Kanze (GABI Software) email:james.kan ze@gmail.com
    Conseils en informatique orientée objet/
    Beratung in objektorientier ter Datenverarbeitu ng
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
  • Ben Pfaff

    #2
    Re: C++ equivalent to spaghetti code

    James Kanze <james.kanze@gm ail.comwrites:
    C doesn't have any support for decimal arithmetic, nor any means
    of adding it comfortably.

    --
    Ben Pfaff

    Comment

    • Dann Corbit

      #3
      Re: C++ equivalent to spaghetti code

      "Ben Pfaff" <blp@cs.stanfor d.eduwrote in message
      news:87prp5x2a2 .fsf@blp.benpfa ff.org...
      James Kanze <james.kanze@gm ail.comwrites:
      >
      >C doesn't have any support for decimal arithmetic, nor any means
      >of adding it comfortably.
      >
      http://www.open-std.org/jtc1/sc22/open/n4060.pdf
      And in case you don't feel like waiting, there is IBM's excellent package:


      ** Posted from http://www.teranews.com **

      Comment

      • James Kanze

        #4
        Re: C++ equivalent to spaghetti code

        On Jul 22, 7:21 pm, Ben Pfaff <b...@cs.stanfo rd.eduwrote:
        James Kanze <james.ka...@gm ail.comwrites:
        C doesn't have any support for decimal arithmetic, nor any means
        of adding it comfortably.
        Yes, I'd heard about this. But I wasn't too sure of its status,
        and it isn't implemented by the compilers I regularly use.

        IMHO, it is an important step forward. Both decimal and complex
        are really only used by a restricted community; one could argue
        on those grounds that they don't belong in the standard of a
        general purpose language. On the other hand, those communities
        really do need them, and not having them generally means that
        the language can't be used for certain applications, at least
        not effectively.

        C++ sort of side steps the issue; because it has operator
        overloading, you can (supposedly) write your own, or use a third
        party library. But your own or a third party library is still
        not the same thing as "standard"; and in the case of decimal
        arithmetic, there are also performance issues to consider: many
        machines have direct hardward support for decimal arithmetic,
        which a library written in C or C++ won't be able to access.
        (Many years back, I was involved in porting some software using
        BCD to different architectures. The person who ported it to the
        Siemens mainframe rewrote the four BCD arithmetic operators in
        assembler: something like 40 lines of assember, with no loops,
        to replace 400 lines of C, with several loops, and a speed up of
        five magnitude.)

        --
        James Kanze (GABI Software) email:james.kan ze@gmail.com
        Conseils en informatique orientée objet/
        Beratung in objektorientier ter Datenverarbeitu ng
        9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

        Comment

        Working...