473,758 Members | 4,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is c++ only better c ?

I've read somewhere that c++ is something more than better c ... then
I talk with my friend and he claimed that c++ is nothing more than
better c ... I tried to explain him that he was wrong but I forgot all
arguments about it. Could someone told something about it?
Oct 24 '08
43 1862
Pawel_Iks wrote:
I've read somewhere that c++ is something more than better c ... then
I talk with my friend and he claimed that c++ is nothing more than
better c ... I tried to explain him that he was wrong but I forgot all
arguments about it. Could someone told something about it?
C++ is not necessarily a better C at all. C is better at being C than
C++ is, and is inherently superior in specific ways. I prefer C++ for
the vast majority of programming tasks, but (Bjarne's opinion
notwithstanding ) the two languages are fundamentally different, and it
would not make sense to merge them.

I prefer C for some of the lower level portions of OS kernel and device
driver development, e.g. the code that runs on an ACPI embedded
controller. It's not that the C code is any better than C++ would be,
but that someone reading the code doesn't have to consider every
operation a potential function call. The meaning of an expression like
a+b has a variety of potential meanings, even in C, but the variety is
at least bounded. C is also much nicer than typical C++ to interface
with from assembly, because the name mangling is so much simpler. Even
C++ that is entirely in the shared subset with C may have decorated
names, so C++ that provides the same kind of consistently defined,
human-readable symbols has to both declare and define the symbols as
extern "C".

The beauty of C is that you know precisely what every statement means.
The beauty of C++ is that you don't have to.
Oct 26 '08 #21
Juha Nieminen wrote:
There is no such equality. More features don't automatically make the
language more complex. In fact, it's often the exact opposite: More
features can make using the language *simpler*, not more complicated.
Yes and no. Anyone can invent a complex solution to a problem, but it
takes genius to find a simple solution.
Oct 26 '08 #22
blargg wrote:
Won't someone think of the compiler writers???
It's the job of the compiler writers to make the life of the
programmers easier, not the other way around.

(As a side note, I detest XML precisely because of that: XML has been
designed to make it easier to create programs which read XML, at the
cost of making it harder for users to write XML. (Basically XML is
pre-tokenized data, which lifts the need for the program reading XML to
tokenize it.) This is the complete reversals of what software should be
all about: Software should do as much as possible to make the life of
the user as easy as possible, not the other way around!
As an example of what I'm talking about, consider MathML vs. LaTeX
equations, and which one is easier for a human to write.)
Oct 27 '08 #23
Jeff Schwab wrote:
Juha Nieminen wrote:
>Pawel_Iks wrote:
>>I've read somewhere that c++ is something more than better c ... then
I talk with my friend and he claimed that c++ is nothing more than
better c ... I tried to explain him that he was wrong but I forgot all
arguments about it. Could someone told something about it?

I think that this is just an argument about semantics. If you say "C++
is something more than just a better C" that sentence has a positive
exalting tone to it, but if you say "C++ is nothing more than a better
C" that sentence has a belittling and unappreciating tone. In the end,
both sentences are saying the exact same thing. There's just a
difference in attitude.

Huh? "Something" != "nothing"; that's not just a different tone, it's
an altogether different meaning.
Only if you insist in interpreting the words literally. The concept "a
better C" already implies that there's *something* more in C++ than in
C. The word "nothing" in that sentence doesn't mean "no extra features",
it means "the extra features are not all that important". Like in the
expression "that's nothing".
Oct 27 '08 #24
On 2008-10-27 16:28:26, Juha Nieminen wrote:
(As a side note, I detest XML precisely because of that: XML has been
designed to make it easier to create programs which read XML, at the
cost of making it harder for users to write XML. (Basically XML is
pre-tokenized data, which lifts the need for the program reading XML to
tokenize it.) This is the complete reversals of what software should be
all about: Software should do as much as possible to make the life of
the user as easy as possible, not the other way around!
I see this differently. Firstly, XML is primarily meant for the (easily
portable) exchange of data between programs, not for direct user input.
Secondly, in the places where you "hack" XML manually, it's because there
was no time or no funding to write a program that would create the required
input data comfortably -- which would be the same problem with any other
input scheme. And thirdly, if you have data to input into a program, and
need to hack the input manually because there is not proper
input-generating program, it's kind of comforting to have a defined way how
data is tokenized - not having to guess (or to check in the code) whether
strings have to be quoted with single quotes, double quotes, or any other
old way (like embedded spaces quoted with backslash), and whether embedded
quotes in strings have to be quoted with backslashes, doubling the quote,
or whatever, and so on...

Considering this, maybe you can find some improvement in XML when compared
to the alternatives :)

