C Board  

Go Back   C Board > Community Boards > General Discussions

Reply
 
LinkBack Thread Tools Display Modes
Old 05-01-2008, 12:52 AM   #1
CSharpener
 
vart's Avatar
 
Join Date: Oct 2006
Posts: 5,242
Bjarne Stroustrup on the Evolution of Languages - Interview MSDN Magazine Apr 2008

http://msdn.microsoft.com/en-us/magazine/cc500572.aspx
I have this link in my Microsoft subscription letter. Maybe it will be of some interest for others...
__________________
If I have eight hours for cutting wood, I spend six sharpening my axe.
vart is offline   Reply With Quote
Old 05-01-2008, 07:24 AM   #2
Banned
 
Join Date: Nov 2007
Posts: 678
I liked the fact that he himself is unhappy about some things in C++
This makes me feel better, if even the creator can't change some things, then, at least I should stop rambling about some tiny problems, that usually come by me, sometimes !

Waiting for C++0x although!
manav is offline   Reply With Quote
Old 05-01-2008, 07:59 AM   #3
Afraid of widths
 
medievalelks's Avatar
 
Join Date: Apr 2008
Location: Chicago
Posts: 887
Good interview. Loved the bit at the end about cell phones. I love how games, video, cameras, etc. are all being perfected by I still routinely get dropped calls, missed voice mails, etc. Flash over substance, which seems to be the norm anymore.
medievalelks is offline   Reply With Quote
Old 05-01-2008, 08:08 AM   #4
(?<!re)tired
 
Mario F.'s Avatar
 
Join Date: May 2006
Location: Portugal
Posts: 5,220
It still pains me bjarne fully supports the auto keyword. Bah!

*defeated*
__________________
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.


Mario F. is offline   Reply With Quote
Old 05-01-2008, 08:26 AM   #5
C++ Witch
 
laserlight's Avatar
 
Join Date: Oct 2003
Location: Singapore
Posts: 10,366
Quote:
It still pains me bjarne fully supports the auto keyword. Bah!
What's wrong with the new use of auto?
__________________
C + C++ Compiler: MinGW port of GCC
Build + Version Control System: SCons + Bazaar

Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
laserlight is online now   Reply With Quote
Old 05-01-2008, 09:09 AM   #6
(?<!re)tired
 
Mario F.'s Avatar
 
Join Date: May 2006
Location: Portugal
Posts: 5,220
Quote:
Originally Posted by laserlight View Post
What's wrong with the new use of auto?
At the surface nothing:
- You get more expressiveness (syntactical);
- You save on keystrokes;
- You minimize (debatable) compile time errors.

Complex template base object declarations are made simpler, I foresee iterators being one of the favorite uses for auto. But also, as suggested on the article, "hard to acquire" types can be easily declared.

However, I believe auto is an accident waiting to happen. For one, you lose semantical expressiveness and you make the code logic harder to follow. auto almost feels like I'm wanting to program in a non typed system; i.e. "I don't know the type, I just know it's some form of X, I can't bothered checking the library documentation, or it is too long to type, so I go with auto. This will work."

But the above argument has it flaws, I concede. I only recently started giving template based programming a hard look. And already I'm faced with annoying type declarations that I wished (truly) had been made simpler. As such, I can only imagine what the above paragraph may look like to a seasoned template based programmer.

My major beef with it is instead the fact the new use of auto is an accident waiting to happen also because of the fact it opens yet another door for bad code. The fact it is openly discussed as a tool for the beginner programmer, by the very same people who are institutionalizing it, only makes this worse. You know what I mean, but for illustration purposes, the following is not something you, I, or anyone else would like to see in the years to come on the C++ board:

Code:
std::string foo(int x);

int main () {
    auto bar = foo(13);
}
And yet, I foresee this is exactly what is going to happen.

EDIT: Note that the loss of semantical value is no minor issue. The amount of inconvinient and confusing bugs that might arise from auto foo = "This is a string"; when written by a programming language beginner is overwhelming. Is auto in this instance helping him, or on the other hand making his life harder for not even making it clear this variable is a const char*? Can we say type obfuscation? I chose this example because, believe it or not, is what you can see here: http://en.wikipedia.org/wiki/C%2B%2B0x

EDIT 2: Just a minor correction; one doesn't need to be a seasoned "template based programmer" (allow me that expression yet again) to experience the need for auto, as anyone who has, for instance, constructed a complex STL container can attest.
__________________
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.



Last edited by Mario F.; 05-01-2008 at 09:40 AM. Reason: post was showing an unintentional icon. Removed
Mario F. is offline   Reply With Quote
Old 05-01-2008, 09:16 AM   #7
CSharpener
 
vart's Avatar
 
