Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > The future of c++

Reply
Thread Tools

The future of c++

 
 
cafegee
Guest
Posts: n/a
 
      04-28-2005
As far as I concern, there is no reason that we should pattern the
future of c++ language on the current Java or c#. Why should we have
to so? c++ language has it's own specialty,it is a effiecent,flexible
language,Why should it be developed to a cross-platform language,like
Java?
 
Reply With Quote
 
 
 
 
Phlip
Guest
Posts: n/a
 
      04-28-2005
Ioannis Vranos wrote:

> Yes, in CLI (.NET), CLI types map directly to the language types. CLI

types *are* structs.

Does that let you _inherit_ from 'int', _within_ the target language? I'm
not talking about some reflection trick, or stepping outside the language.

cafegee wrote:

> As far as I concern, there is no reason that we should pattern the
> future of c++ language on the current Java or c#. Why should we have
> to so? c++ language has it's own specialty,it is a effiecent,flexible
> language,Why should it be developed to a cross-platform language,like
> Java?


Allow me to be the first for you:

D Programming Language Compiled, garbage collected, simpler C/C++
replacement by Walter Bright (wrote first DOS C++ compiler). Maximum
similarity to C/C++, except where backward ...
www.digitalmars.com/d/


No, I haven't used it. It probably blows Ruby away, too. Maybe I'l start a
learner project tomorrow. I wonder how it tests-first.

--
Phlip
http://www.c2.com/cgi/wiki?ZeekLand


 
Reply With Quote
 
 
 
 
Ioannis Vranos
Guest
Posts: n/a
 
      04-28-2005
Phlip wrote:

> Does that let you _inherit_ from 'int', _within_ the target language? I'm
> not talking about some reflection trick, or stepping outside the language.



temp.cpp(4) : error C3246: 'MyType' : cannot inherit from 'System::Int32' as it
has been declared as '__sealed'
temp.cpp(1) : see declaration of 'System::Int32'


The types themselves are sealed structs. However one can always do:


#using <mscorlib.dll>


__value struct MyType
{
int x;

public:
MyType(int val)(val) {}

System::String *ToString() { return "Some other answer"; }

// .NET types have operator definitions as static member functions
static const MyType op_Assign (MyType &m, int &val)
{
m.x= val;
return m;
}
};


int main()
{
using namespace System;

int x= 4;

MyType y= x;

Console::WriteLine(x.ToString());

Console::WriteLine(y.ToString());
}


C:\c>temp
4
Some other answer

C:\c>



--
Ioannis Vranos

http://www23.brinkster.com/noicys
 
Reply With Quote
 
Ioannis Vranos
Guest
Posts: n/a
 
      04-28-2005
Fixed:


Ioannis Vranos wrote:

> temp.cpp(4) : error C3246: 'MyType' : cannot inherit from
> 'System::Int32' as it
> has been declared as '__sealed'
> temp.cpp(1) : see declaration of 'System::Int32'
>
>
> The types themselves are sealed structs. However one can always do:
>
>
> #using <mscorlib.dll>



__value class MyType
> {
> int x;
>
> public:
> MyType(int val)(val) {}
>
> System::String *ToString() { return "Some other answer"; }
>
> // .NET types have operator definitions as static member functions
> static const MyType op_Assign (MyType &m, int &val)
> {
> m.x= val;
> return m;
> }
> };
>
>
> int main()
> {
> using namespace System;
>
> int x= 4;
>
> MyType y= x;
>
> Console::WriteLine(x.ToString());
>
> Console::WriteLine(y.ToString());
> }
>
>
> C:\c>temp
> 4
> Some other answer
>
> C:\c>




--
Ioannis Vranos

http://www23.brinkster.com/noicys
 
Reply With Quote
 
Phlip
Guest
Posts: n/a
 
      04-28-2005
Ioannis Vranos wrote:

> > The types themselves are sealed structs. However one can always do:


> > #using <mscorlib.dll>


I have never found a reason to extend the 'int' type. But I would generally
prefer a language have a greater capacity for elegance. That lowers the cost
of the various techniques which can do more with less.

--
Phlip
http://www.c2.com/cgi/wiki?ZeekLand




 
Reply With Quote
 
belief
Guest
Posts: n/a
 
      05-08-2005
I agree. It's not problem what Vranos said.
in now C++, we can give a class wraped the basic type without more efficency
than Java or C#.
Bjarne Stroustrup also give a method to prevent a class from being
inherited, though it is not easy as a keyword "final" like java and "sealed"
like C#.

Stroustrup.B says the next version of C++ Standard will strenghten the
constraint of the template argument.ie.type checking about template
argument. Maybe this is the neccesary point about C++ 's future.^_^

"cafegee" <(E-Mail Removed)> ????
news:(E-Mail Removed) ...
> As far as I concern, there is no reason that we should pattern the
> future of c++ language on the current Java or c#. Why should we have
> to so? c++ language has it's own specialty,it is a effiecent,flexible
> language,Why should it be developed to a cross-platform language,like
> Java?



 
Reply With Quote
 
