PDA

View Full Version : Updates to the C++ language?



incognito
04-20-2004, 02:20 PM
The question is a short one, why isn't C++ updated as much as Java? We take a look at when Java was created we see that they first picked and choosed which features to implement and which features from other languages not to implement in Java, for whatever reason. Java gets updated once in a while, and C++, has just stayed behind........why? I mean once you have an original concept and you just have to improve on it I think the chances are that you're new improved product will be much better than the first one. Java improved on many different languages that are still around, perhaps no other language as much as C++. Then we have people who just like to point out all of the bad features of C++. I mean why not just take a look around at C++ and start redoing some of these things like they do in Java? Just a thought. I personally program in Java where I work (still trying to get the hang of it), and you start noticing the diferences and I can't help but wish that some of the features that are not really good in C++ be ammended. Or perhaps should I start thinking about C++ being done with? I mean I really love this language, and I know that sometime we're going to have to let go of it, sooner or later we probably will.

Dante Shamest
04-20-2004, 03:34 PM
I don't think we need to make much changes to the C++ language itself, but I do wish the standard C++ library would be made more up to date. Efforts like Boost (http://www.boost.org/) are encouraging, though.

Thantos
04-20-2004, 03:39 PM
Well for one isn't Java controlled by one body? C++ is not controlled in such a manner. Also the last update for C++ was in '99 IIRC so I don't think much has really changed in the last 5 years that would warrent such a revision.

Prelude
04-20-2004, 07:28 PM
>The question is a short one, why isn't C++ updated as much as Java?
The answer is a long one. But summarized, Java doesn't have to consider compatibility with another language, Java wasn't backed by prior experience as much as C++ and made early mistakes that needed to be addressed.

Java wasn't originally designed to be a general language, but it has evolved into one by adding standard classes to the library. The language itself is taking a "learn as we go" approach, so frequent improvements are to be expected. This is even more so when the language is owned by a single body that is able to dictate changes. C++ has to maintain a lot of precedent, so you shouldn't expect frequent or drastic changes this late in its evolution.

cozman
04-20-2004, 07:38 PM
C++ is not controlled in such a manner.

This is untrue, there is a C++ board that decides on the new standards.

The next standard is being discussed right now, I heard 2005 is the year when we'll start to see likely changes, but my bet is that it won't be until closer to 2010 that we have compilers that can handle it with decent efficiency. (VC++ just now added partial template specialization in the latest release)

Some things I've read from those on the board:
-No major changes are going to be made, but that depends on your definition of major.
-The new C99 types are going to be added, the latest C standard apparently added a new header (IIRC stdtype.h) with certain types defined.
-Several things in boost will make their way into C++, there is a discussion of adding threading, which would be a rather large addition.
-"Embarassments" like vector<vector<int> > should be fixed.

I forget who it was, but one membre of the C++ Standardization committe wrote a short paper on parts of boost that are being considered for integration, changes he proposed for the preprocessor, and removal of embarassments. He made the statement that the committee realizes that if C++ isn't kept up to date as well as compatibile it will lose relevancy.

incognito
04-20-2004, 07:41 PM
Thank you for your replies guys, I didn't know there was such a movement as boost. Good stuff. I guess it all boils down to a computer language being a tool, from which you choose to get a job done. This is how I need to start looking at things. I am glad however that there are such movements as boost.

Thantos
04-20-2004, 09:45 PM
This is untrue, there is a C++ board that decides on the new standards. They maintain their standard which is hopefully what the majority of people use.

okinrus
04-20-2004, 09:47 PM
I think the next big thing will be improvements to editors. There's so much more that could be done better within the editors, not just in presenting the source code but also detecting syntax mistakes before compiling. If I type something like
print("hello") and print is not defined, it would be a good thing if the editor could notify the user.

I also think the view of the source code could be managed better. Visual C++ has a class view but it would be much easier if they showed classes in a UML like way. Automatic hyperlinking of the sourcecode would also be cool.

Thantos
04-20-2004, 09:50 PM
print("hello") and print is not defined, it would be a good thing if the editor could notify the user. Mine does, when I go to compile it I get a big fat error

JaWiB
04-20-2004, 10:11 PM
I think the next big thing will be improvements to editors. There's so much more that could be done better within the editors, not just in presenting the source code but also detecting syntax mistakes before compiling. If I type something like
print("hello") and print is not defined, it would be a good thing if the editor could notify the user.

I also think the view of the source code could be managed better. Visual C++ has a class view but it would be much easier if they showed classes in a UML like way. Automatic hyperlinking of the sourcecode would also be cool.
That doesn't really have anything to do with the language. You could go out and code yourself an editor or even an IDE with those features. You wouldn't even have to use C++ to do it...

okinrus
04-20-2004, 10:50 PM
That doesn't really have anything to do with the language. You could go out and code yourself an editor or even an IDE with those features.

Quite a long time

My point is that there's few improvements to be made to the language itself. It is the presentation of data and code that must change.

