Connecting Tech Pros Worldwide Help | Site Map

Re: C++ equivalent to spaghetti code

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 22nd, 2008, 09:15 AM
James Kanze
Guest
 
Posts: n/a
Default Re: C++ equivalent to spaghetti code

On Jul 21, 9:02 pm, lawrence.jo...@siemens.com wrote:
Quote:
Willem <wil...@stack.nlwrote:
Quote:
Quote:
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.
Quote:
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.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

  #2  
Old July 22nd, 2008, 05:25 PM
Ben Pfaff
Guest
 
Posts: n/a
Default Re: C++ equivalent to spaghetti code

James Kanze <james.kanze@gmail.comwrites:
Quote:
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
--
Ben Pfaff
http://benpfaff.org
  #3  
Old July 22nd, 2008, 07:15 PM
Dann Corbit
Guest
 
Posts: n/a
Default Re: C++ equivalent to spaghetti code

"Ben Pfaff" <blp@cs.stanford.eduwrote in message
news:87prp5x2a2.fsf@blp.benpfaff.org...
Quote:
James Kanze <james.kanze@gmail.comwrites:
>
Quote:
>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:
http://www2.hursley.ibm.com/decimal/#decNumber

** Posted from http://www.teranews.com **
  #4  
Old July 23rd, 2008, 07:45 AM
James Kanze
Guest
 
Posts: n/a
Default Re: C++ equivalent to spaghetti code

On Jul 22, 7:21 pm, Ben Pfaff <b...@cs.stanford.eduwrote:
Quote:
James Kanze <james.ka...@gmail.comwrites:
Quote:
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.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.