Join Date: Oct 2006
Posts: 5,242
I've found it funny to see him discuss the vector<Apple> and vector<Fruit> after seeing same discussion on this forum...
__________________
If I have eight hours for cutting wood, I spend six sharpening my axe.
vart is offline   Reply With Quote
Old 05-01-2008, 12:51 PM   #8
Cat without Hat
 
CornedBee's Avatar
 
Join Date: Apr 2003
Posts: 8,439
Thanks, vart, that was a great article. And I also greatly enjoyed the linked paper about multiple dispatch.

Quote:
Is auto in this instance helping him, or on the other hand making his life harder for not even making it clear this variable is a const char*?
The worst part is that it isn't. The type of a string literal is const char[N], where N is the number of chars in the string literal, including the terminator. The type of a wide string literal is const wchar_t[N], same rule.
What does this mean? It means this:
Code:
const char *s1 = "foo";
const char *s2 = "foo";
assert(s1 == s2); // Probably true. Compilers generally fold string literals.

auto a1 = "bar";
auto a2 = "bar";
assert(a1 == a2); // Definitely false. On a side note, you've just wasted 8 stack bytes for nothing.
I need to go edit that Wikipedia article.
__________________
All the buzzt!
CornedBee

"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
CornedBee is offline   Reply With Quote
Old 05-01-2008, 12:57 PM   #9
CSharpener
 
vart's Avatar
 
Join Date: Oct 2006
Posts: 5,242
Quote:
Thanks, vart
It makes me happy to see that people find this link useful... So you're wellcome.
__________________
If I have eight hours for cutting wood, I spend six sharpening my axe.
vart is offline   Reply With Quote
Old 05-01-2008, 01:06 PM   #10
(?<!re)tired
 
Mario F.'s Avatar
 
Join Date: May 2006
Location: Portugal
Posts: 5,220
Quiet right, CornedBee. And yet another reason to be carefull around auto.

But for all purposes the example shouldn't even be there, in my opinion, because it suggests exactly what I'm against with; an oversimplification of its true usefulness that will introduce a new crowd of bad code and hard to track bugs. It pains me especially that it is advertised as being introduced to help the life of newcomers to the language.

Personally I feel auto is an advanced feature that is (un)fortunately extremely easy to use. This contradiction only means use and abuse of auto will probably become all too prevalent.
__________________
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.


Mario F. is offline   Reply With Quote
Old 05-01-2008, 01:28 PM   #11
Cat without Hat
 
CornedBee's Avatar
 
Join Date: Apr 2003
Posts: 8,439
Probably. But as one of those seasoned template programmers you refer to, I'm way too happy about auto to care about its abuse by newbies.
__________________
All the buzzt!
CornedBee

"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
CornedBee is offline   Reply With Quote
Old 05-01-2008, 07:43 PM   #12
Super Moderator
 
Bubba's Avatar
 
Join Date: Aug 2001
Posts: 7,472
Good read. I'm concerned with auto but I guess I'll get used to its uses and abuses. Bjarne seems to be a fundamentals type fella which is nice because he realizes that new bells and whistles or the latest greatest thing does not always make a good language. Overall I like the new features that were mentioned and look forward to learning and working with the new standard (sometime in the next few years?). Since it was 2003 to 2005 before most compilers caught up to the most recent standard I doubt I will see a compiler up to the new standard for quite some time.
Bubba is offline   Reply With Quote
Old 05-02-2008, 03:07 AM   #13
Cat without Hat
 
CornedBee's Avatar
 
Join Date: Apr 2003
Posts: 8,439
Quote:
Originally Posted by Bubba View Post
Overall I like the new features that were mentioned and look forward to learning and working with the new standard (sometime in the next few years?).
Depends on how much of them you want. GCC will develop support gradually. Vararg templates and r-value references are there now, in GCC 4.3.
__________________
All the buzzt!
CornedBee

"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
CornedBee is offline   Reply With Quote
Old 05-02-2008, 03:13 AM   #14
Banned
 
Join Date: Nov 2007
Posts: 678
An offtopic question:

Quote:
Originally Posted by CornedBee
All the buzzt!
What that means?
manav is offline   Reply With Quote
Old 05-02-2008, 03:30 AM   #15
Cat without Hat
 
CornedBee's Avatar
 
Join Date: Apr 2003
Posts: 8,439
It means, "All the best!", that is, a well-wishing, with altered spelling to make a pun on my username. I've been using it as long as the username exists.
__________________
All the buzzt!
CornedBee

"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
CornedBee is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
An Interview with Bjarne Stroustrup By Michael Miller kermi3 Article Discussions 9 03-15-2005 10:59 AM
Interview with Bjarne Stroustrup "C++ a joke" novacain A Brief History of Cprogramming.com 4 03-31-2003 11:55 PM
Exclusive Interview With Bjarne Stroustrup Osama Lives A Brief History of Cprogramming.com 7 05-07-2002 03:17 PM


All times are GMT -6. The time now is 09:11 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22