473,883 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why still use C?

no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.

i heard people say C++ is slower than C but i can't believe that. in pieces
of the application where speed really matters you can still use "normal"
functions or even static methods which is basically the same.

in C there arent the simplest things present like constants, each struct and
enum have to be prefixed with "struct" and "enum". iam sure there is much
more.

i don't get it why people program in C and faking OOP features(functi on
pointers in structs..) instead of using C++. are they simply masochists or
is there a logical reason?

i feel C has to benefit against C++.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
--
comp.lang.c.mod erated - moderation address: cl**@plethora.n et
Nov 13 '05
687 23893
Brian Inglis <Br**********@S ystematicSw.ab. ca> writes:
[...]
Has any machine ever supported *hardware* *decimal* *floating point*
arithmetic? Not *fixed* (un-/packed) decimal arithmetic, which
requires the programmer or compiler and library to do the scaling, and
not software decimal floating point.


Most programmable calculators support hardware decimal floating point.
I don't think any of them have C implementations , but some of the more
powerful ones probably could.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
(Note new e-mail address)
--
comp.lang.c.mod erated - moderation address: cl**@plethora.n et
Nov 13 '05 #511
Francis Glassborow wrote:
Ordinary users of either C or C++ should appreciate the degree
to which those who do the work on the relevant standards are
going the extra mile (kilometre) to work together.


Extra mile/kilometer noted and appreciated.

As an ordinary user of C my appreciation is multiplied by a
factor representing the perceived improvement in the language.

In the past, that factor has not always been greater than zero. I
would suggest that a standard change to the benefit of a single
hardware producer deserves /very/ close examination.

I haven't found any references to IBM patents covering decimal
floating point implementations . Does IBM hold and/or have
application(s) pending for such patents? If so, are those patents
sufficiently broad as to exclude other hardware producers from
producing decimal FPUs of equal (or better) performance at equal
(or better) cost?

If the answer is "yes" or even "I don't know", then those who do
the work on the relevant standards aren't going that extra mile
for me, the ordinary user (and, when all is said and done, merit
neither appreciation nor respect from ordinary users).
--
Morris Dovey
West Des Moines, Iowa USA
C links at http://www.iedu.com/c
Read my lips: The apple doesn't fall far from the tree.
--
comp.lang.c.mod erated - moderation address: cl**@plethora.n et
Nov 13 '05 #512
Thad Smith <th*******@acm. org> writes:
I wonder if it is time to put effort into standardizing on two (or
possibly more) distinct levels: the core language, which should be
fairly stable, and add-on packages to suit various applications, such
as financial calculations.


This is the way most engineering standards are constructed. It would
be an excellent idea for a language as flexible as C.

--
dhs sp*****@panix.c om
--
comp.lang.c.mod erated - moderation address: cl**@plethora.n et
Nov 13 '05 #513
Brian Inglis wrote:
..... snip ...
Has any machine ever supported *hardware* *decimal* *floating point*
arithmetic? Not *fixed* (un-/packed) decimal arithmetic, which
requires the programmer or compiler and library to do the scaling,
and not software decimal floating point.


Yes. I built one almost 40 years ago. It was probably better
classified as a programmable calculator. It used excess-3 coding,
9 significant digits + sign digit, 2 digit exponent offset by 50.
Arithmetic was 9's complement.

--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!
--
comp.lang.c.mod erated - moderation address: cl**@plethora.n et
Nov 13 '05 #514
Christian Bau <ch***********@ cbau.freeserve. co.uk> writes:
[...]
From what I am reading, it seems that decimal floating point will
definitely be added to the IEEE 754 standard. In C++ decimal floating
point could be added quite easily as a class; no change in the compiler
needed, same as complex. In C, decimal floating point would have to be
added as proper new datatypes. I must say I would prefer if C++ did it
the same way.


