The future of c++

Discussion in 'C++' started by cafegee, Apr 28, 2005.

  1. cafegee

    cafegee Guest

    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?
     
    cafegee, Apr 28, 2005
    #1
    1. Advertising

  2. cafegee

    Phlip Guest

    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
     
    Phlip, Apr 28, 2005
    #2
    1. Advertising

  3. 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):x(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
     
    Ioannis Vranos, Apr 28, 2005
    #3
  4. 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):x(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
     
    Ioannis Vranos, Apr 28, 2005
    #4
  5. cafegee

    Phlip Guest

    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
     
    Phlip, Apr 28, 2005
    #5
  6. cafegee

    belief Guest

    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" <> ????
    news:...
    > 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?
     
    belief, May 8, 2005
    #6
  7. 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/issues/05/01/COptimizations/default.aspx

    http://pluralsight.com/blogs/hsutter/archive/2004/10/05/2672.aspx

    http://blogs.msdn.com/branbray/archive/2003/11/07/51007.aspx

    http://www.accu.org/conference/pres...Relevant_on_Modern_Environments_(keynote).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
     
    Ioannis Vranos, May 8, 2005
    #7
  8. cafegee

    Wisdo Tang Guest

    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" <> ???? 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/issues/05/01/COptimizations/default.aspx
    >
    > http://pluralsight.com/blogs/hsutter/archive/2004/10/05/2672.aspx
    >
    > http://blogs.msdn.com/branbray/archive/2003/11/07/51007.aspx
    >
    >

    http://www.accu.org/conference/pres...Relevant_on_Modern_Environments_(keynote).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
     
    Wisdo Tang, May 10, 2005
    #8
  9. 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
     
    Ioannis Vranos, May 10, 2005
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Midnight Java Junkie

    future of high-speed cable modems?

    Midnight Java Junkie, Jun 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    477
    Midnight Java Junkie
    Jun 20, 2004
  2. Elias Politakis

    Is ASP.NET the future of web applications

    Elias Politakis, Dec 1, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,340
    Cowboy \(Gregory A. Beamer\)
    Dec 1, 2003
  3. Elias Politakis

    Is ASP.NET the future of web applications

    Elias Politakis, Dec 1, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    469
  4. =?Utf-8?B?QW5kcmV3?=

    Future of ASP

    =?Utf-8?B?QW5kcmV3?=, Apr 29, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    412
  5. James P.
    Replies:
    7
    Views:
    12,682
    phamtasmic
    Jul 13, 2004
Loading...

Share This Page