Ioannis Vranos
Guest
Posts: n/a
 
      05-08-2005
belief wrote:

> I agree. It's not problem what Vranos said.
> in now C++, we can give a class wraped the basic type without more efficency
> than Java or C#.



I am not sure what you mean. C++ native code is naturally faster than managed code of Java
and .NET.


C++ managed code is more efficient than any other language of .NET including VC#. In VS
2005, C++ is the systems programming language of .NET. So C++ is the most efficient in
both worlds.



Some references:

http://msdn.microsoft.com/msdnmag/is...s/default.aspx

http://pluralsight.com/blogs/hsutter...0/05/2672.aspx

http://blogs.msdn.com/branbray/archi.../07/51007.aspx

http://www.accu.org/conference/prese...keynote%29.pdf


And a page of mine:

http://www23.brinkster.com/noicys/cppcli.htm


> Bjarne Stroustrup also give a method to prevent a class from being
> inherited, though it is not easy as a keyword "final" like java and "sealed"
> like C#.



In .NET managed classes, C++ has also the keyword sealed. Under .NET it is not a feature
of some language, it is a feature and requirement of .NET. And C++ being the systems
programming language of it, couldn't miss it, while C# misses some low level .NET features
that C++ provides (you may check the 3rd link of the above).



--
Ioannis Vranos

http://www23.brinkster.com/noicys
 
Reply With Quote
 
Wisdo Tang
Guest
Posts: n/a
 
      05-10-2005
Hi, Vranos.

Of course, what you said is right.
factly, I just want to give the expression that the Standard C++ should
never change
as the cross-platform language like Java because of enough facilities.
ie.the existance of the C# or another similar language is necessary for
rapid enterprise-developing,
but not for the C++ Standard.
that 's all ^_^

thanks for your respone and detail references.

regards.
wisdo (belief)


"Ioannis Vranos" <(E-Mail Removed)> ???? news:1115538877.282217@athnrd02...
> belief wrote:
>
> > I agree. It's not problem what Vranos said.
> > in now C++, we can give a class wraped the basic type without more

efficency
> > than Java or C#.

>
>
> I am not sure what you mean. C++ native code is naturally faster than

managed code of Java
> and .NET.
>
>
> C++ managed code is more efficient than any other language of .NET

including VC#. In VS
> 2005, C++ is the systems programming language of .NET. So C++ is the most

efficient in
> both worlds.
>
>
>
> Some references:
>
> http://msdn.microsoft.com/msdnmag/is...s/default.aspx
>
> http://pluralsight.com/blogs/hsutter...0/05/2672.aspx
>
> http://blogs.msdn.com/branbray/archi.../07/51007.aspx
>
>

http://www.accu.org/conference/prese...keynote%29.pdf
>
>
> And a page of mine:
>
> http://www23.brinkster.com/noicys/cppcli.htm
>
>
> > Bjarne Stroustrup also give a method to prevent a class from being
> > inherited, though it is not easy as a keyword "final" like java and

"sealed"
> > like C#.

>
>
> In .NET managed classes, C++ has also the keyword sealed. Under .NET it is

not a feature
> of some language, it is a feature and requirement of .NET. And C++ being

the systems
> programming language of it, couldn't miss it, while C# misses some low

level .NET features
> that C++ provides (you may check the 3rd link of the above).
>
>
>
> --
> Ioannis Vranos
>
> http://www23.brinkster.com/noicys



 
Reply With Quote
 
Ioannis Vranos
Guest
Posts: n/a
 
      05-10-2005
Wisdo Tang wrote:

> Hi, Vranos.
>
> Of course, what you said is right.
> factly, I just want to give the expression that the Standard C++ should
> never change
> as the cross-platform language like Java because of enough facilities.



And again, C++ and "Java" are two different things. "Java" is not a language, it is a
language coming together with a platform.


> ie.the existance of the C# or another similar language is necessary for
> rapid enterprise-developing,
> but not for the C++ Standard.



Similarly many (most?) C# programmers confuse the .NET framework facilities with C#/CLI
itself. They think for example that the .NET facilities like Form class, TextBox,
TcpClient, etc are part of C# while they are not. I assume that many VB .NET developers
have similar confusion.

In any case returning to Java-syntax/JVM, if we were to compare C++ with it, we should
also pick a VM platform like .NET and then move to compare each. For example, C++ vs
Java-syntax (which is far more reduced than you think about what consists its syntax) and
then .NET vs JVM.



--
Ioannis Vranos

http://www23.brinkster.com/noicys
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Future of Voice Communication @ BonaFideReviews Silverstrand Front Page News 0 09-27-2005 01:47 PM
Microsoft Windows and the future of Firefox? Victor Firefox 19 06-12-2005 02:04 AM
future of high-speed cable modems? Midnight Java Junkie ASP .Net 0 06-20-2004 06:58 AM
Future Considerations Mr. Garrett Hord Microsoft Certification 1 01-09-2004 06:43 PM
Does EIGRP have a future? Brad Hill Cisco 6 01-07-2004 04:19 PM



Advertisments