It seems to be that, assuming the existing binary FP support is left
in place, both C and C++ would have problems with floating-point
literals. (Yes, I'm assuming the existing FP types are binary; no,
that's not guaranteed by the current standard.)

For example, assuming that "d_double" is a decimal double-precision
type (perhaps a typedef), what would be the semantics of the
following?

d_double x = 0.1;

Ideally, you'd want to assign the exact value 0.1 to x, but 0.1 is a
literal of type double, so it's not exactly representable in a binary
type. Logically, the literal 0.1 should evaluate to a close binary
approximation which is then converted from double to d_double. Either
this can potentially lose information (e.g., setting x to
0.0999999999999 ), or you need a complicated set of rules to guarantee
that it doesn't.

For maximum user-friendliness, you'd want the above to mean just what
it looks like, but that would require the type of a literal to depend
on its context. At the least, I think you need another suffix to
specify that a literal is decimal:

d_double x = 0.1D;

but forgetting the suffix is likely to be a common subtle error.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
(Note new e-mail address)
--
comp.lang.c.mod erated - moderation address: cl**@plethora.n et
Nov 13 '05 #515

Morris Dovey wrote:
[...]
I haven't found any references to IBM patents covering decimal
floating point implementations .


I'm not sure how relevant this is with respect to "final specs",
but some discussion on IBM decimal patents related stuff can be
found here:

http://grouper.ieee.org/groups/754/m.../02-04-18.html

That's 6,437,715/6,525,679 (equivalents in Europe and Japan aside
for a moment), I guess.

regards,
alexander.

--
http://groups.google.com/groups?selm...5BCA3%40web.de
(Subject: Re: Software patents make no sense)
Nov 13 '05 #516
in comp.std.c i read:
Thad Smith wrote:

Does a two-tiered system for standardization make sense? Will it
work? Has it been shown to work or fail in other instances?


COBOL had various levels of conformance, and generally all
it accomplished was complication. In practice all implementations
ended up providing all the levels, so what was the point?


and, c already has two levels of conformance: hosted and free-standing.

--
a signature
--
comp.lang.c.mod erated - moderation address: cl**@plethora.n et
Nov 13 '05 #517
In article <cl************ ****@plethora.n et>, Morris Dovey
<mr*****@iedu.c om> writes
If the answer is "yes" or even "I don't know", then those who do the
work on the relevant standards aren't going that extra mile for me, the
ordinary user (and, when all is said and done, merit neither
appreciation nor respect from ordinary users).


As I understand it those involved in Standardisation are required to
declare any existing patents, copyrights etc. that are relevant. In
addition there are already several relevant standards:

IEEE 754R, IEEE 854, ANSI X3.274, ECMA 334

For more details check:

http://www2.hursley.ibm.com/decimal/

--
Francis Glassborow ACCU
If you are not using up-to-date virus protection you should not be reading
this. Viruses do not just hurt the infected but the whole community.
--
comp.lang.c.mod erated - moderation address: cl**@plethora.n et
Nov 13 '05 #518
Morris Dovey wrote:
....
The need for high degrees of precision in computation is not a
new issue and I fail to see how a change in radix will provide a
major improvement.
It's not "high degrees of precision" that are needed. It's a fairly low
degree of precision, but it needs to be provided exactly, which makes is
similar in some ways to requiring infinite precision.
Has WG14 made the decision that the needs of "typical billing
programs" should determine the C language architecture and
associated standards?
Apparantly they've decided that those needs should be considered. Your
use of "determine" is a loaded phrase; taken to it's logical extreme,
your criticism implies that the C standard should never contain any
feature that is needed only by a minority of the users. In fact, most of
C's features are needed only by a minority, especially in the C standard
library. A great many programs make no use of floating point at all,
whether binary or decimal.
Would anyone care to wager that "the typical billing program"
/cannot/ be improved by overall factors in excess of three even
if decimal floating point is not provided?
It's not an issue where improvement can be measured in terms of "[a]
factor in excess of three". The key point is that the financial
community has a commonly occuring need for the numbers, as printed with
a fixed number of decimal places, to add up exactly to the specified
total printed with the same number of decimal places, without roundoff
error. In general that will happen only when using a radix that is a
power of 10. One solution is to use scaled integers, such that an
integer such as 3412 represents a value of 34.12. However, use of scaled
integers complicates programs; a common problem is forgetting to apply
the scale factor, or applying it inappropriately .

.... Since when (and by whom) has there been a declaration that C is
competing (with whom and for what) as a tool for building
commercial applications? Is the term "panacea" being added to the
language definition?
The term "commercial " describes most of the software that has ever been
written in the C language. I suspect you may mean "financial" rather
than "commercial ". There's a lot more freeware out there nowadays, but
most programs still have to be paid for.

C has always been meant to be a general-purpose language. That's similar
to "panacea", but not as ambitious. It's not meant to be the ideal
solution for every problem, but it's meant to be an acceptable solution
for a wide variety of problems. It's a low-level language, far closer to
assembly language than many others, but not so low-level as to be
inappropriate for some financial applications.

Given that the floating point radix has never been restricted to
any particular value, you should probably not contract the
language definition at this point by deciding that you've fallen
in love with ten. My sense is that any requirements (other than
the specific radix value, of course) for one radix should also be
in force for all others.