cozman
04-20-2004, 11:11 PM
I think that trying to make too many improvments to C++ instead of just changing languages will end up speeding up the shift away from C++. If the C++ committee decided that Java was gaining ground and that they needed Garbage Collection (which isn't going to happen) the people using C++ instead of Java b/c they didn't want things like built in GC, would leave, and the ones who really wanted that GC were probably already using a language that had it. If they stick to small changes to the core language and keep the STL fairly current, I think C++ can last a long time in the fields where it remains the best tool..

adrianxw
04-21-2004, 01:01 AM
>>> print("hello") and print is not defined, it would be a good thing if the editor could notify the user.

That would be awful! An editor is a tool for entering text/code/whatever - if it were checking syntax as you went, you'd have to develop your files in the order in which they will appear in your final application. The Print() function may be in file/header that someone else in the team is developing - that means I can't complete my module until I have there's.

okinrus
04-21-2004, 01:48 AM
That would be awful! An editor is a tool for entering text/code/whatever - if it were checking syntax as you went, you'd have to develop your files in the order in which they will appear in your final application. The Print() function may be in file/header that someone else in the team is developing - that means I can't complete my module until I have there's.

Didn't think of that. I think the notifying here could be a matter of interpretation. If all the editor did was highlighted the function, I don't it would be too much of a problem. Certainly would not want to put up a message box. However, if hyperlinks were used this error wouldn't even have to be notified.

I typically write stubs for code that has not been completed, sometimes even using dependency diagrams to determine which modules must be completed first. Of course, since I'm the only programmer this has never been too much of a problem.

nvoigt
04-21-2004, 01:55 AM
>print("hello") and print is not defined, it would be a good thing if the editor could notify the user.

It's all about processing power. In VS.NET with Visual Assist ( don't know which application has this feature, Visual Assist is a VS.NET PlugIn ) if you type your code it's compiled on the fly in the background and compiler errors are underlined like spelling errors in word. The tooltip shows the compiler error. To be more correct, it's only parsed, not compiled, but the result is the same. It even uses the office spellchecker for your comment and string lines.
It's a great tool, but I wouldn't want to use it on my old PII 400 that I ran VC6 on.

okinrus
04-21-2004, 02:33 AM
It's all about processing power. In VS.NET with Visual Assist ( don't know which application has this feature, Visual Assist is a VS.NET PlugIn ) if you type your code it's compiled on the fly in the background and compiler errors are underlined like spelling errors in word. The tooltip shows the compiler error. To be more correct, it's only parsed, not compiled, but the result is the same. It even uses the office spellchecker for your comment and string lines.
It's a great tool, but I wouldn't want to use it on my old PII 400 that I ran VC6 on.

Yes, I have VS.NET, but I've been only using the Intellisense features. My main complaint is that it's difficult to hop between different places in the source code. Usually this isn't too bad unless if the code is badly designed but I would like an interface overall more like a browser. For example, I would like to view a class like Tile that looks something like this



----------------------
| Tile |
-------------------------------------------------------------
| Tile(const CDC* dcSrc, int x, int y, int w, int h) |
|........ |
| bool draw(CDC* dcDst, int x, int y) |
--------------------------------------------------------------

And then clicking on the appropriate method function will show a screen with filled with the code for the function and clicking on the back button will go back to the class definition. When editing any particular method function there's more information than is needed to edit the function, I think. A user editing a given function only needs to see the class data and maybe some global data. Ideally, a programmar would have two views, one showing the code he or she is editing and another showing the data structures.

thefroggy
04-21-2004, 06:20 AM
And then clicking on the appropriate method function will show a screen with filled with the code for the function and clicking on the back button will go back to the class definition.

Incidentally, I just coded a very simple version of such an editor for my multiuser database server. Objects in the database can have functions (in my own scripting language) attached to them. I built a web interface in PHP to connect to the server and retrieve the list of functions on an object. Clicking on a function name will bring up a text area with the source of the function that can be changed and sent to the server to be recompiled into bytecode.

It's an extremely simple example of what could be done, but very effective nonetheless.

DavidP
04-21-2004, 05:23 PM
Java improved on many different languages that are still around, perhaps no other language as much as C++. Then we have people who just like to point out all of the bad features of C++. I mean why not just take a look around at C++ and start redoing some of these things like they do in Java?



You evil liar! You devil! How dare you promote the Father of Lies (Java) at a C++ programming board!


just kidding...I know Java as well, and although I use C++ much more heavily because I don't really like Java, I must admit Java does have some features that are very nice. I quite like interfaces myself, which are possible in C++ but arent very common and are a little more defined in Java.

incognito
04-21-2004, 05:56 PM
You evil liar! You devil! How dare you promote the Father of Lies (Java) at a C++ programming board!


just kidding...I know Java as well, and although I use C++ much more heavily because I don't really like Java, I must admit Java does have some features that are very nice. I quite like interfaces myself, which are possible in C++ but arent very common and are a little more defined in Java.
:) I mean that they improved some of the things of other languages when they incorporated some of the ideas into this language, but on the other hand they also messed up in some things.