473,732 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What if...

Think for a moment:

IF you were Bjarne Stroustrup in 1985 (or whenever he were doing it)
writing down C++, and knowing all you know NOW of the C++ language,
(pro, cons, features of today languages)... What do *you* change of it
to make a better (in any sense you want) language?

some example issues:
Unicode?
Native string type?
Simpler syntax?
Boxing/unboxing?
Pascal-like units?
Jan 7 '06 #1
24 1844

Massimo Soricetti wrote:

IF you were Bjarne Stroustrup in 1985 (or whenever he were doing it)
writing down C++, and knowing all you know NOW of the C++ language,
(pro, cons, features of today languages)... What do *you* change of it
to make a better (in any sense you want) language?

Just speculating - Wasn't Java designed with such a question in mind?
(This doesnot say Java is better than C++, but does say that Java is
better than C++ "in the sense Java designers wanted".)

Jan 7 '06 #2
Neelesh Bodas ha scritto:
Just speculating - Wasn't Java designed with such a question in mind?
(This doesnot say Java is better than C++, but does say that Java is
better than C++ "in the sense Java designers wanted".)


"In the sense Java designers wanted". That's the point: they didn't mean
to create a better C++ at all. I mean "a better C++ in any sense".

(if I recall correctly, Java was born as language for microcontroller s
and small hardware devices, then developed to a general-purpose language
when SUN saw it was growing and choose to bet on it)...
Jan 7 '06 #3
"Neelesh Bodas" <ne***********@ gmail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
Just speculating - Wasn't Java designed with such a question in mind?


