|
Prev: glib or glibc
Next: software to form 'fair' groups?
From: rupika on 22 Jun 2008 00:37 hi i have been recently told that there is no exception handling ic c+ +.?? as far as i remember i have read, it has. also java has exception handling for sure but there we can use finally also which we cant use in c ++. what other differences do we have in the two languages c++ and java in exception handling. and which one is better?
From: Richard Heathfield on 22 Jun 2008 01:26 rupika said: > hi > i have been recently told that there is no exception handling ic c++.?? Distrust your source. C doesn't (except in a very rudimentary signally kind of way), but C++ does. > as far as i remember i have read, it has. It has. See Section 15 of ISO/IEC 14882:1998. > also java has exception handling for sure but there we can use finally > also which we cant use in c ++. You are very likely to find that C++ can in fact do what you want it to do, even if it doesn't do it in quite the same way as Java. > what other differences do we have in > the two languages c++ and java in exception handling. For a full answer, you would do well to consult the language specifications for the languages you're asking about... > and which one is better? ....and that's just flame-bait. If you're trying to decide on whether to learn Java or C++, the answer is simple: learn them both. -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ Google users: <http://www.cpax.org.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 July 1999
From: santosh on 22 Jun 2008 03:09 rupika wrote: > hi > i have been recently told that there is no exception handling ic c+ > +.?? C++ certainly has exception handling. > as far as i remember i have read, it has. You remember correctly. > also java has exception handling for sure but there we can use finally > also which we cant use in c ++. what other differences do we have in > the two languages c++ and java in exception handling. and which one is > better? Both Java's and C++'s exceptions are quite similar and each can do almost everything the other can. I suggest that you not chose between C++ and Java based on this feature. If you want an interpreted language with a very large number of built-in facilities then go with Java. If you want maximum flexibility at the cost of a somewhat steeper learning curve then start with C++.
From: Lars Rune Nøstdal on 22 Jun 2008 08:26 santosh wrote: > rupika wrote: > >> hi >> i have been recently told that there is no exception handling ic c+ >> +.?? > > C++ certainly has exception handling. > >> as far as i remember i have read, it has. > > You remember correctly. > >> also java has exception handling for sure but there we can use finally >> also which we cant use in c ++. what other differences do we have in >> the two languages c++ and java in exception handling. and which one is >> better? > > Both Java's and C++'s exceptions are quite similar and each can do > almost everything the other can. > > I suggest that you not chose between C++ and Java based on this > feature. If you want an interpreted language with a very large number > of built-in facilities then go with Java. If you want maximum > flexibility at the cost of a somewhat steeper learning curve then start > with C++. > Java is not interpreted. It is compiled to byte-code then JIT-compiled to machine code. About exceptions, I'd say C++ has very poor and buggy support for it: http://yosefk.com/c++fqa/exceptions.html -- Lars Rune N�stdal http://nostdal.org/
From: Juha Nieminen on 22 Jun 2008 12:03
Lars Rune N�stdal wrote: > then JIT-compiled to machine code. Exactly which part of the Java specification says this? > About exceptions, I'd say C++ has very poor and buggy support for it: Buggy? A bug means a programming mistake, ie. the program working erroneously, not in the intended way. By definition, "buggy support" is compiler-specific. Compiler may have bugs, specifications don't. (Specifications may have poor design choices or even errors, but those aren't called "bugs".) |