C
Carl Daniel [VC++ MVP]
Greg said:Bo Persson said:std::vector<int> x;
std::vector<int> x;
vs.
int[] x;
I rest my case
std::vector<int> x;
vs.
System.Collections.Generic.List<int> x;
Better to compare apples to apples...
-cd
Greg said:Bo Persson said:std::vector<int> x;
std::vector<int> x;
vs.
int[] x;
I rest my case
Ok, then count me in with the "People".
Bo Persson
Greg said:e.g. int[] x; v.s. int x[];
C# has the advantage of practical "non-rushed" thinking in its design.
JAL said:This is as expected in a garbage collected runtime,
JAL said:This is as expected in a garbage collected runtime, but you can still do
deterministic cleanup:
http://www.geocities.com/Jeff_Louie/oop26.htm
Greg said:Is it your general opinion that C# is generally designed/intended/ready to
replace C++? I know the answer is not black and white but please repond YES
or NO (add any comments if you would like)
I just thought it might be interesting to get a tally. This is related to a
previous thread. So far we have two NOs from "aa" and Bo Persson.
JAL said:I don't really understand your point. Java and C# are garbage collected and
objects are created using reference semantics.They do not normally use
reference counting so finalization is not deterministic. Seems to me there is
a direct link between the decision to use garbage collection and the lack of
deterministic finalization.
[...]
Greg said:int[] x;
x has all the methods of ICollection and Array. So I think int[] x is apples
to apples.
JAL said:I don't really understand your point. Java and C# are garbage
collected and objects are created using reference semantics.They do
not normally use reference counting so finalization is not
deterministic. Seems to me there is a direct link between the
decision to use garbage collection and the lack of deterministic
finalization.
JAL said:No... but smart pointers replace the try catch also
void foo()
{
auto_ptr<MyClass> p(new MyClass);
p->DoSomething();
}
replaces
void foo()
{
MyClass* p;
try {
p = new MyClass;
p->DoSomething();
delete p;
}
catch (...) {
delete p;
throw;
}
}
JAL said:No... but smart pointers replace the try catch also
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.