Gerhard
Oct 28 '08 #25
Gerhard Fiedler wrote:
Considering this, maybe you can find some improvement in XML when compared
to the alternatives :)
What are the alternatives?

Better than S-Expr syntax? I often hear "XML is better than the
alternatives" but noone so far could show me a single example where
there isn't a better alternative. Ok, maybe with the exception of SGML
for simple uses (for which it was originally developped).
Oct 28 '08 #26
In article <jt************ *************** ***@giganews.co m>,
Jeff Schwab <je**@schwabcen ter.comwrote:
>

I prefer C for some of the lower level portions of OS kernel and device
driver development, e.g. the code that runs on an ACPI embedded
controller. It's not that the C code is any better than C++ would be,
but that someone reading the code doesn't have to consider every
operation a potential function call. The meaning of an expression like
a+b has a variety of potential meanings, even in C, but the variety is
at least bounded. C is also much nicer than typical C++ to interface
Well, if you are going to talk about bad C++ that redefine operator+()
for basic types, then one should also consider preprocessor abuse in
pure C.


Oct 28 '08 #27
Yannick Tremblay wrote:
In article <jt************ *************** ***@giganews.co m>,
Jeff Schwab <je**@schwabcen ter.comwrote:
>>
I prefer C for some of the lower level portions of OS kernel and device
driver development, e.g. the code that runs on an ACPI embedded
controller. It's not that the C code is any better than C++ would be,
but that someone reading the code doesn't have to consider every
operation a potential function call. The meaning of an expression like
a+b has a variety of potential meanings, even in C, but the variety is
at least bounded. C is also much nicer than typical C++ to interface

Well, if you are going to talk about bad C++ that redefine operator+()
for basic types,
You can't redefine operator+ for primitive types, even in C++, thank
WG21. You can overload operator+ for the case when at least one
argument is not primitive, but that's not the same thing.

In well-written C++ code, the reader doesn't have to know exactly what's
happening at the next lower level of abstraction; for example,
some_library::s mart_pointer's destructor may clean up a resource, or
flush a buffer; operator-may return a temporary proxy object whose
constructor and destructor obtain and release a lock. These techniques
can be great for high-level programming, but they're wide open to the
kind of savage abuse that "seems like a good idea at the time." Almost
any use of them would be dangerous in code that is innately
hardware-specific. The "next lower level of abstraction" specifically
should not be hidden from (e.g.) a device driver that needs to
communicate with the registers on a device controller.

The introduction to The C Programming Language claims that "a programmer
can reasonably expect to know and understand and indeed regularly use
the entire language." The same is not true of C++. Note that C++ is my
"desert island" language, and I love it dearly, so I don't claim that C
has its advantages without reason. I also wonder why the C committee
bothers with quasi-automated features like VLAs, since C's long-term
niche is clearly with developers who need just enough abstraction to let
the same code run on target platforms with different assembly languages.
then one should also consider preprocessor abuse in
pure C.
The same preprocessor is available in C++, and seems to be abused with
roughly equal frequency in both languages. Note that what constitutes
"abuse" in C++ is often valid in C; for example, macro definitions don't
respect C++ namespaces, but in C, that's not a problem.
Oct 28 '08 #28
Gerhard Fiedler wrote:
XML is primarily meant for the (easily
portable) exchange of data between programs
And XML is one of the least efficient ways of doing that, spacewise.
This is especially true with large amounts of data which have to be
transferred eg. over a network. XML is hyperverbose, often for no good
reason.
Oct 28 '08 #29
On 2008-10-28 15:48:35, Juha Nieminen wrote:
Gerhard Fiedler wrote:
>XML is primarily meant for the (easily
portable) exchange of data between programs

