R
Robert
Where can i find a free web- based VC++ course? (also i've to dowanload it)
I'm interested also in VB and C++
thanks, Robert
I'm interested also in VB and C++
thanks, Robert
it)Robert said:Where can i find a free web- based VC++ course? (also i've to dowanload
I'm interested also in VB and C++
Robert said:Do you think that Ruby will have the success of VB?
Phlip said:Define "success".
Ruby has a huge, rabid community of users, pushing technology like Gem,
Rails, and YAML that VB users can only dream of, despite VB's corporate
backing.
However, Ruby will never be marketed as relentlessly and nauseatingly as a
Disney teen starlet...
Ioannis said:What is the benefit for Ruby being interpreted? Also does "scripting"
imply that it is for special purposes?
Ioannis said:Also what exactly is dynamic typing? Something like
int i= 1;
string s= i.ToString();
Ioannis said:What is the benefit for Ruby being interpreted?
Also does "scripting" imply that it is for
special purposes?
Also what exactly is dynamic typing? Something like
int i= 1;
string s= i.ToString();
Phlip said:That is "weak typing". Perl does that. Don't get me started.
C++ is weakly, statically typed. (The weakness comes from issues like void*
or bool, not from automagic string conversion.)
Ruby, like Smalltalk, Pascal, or Python, is strongly typed. Unlike Pascal,
and like the others, it is dynamically typed.
In C++, static typing means this:
void Foo(Bar &);
That function Foo() will only accept objects whose type is known at compile
time to inherit from Bar. Foo() can only call methods known to exist in Bar
or higher, but not lower. Methods bind at runtime, but types bind at compile
time.
In a dynamic typing system, all objects inherit from a magic thing called
Object. So, in Ruby...
def Foo(aBar)
aBar.baz()
end
At compile time, all the compiler did was hash 'baz'. At runtime, aBar.baz()
uses Object's magic methods to fetch the target method, by hash.
This magic
trades just a little execution overhead for a lot of cognitive freedom. We
can control exactly how typed Foo() is. We can assert that it only take Bar
objects, or we can leave it free to take anything that has a baz().
Further, in Ruby everything is an object, including classes. So you can pass
a class, by name, into a method. This is what C++ tries to give us with
templates. But C++ refuses to change C's type system beyond our simple
vtable, so C++ cannot truly treat classes as objects, and each instance of a
template is a different entity.
Ioannis said:I am not sure treating classes as objects having any real benefits.
approach).Yes in C++ one can use
templates to pass various types (actually to create function instances for the type),
which I think is sufficient (and vtables are not used in this template
...when Hugunin also announced that he was joining
Microsoft to continue working on IronPython's evolution.
Phlip said:the type),
approach).
You are looking too narrowly at each detail of my post. The big picture:
Dynamic typing is orthogonal to execution efficiency, and it provides better
cognitive efficiency. So do block closures, continuations, reflection, and
interpreted evaluation.
The last one means the function eval() can run a string of Ruby, and that
string can see local and global variables, and can change an part of their
context. You can eval() a string that changes or adds a method to Object,
for example.
I thought Microsoft forbade open source projects. (Except like WTL...)
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.