Nope. Java was originally the work of a single project that intended it for
a particular application area (Sorry, I've forgotten what it was).
Management wanted to cancel their project, so they looked around for a
different area to which they could apply it and found the Internet.
Jan 7 '06 #4

Massimo Soricetti skrev:
Think for a moment:

IF you were Bjarne Stroustrup in 1985 (or whenever he were doing it)
writing down C++, and knowing all you know NOW of the C++ language,
(pro, cons, features of today languages)... What do *you* change of it
to make a better (in any sense you want) language?
Why not ask Bjarne about that? So far as I remember, the question is
answered on his homepage. If my memory serves me correctly he said that
he would not have changed anything.

some example issues:
Unicode? I doubt that that would be a priority. C++ is a multi-purpose language
and the requirement to support Unicode would rule out lots of compilers
for embedded systems. That being said, proper Unicode support is
available in C++ today for those needing it (e.g. if you program on a
standard PC). This support is far better than for e.g. Java which seems
to be stuck with UTF-16. Native string type?
There is already a native string-type. Just #include <string>. Simpler syntax? This would be nice for those beginning to use C++ but really is not a
major problem in daily use. I believe simpler syntax is impossible
considering the requirement for extensive compatibility with C.
Boxing/unboxing? What would you need that for? Pascal-like units?

Pascal does not have units, but I believe I understand what you mean.
Again, I do not see much of an advantage here.

/Peter

Jan 8 '06 #5
On 7 Jan 2006 04:57:29 -0800, "peter koch"
<pe************ ***@gmail.com> wrote:
Native string type?


There is already a native string-type. Just #include <string>.


#include <string> means that C++ has no _native_ string type. And yes,
even C should have one.

Best wishes,
Roland Pibinger
Jan 8 '06 #6
Roland Pibinger wrote:
On 7 Jan 2006 04:57:29 -0800, "peter koch"
<pe************ ***@gmail.com> wrote:
Native string type?

There is already a native string-type. Just #include <string>.


#include <string> means that C++ has no _native_ string type. And yes,
even C should have one.

Best wishes,
Roland Pibinger


In what way should a native string behave differently to std::string?

If it can be supported by a library, then there's no requirement to add
it in some "native" sense.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
Jan 8 '06 #7
Once upon a time (Sonntag, 8. Januar 2006 12:38) Roland Pibinger wrote
some very nice things
On 7 Jan 2006 04:57:29 -0800, "peter koch"
<pe************ ***@gmail.com> wrote:
Native string type?


There is already a native string-type. Just #include <string>.


#include <string> means that C++ has no _native_ string type. And yes,
even C should have one.


Many widely used languages like C# or Java don't have native string types,
so why should C or C++ have one? What is the advantage of a native string
type?

Jan 8 '06 #8
On Sun, 08 Jan 2006 14:59:40 +0100, Sebastian Wiesner
<Ba***********@ gmx.net> wrote:
Once upon a time (Sonntag, 8. Januar 2006 12:38) Roland Pibinger wrote
some very nice things
On 7 Jan 2006 04:57:29 -0800, "peter koch"
<pe************ ***@gmail.com> wrote:
Native string type?

There is already a native string-type. Just #include <string>.


#include <string> means that C++ has no _native_ string type. And yes,
even C should have one.


Many widely used languages like C# or Java don't have native string types,
so why should C or C++ have one? What is the advantage of a native string
type?


I thought that the string type in C# was native, but just had
reference value semantics and so felt different from the integral
types?

I could be wrong though.
Jan 8 '06 #9
W Marsh wrote:
On Sun, 08 Jan 2006 14:59:40 +0100, Sebastian Wiesner
<Ba***********@ gmx.net> wrote:
Once upon a time (Sonntag, 8. Januar 2006 12:38) Roland Pibinger wrote
some very nice things
On 7 Jan 2006 04:57:29 -0800, "peter koch"
<pe************ ***@gmail.com> wrote:
> Native string type?

There is already a native string-type. Just #include <string>.

#include <string> means that C++ has no _native_ string type. And yes,
even C should have one.
Many widely used languages like C# or Java don't have native string
types, so why should C or C++ have one? What is the advantage of a
native string type?


I thought that the string type in C# was native, but just had
reference value semantics and so felt different from the integral
types?


No, its implemented as a class (System.String) . The "native" string in C#
is just an alias for System.String.
Even integral types are implemented as classes. These classes only feel
like a value types.

I could be wrong though.


You are.

Basti
Jan 8 '06 #10

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

Similar topics

2
3093
by: thecrow | last post by:
Alright, what the hell is going on here? In the following code, I expect the printed result to be: DEBUG: frank's last name is burns. Instead, what I get is: DEBUG: frank's last name is burns. Here is the code: $frank = "burns";
220
19107
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...
699
34042
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it could be possible to add Pythonistic syntax to Lisp or Scheme, while keeping all of the...
92
6506
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption? cheers, reed
137
7139
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very pragmatic - 3) I usually move forward when I get the gut feeling I am correct - 4) Most likely because of 1), I usually do not manage to fully explain 3) when it comes true. - 5) I have developed for many years (>18) in many different environments,...
12
11167
by: Dario | last post by:
The following simple program behaves differently in Windows and Linux . #include <stdexcept> #include <iostream> #include <string> using namespace std; class LogicError : public logic_error { public: string desc;
125
14801
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from software giant such as Microsoft SQL Server, Oracle, and Sybase? Is PostgreSQL reliable enough to be used for high-end commercial application? Thanks
47
9151
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
121
10127
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode support IDEs are DreamWeaver 8 and Zend PHP Studio. DreamWeaver provides full support for Unicode. However, DreamWeaver is a web editor rather than a PHP IDE. It only supports basic IntelliSense (or code completion) and doesn't have anything...
8
3168
by: Midnight Java Junkie | last post by:
Dear Colleagues: I feel that the dumbest questions are those that are never asked. I have been given the opportunity to get into .NET. Our organization has a subscription with Microsoft that basically entitled to us to just about every .Net development tool you can imagine. I cant even begin to mention them. To begin with, my background is not that of a programmer, but a systems engineer and the closest I have come to "programming"...
0
8946
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
8774
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,...
0
9447
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...
1
9235
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
9181
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
6031
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
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
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
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.