473,387 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Re: C++ equivalent to spaghetti code

On Jul 21, 9:02 pm, lawrence.jo...@siemens.com wrote:
Willem <wil...@stack.nlwrote:
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:ja*********@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
Jul 22 '08 #1
3 1551
James Kanze <ja*********@gmail.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
--
Ben Pfaff
http://benpfaff.org
Jul 22 '08 #2
"Ben Pfaff" <bl*@cs.stanford.eduwrote in message
news:87************@blp.benpfaff.org...
James Kanze <ja*********@gmail.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:
http://www2.hursley.ibm.com/decimal/#decNumber

** Posted from http://www.teranews.com **
Jul 22 '08 #3
On Jul 22, 7:21 pm, Ben Pfaff <b...@cs.stanford.eduwrote:
James Kanze <james.ka...@gmail.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
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:ja*********@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
Jul 23 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Brent Mondoux | last post by:
Hey everyone, I'm trying to find the best non-spaghetti code way to do the equivalent of a ColdFusion CFQUERY GROUP command so that I can display a FAQ with categories as follows: -- Example:...
7
by: CoreyWhite | last post by:
You know what I have to say to the giant spaghetti monster? Do you want to know? Do you? Well I'm tired of sucking on your spaghetti and chewing on your fresh meat balls! It isn't only about...
0
by: CoreyWhite | last post by:
In any kind of communication and language, even in computer programming. We can see a difference between total spaghetti and celtic knot work. But it is easy to confuse the two, because sometimes...
20
by: Victor Smootbank | last post by:
I did program in BASIC for more than 20 years and for me it's still the ultimate programming language. Unfortunately, I was forced to upgrade to C++ and now I'm confused. While programming in...
40
by: Campy Happer | last post by:
Hello all, I would like to bring to your attention a concept and a term for it that I think is long overdue. But first: In the bad old days of programming, before subroutines were even...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.