Sorry, got cut off there.
Nevertheless, java tools are capable of analyzing code much more smartly
(you'told you use Idea).
C++ tools can do it in theory, it's just that no one has written a
good one yet (Eclipse tries...). It is of course much harder to do
than for Java, and would require a well optimized C++ parser and
analyser to give acceptable performance.
I think there are a number of sourceforge projects working along these
lines.
Yes, but in systems which relay their error handling on exceptions (which
ensure you do not forget to handle the error) the finally clause is a-must.
Not at all - C++ doesn't have it, and instead has the superior
alternative of destructors.
It it needed for programmers not to forget to deallocate resources.
It doesn't help the not forget, and that's its main problem.
In C, most dynamic resources are allocated on the stack, exceptions are
rarely used. Not surprisingly, that C++ experts are not aware about this
critical feature.
"critical"!?
In OOP, objects are typically allocated dynamically on the
heap;
I don't think that's a property of OOP as such, rather languages like
Java and Smalltalk.
http://dictionary.reference.com/search?q=object-oriented programming
therefore,
resourceObject = new Object();
try
use(recource)
fianlly
resource.free();
end;
is written as a prayer.
Yes, sadly that has become a common means of resource management. It's
just as error prone as C's explicit memory management.
In C++ where objects are created on the stack, it is less topical issue.
And, crucially, stack based proxies are used for heap based objects.
Hardly this feature will make programs more reliable.
I don't see that it affects reliability either way. But it makes
programs that use it quicker to develop, particularly when combined
with generic programmming or pre-built libraries. Isn't that your main
argument for using Java? Java even admits that it's a good thing, with
its String + Object/built-in hack.
Now think of a language where it's possible to mimic java's String
interface without special compiler support. Yup, that's C++ (among
others).
Should we pull
properties and indexers from Delphi? I don't know.
Properties would be quite useful in C++ for generic programming if
nothing else, but the language is powerful enough to allow simulation
of properties using templates and operator overloading. Java and C++
can certainly do without them though.
Lately, the same desire visits me. I have a similar vision on the lang of
my dream. And when I think about it, "D" always comes to the mind.
http://www.digitalmars.com/d/index.html
Sadly, not as good as it could be, at least not yet.
Tom