I think you're under the mistaken impression that decimal floating point
is being proposed as a replacement for binary floating point. Such a
mistake would make your criticisms seem more appropriate. My
understanding was that the proposal is to add support for decimal
floating point types, in addition to the default types, not that it
would be a mandatory re-interpretation of them.
--
comp.lang.c.mod erated - moderation address: cl**@plethora.n et
Nov 13 '05 #519
Morris Dovey wrote:
I haven't found any references to IBM patents covering decimal
floating point implementations . Does IBM hold and/or have
application(s) pending for such patents? If so, are those patents
sufficiently broad as to exclude other hardware producers from
producing decimal FPUs of equal (or better) performance at equal
(or better) cost?


The only one that I am aware of that directly affects the decimal
formats in the draft IEEE 754 revision is the IBM patent which
covers my Densely Packed Decimal encoding scheme,
described at:

http://www2.hursley.ibm.com/decimal/DPDecimal.html

(This was patented before we considered proposing it for use
in IEEE 754.) IBM has already written the necessary formal
letter to the IEEE stating that this will be Royalty Free for
implementers of the standard (rather than RAND), though
RAND is permitted by IEEE rules. We really want to see
everyone using the new formats!

There are, of course, many patents issued to IBM and
other companies that cover various aspects of floating-point
arithmetic (both binary and decimal). These might constrain
certain methods of implementation, but would not prevent
implementation -- any 'obvious' implementation would not
be covered by patents, and many early patents on decimal
arithmetic have long since expired, in any case.

Mike Cowlishaw
IBM Fellow (Google: Cowlishaw)
--
comp.lang.c.mod erated - moderation address: cl**@plethora.n et
Nov 13 '05 #520

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

Similar topics

3
11266
by: William C. White | last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using cURL? Our website is hosted on a shared drive and the webhost company doesn't installed additional software (such as cURL) on the server because of that. Our site will have an SSL certificate next week, so I would like to use AIM instead of SIM, however, I don't know how to send data via POST over https and recieve data from the Authorize.net server over an https...
2
5865
by: Albert Ahtenberg | last post by:
Hello, I don't know if it is only me but I was sure that header("Location:url") redirects the browser instantly to URL, or at least stops the execution of the code. But appearantely it continues to execute the code until the browser send his reply to the header instruction. So an exit(); after each redirection won't hurt at all
3
23053
by: James | last post by:
Hi, I have a form with 2 fields. 'A' 'B' The user completes one of the fields and the form is submitted. On the results page I want to run a query, but this will change subject to which field is completed.
0
8508
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. 354 roberto@ausone:Build/php-4.3.2> ldd /opt/php4/bin/php libsablot.so.0 => /usr/local/lib/libsablot.so.0 libstdc++.so.5 => /usr/local/lib/libstdc++.so.5 libm.so.1 => /usr/lib/libm.so.1
1
8621
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the column below. The viewer can select states from the drop down lists above the other two columns as well. If the viewer selects only one, only one column fills. If the viewer selects two states, two columns fill. Etc. I could, if appropriate, have...
4
18317
by: Albert Ahtenberg | last post by:
Hello, I have two questions. 1. When the user presses the back button and returns to a form he filled the form is reseted. How do I leave there the values he inserted? 2. When the user comes back to a page where he had a submitted POST data the browser keeps telling that the data has expired and asks if repost. How to avoid that? I tried registering all POST and GET vars as SESSION vars but
1
6890
by: inderjit S Gabrie | last post by:
Hi all Here is the scenerio ...is it possibly to do this... i am getting valid course dates output on to a web which i have designed ....all is okay so far , look at the following web url http://www.mis.gla.ac.uk/biquery/training/ but each of the courses held have maximum of 8 people that could be
2
31461
by: Jack | last post by:
Hi All, What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g. select x from y where z=:parameter Which in asp/jsp would be followed by some statements to bind a value to :parameter I dont like the idea of making the SQL statement on the fly without binding parameters as I dont want a highly polluted SQL cache.
3
23617
by: Sandwick | last post by:
I am trying to change the size of a drawing so they are all 3x3. the script below is what i was trying to use to cut it in half ... I get errors. I can display the normal picture but not the results of the picture half the size. The PHP I have installed support 1.62 or higher. And all I would like to do is take and image and make it fit a 3x3. Any suggestions to where I should read or look would be appreciated.
0
9936
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11137
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10742
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10845
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10412
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9571
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7970
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5990
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.