And XML is one of the least efficient ways of doing that, spacewise.
This is especially true with large amounts of data which have to be
transferred eg. over a network. XML is hyperverbose, often for no good
reason.
Yes, but that's a different thing, and I think that this is what computers
are for :) XML is usually quite easily compressable, so for network
transfer this shouldn't be a problem.

Gerhard
Oct 28 '08 #30

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

Similar topics

220
19142
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have any preconceived ideas about it. I have noticed, however, that every programmer I talk to who's aware of Python is also talking about Ruby. So it seems that Ruby has the potential to compete with and displace Python. I'm curious on what basis it...
3
2034
by: Muhd | last post by:
<usualDisclaimer>Please forgive me if this is in the wrong group, and if so, what is the right group.</usualDisclaimer> Let me start off by first saying im a newb. Ok, with that out of the way I am trying really hard and boy have I learned a lot in the last little while but I have a question i just can't seem to find a good answer to. Lets say i have a table that simply stores how many times someone has logged into a webpage. Is it...
24
3476
by: Faith Dorell | last post by:
I really don´t like C.You can write better programs in BASIC than in C, if you don´t like this language. I don´t understand how C became so popular, although much better programming languages existed in the 70s or 80s or 90s. Pascal is much better.
43
3422
by: Rob R. Ainscough | last post by:
I realize I'm learning web development and there is a STEEP learning curve, but so far I've had to learn: HTML XML JavaScript ASP.NET using VB.NET ..NET Framework ADO.NET SSL
33
2588
by: Protoman | last post by:
Which is better for general-purpose programming, C or C++? My friend says C++, but I'm not sure. Please enlighten me. Thanks!!!!!
22
2721
by: JoeC | last post by:
I am working on another game project and it is comming along. It is an improvment over a previous version I wrote. I am trying to write better programs and often wonder how to get better at programming. I tend to learn what is useful and gets the job done. I am always curious if there is some techique I don't know. I read books and study as well as write programs. My goal is to some day be able to get a job programming. I have a...
19
1869
by: Alexandre Badez | last post by:
I'm just wondering, if I could write a in a "better" way this code lMandatory = lOptional = for arg in cls.dArguments: if arg is True: lMandatory.append(arg) else: lOptional.append(arg) return (lMandatory, lOptional)
23
2367
by: mike3 | last post by:
Hi. (posted to both newsgroups since I was not sure of which would be appropriate for this question or how specific to the given language it is. If one of them is inappropriate, just don't send replies to it.) I'm making a bignum package for use in a program I've got (this is something different from the pi program you may have heard about). The package is going to support manipulating long floating point numbers.
20
3091
by: mike3 | last post by:
Hi. (Xposted to both comp.lang.c++ and comp.programming since I've got questions related to both C++ language and general programming) I've got the following C++ code. The first routine runs in like 65% of the time of the second routine. Yet both do the same thing. However, the second one seems better in terms of the way the code is written since it helps encapsulate the transformation in the inner loop better making it easier to read,...
3
3577
by: Ryan Liu | last post by:
Hi, Is Async I/O (e.g. NetworkStream.Begin/End Read/Write) always better than synchronous I/O? At least as good? When I don't concern about easy or difficult to write code, should I always use Async I/O?
0
9492
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
9299
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9885
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
9740
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
8744
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...
0
6564
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5332
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3832
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
3
2702
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.