C++ versus C++.net

[b][red]This message was edited by IDK at 2005-11-28 13:21:43[/red][/b][hr]
Are C++ and the .net version the same?
If not, do what's the difference one notice when programming?

If I do something in .net, could I compile it to native code? How?

Edit: Actualy, I'm 15 and now I have to choose college (or whatever it's called in english) here in Sweden. The college I'm interested in got three directions(can't think of a better word...). The directions are C++.net Visual Basic.net and Java. Wich should I take?
VB.Net is lame, so I don't want to take that one. If anyone did see this:
http://www.jroller.com/page/matsh?entry=java_history_was_made_today
I am convinced to learn Java some day. But maybe not in college.

Should I learn Java, or C++.net then?
Now, I know OO, asm, and a lot of things, but I can't program in C++ nor Java.

[grey]The one and only [b]Niklas Ulvinge[/b][/grey] [white]aka [b]IDK[/b][/white]






«1

Comments

  • : [b][red]This message was edited by IDK at 2005-11-28 13:21:43[/red][/b][hr]
    : Are C++ and the .net version the same?
    : If not, do what's the difference one notice when programming?
    :
    : If I do something in .net, could I compile it to native code? How?
    :
    : Edit: Actualy, I'm 15 and now I have to choose college (or whatever it's called in english) here in Sweden. The college I'm interested in got three directions(can't think of a better word...). The directions are C++.net Visual Basic.net and Java. Wich should I take?
    : VB.Net is lame, so I don't want to take that one. If anyone did see this:
    : http://www.jroller.com/page/matsh?entry=java_history_was_made_today
    : I am convinced to learn Java some day. But maybe not in college.
    :
    : Should I learn Java, or C++.net then?
    : Now, I know OO, asm, and a lot of things, but I can't program in C++ nor Java.
    :
    : [grey]The one and only [b]Niklas Ulvinge[/b][/grey] [white]aka [b]IDK[/b][/white]
    :
    I believe C++.net is just the MS implementation of C++ in their newest compiler. It probably also has some capabilities to connect to the .NET environment, but I haven't used it so I cannot be sure.

    As far as whether to learn C++ or Java, it is going to be very subjective, but FWIW I prefer C++. My experience with Java is that it is C++ designed to keep you from making some of the most common errors (esp with pointers), but at the price of limiting some of the things you can do (bitwise manipulations, memory management). It also is a P-Code type interpreted language that can be run (theoretically) on any Java platform. That means that the run time environment is doing a lot more for you under the hood, so your code runs slower.

    If you are working in anything that requires bitfield manipulations or low level access, C/C++ is the only way to go. If you want to be able to run on multiple platforms, you probably want Java (though I haven't been involved in any projects that really needed cross-platform capatibility at the executable level).

    [grey]The above is just my opinion, your mileage may vary.[/grey]
  • : : [b][red]This message was edited by IDK at 2005-11-28 13:21:43[/red][/b][hr]
    : : Are C++ and the .net version the same?
    : : If not, do what's the difference one notice when programming?
    : :
    : : If I do something in .net, could I compile it to native code? How?
    : :
    : : Edit: Actualy, I'm 15 and now I have to choose college (or whatever it's called in english) here in Sweden. The college I'm interested in got three directions(can't think of a better word...). The directions are C++.net Visual Basic.net and Java. Wich should I take?
    : : VB.Net is lame, so I don't want to take that one. If anyone did see this:
    : : http://www.jroller.com/page/matsh?entry=java_history_was_made_today
    : : I am convinced to learn Java some day. But maybe not in college.
    : :
    : : Should I learn Java, or C++.net then?
    : : Now, I know OO, asm, and a lot of things, but I can't program in C++ nor Java.
    : :
    : : [grey]The one and only [b]Niklas Ulvinge[/b][/grey] [white]aka [b]IDK[/b][/white]
    : :
    : I believe C++.net is just the MS implementation of C++ in their newest compiler. It probably also has some capabilities to connect to the .NET environment, but I haven't used it so I cannot be sure.

    [blue]I haven't used it either, but it seems it is the same thing as C# (and VB.NET), they all have garbage collection, run on a vitual machine etc.
    I don't know if you can write standard C++ with .NET.

    VB is plain horrible, stay out of it.

    Java is good if you plan to write web applications. There aren't many programmers writing desktop apps in Java, it seems.
    [/blue]


    : As far as whether to learn C++ or Java, it is going to be very subjective, but FWIW I prefer C++. My experience with Java is that it is C++ designed to keep you from making some of the most common errors (esp with pointers), but at the price of limiting some of the things you can do (bitwise manipulations, memory management). It also is a P-Code type interpreted language that can be run (theoretically) on any Java platform. That means that the run time environment is doing a lot more for you under the hood, so your code runs slower.
    : If you are working in anything that requires bitfield manipulations or low level access, C/C++ is the only way to go. If you want to be able to run on multiple platforms, you probably want Java (though I haven't been involved in any projects that really needed cross-platform capatibility at the executable level).
    :
    : [grey]The above is just my opinion, your mileage may vary.[/grey]
    :

    [blue]I agree on all things. Also, beware if someone is trying to make you study Java for embedded systems... the whole idea is just ridiculous.[/blue]
  • replies always get messy, so ill type up here

    C++.net is called MANAGED C++, i believe, as the rest on the .NET platform, use no pointers, low level access, and are garbage collected, as the other guy said. C#, truthfully, only uses a different approach. Other than lang features, compilation on the platform is the SAME,(i think) thats why there is a CLR or Common Lang Runtime.

    Java, i love java. Embedded systems? Wasnt that its original purpose? I may not have understood...
    Well, may be it is true with what the second guy says, although i make some (only toy, well all my programs are) desktop apps, there arent many around. Same for their developers, and i dont think clients will be willing to download the huge java runtime just for apps. We could distribute it, but i think we need a special liscense from Sun...most only use it for web apps, but i hope it doesn't stay that way.

    C++, i would go for that. Heaven sake's, you could write OS's with ANSI C and C++ man!! (Although the API should be in C for non OOP langs) C++ is good for you, im sure.

    Actually, ur choice is what you want to do. If you want to be a hard app programmer, wiht enough exprience to write drivers and low level stuff, but also do high level stuff, C++ is the way to go. For .NET, thats for developers wanting to develop only apps, which are cool and all, and are needed. Java is the same. The only thing to recognize is that both are on platforms, thus you will be programming on a platform, while C/C++ ca go anywhere, it really is based on what u want to do.

    In my philosophy though, i already know enough, all i need now is exprience. If i do go to college, it'll be for engineering or/and astronomy. Programming? I'll learn as i program.

    {2}rIng

    PS sorry for its length.

    : : : [b][red]This message was edited by IDK at 2005-11-28 13:21:43[/red][/b][hr]
    : : : Are C++ and the .net version the same?
    : : : If not, do what's the difference one notice when programming?
    : : :
    : : : If I do something in .net, could I compile it to native code? How?
    : : :
    : : : Edit: Actualy, I'm 15 and now I have to choose college (or whatever it's called in english) here in Sweden. The college I'm interested in got three directions(can't think of a better word...). The directions are C++.net Visual Basic.net and Java. Wich should I take?
    : : : VB.Net is lame, so I don't want to take that one. If anyone did see this:
    : : : http://www.jroller.com/page/matsh?entry=java_history_was_made_today
    : : : I am convinced to learn Java some day. But maybe not in college.
    : : :
    : : : Should I learn Java, or C++.net then?
    : : : Now, I know OO, asm, and a lot of things, but I can't program in C++ nor Java.
    : : :
    : : : [grey]The one and only [b]Niklas Ulvinge[/b][/grey] [white]aka [b]IDK[/b][/white]
    : : :
    : : I believe C++.net is just the MS implementation of C++ in their newest compiler. It probably also has some capabilities to connect to the .NET environment, but I haven't used it so I cannot be sure.
    :
    : [blue]I haven't used it either, but it seems it is the same thing as C# (and VB.NET), they all have garbage collection, run on a vitual machine etc.
    : I don't know if you can write standard C++ with .NET.
    :
    : VB is plain horrible, stay out of it.
    :
    : Java is good if you plan to write web applications. There aren't many programmers writing desktop apps in Java, it seems.
    : [/blue]
    :
    :
    : : As far as whether to learn C++ or Java, it is going to be very subjective, but FWIW I prefer C++. My experience with Java is that it is C++ designed to keep you from making some of the most common errors (esp with pointers), but at the price of limiting some of the things you can do (bitwise manipulations, memory management). It also is a P-Code type interpreted language that can be run (theoretically) on any Java platform. That means that the run time environment is doing a lot more for you under the hood, so your code runs slower.
    : : If you are working in anything that requires bitfield manipulations or low level access, C/C++ is the only way to go. If you want to be able to run on multiple platforms, you probably want Java (though I haven't been involved in any projects that really needed cross-platform capatibility at the executable level).
    : :
    : : [grey]The above is just my opinion, your mileage may vary.[/grey]
    : :
    :
    : [blue]I agree on all things. Also, beware if someone is trying to make you study Java for embedded systems... the whole idea is just ridiculous.[/blue]
    :

  • : Embedded systems? Wasnt that its original purpose?

    [blue]It depends on what you mean with embedded. If you mean Pocket PC or mobile phones, then Java will work fine. If you mean controlling cars and airplanes or whatever, then Java is out of the question.[/blue]

    : C++, i would go for that. Heaven sake's, you could write OS's with ANSI C and C++ man!! (Although the API should be in C for non OOP langs) C++ is good for you, im sure.

    [blue]It will not be a very good OS sence you can't access CPU registers/accumulators and condition code registers etc with ANSI C/C++.
    With some inline asm you could, but then it won't be ANSI C/C++ anymore.[/blue]

  • [b][red]This message was edited by Gregry2 at 2005-11-29 4:27:21[/red][/b][hr]
    : : Embedded systems? Wasnt that its original purpose?
    :
    : [blue]It depends on what you mean with embedded. If you mean Pocket PC or mobile phones, then Java will work fine. If you mean controlling cars and airplanes or whatever, then Java is out of the question.[/blue]
    :

    From my book, Teach Yourself Java in 21 days (its been more than 21 days...)

    "The Java Language was developed at Sun Microsystems in 1990 as part of a project code-named Green, a small research effort into consumer electronics. Researchers were working on a programming language for SMART APPLIANCES of the future to talk to each other, in the tradition of "The Jetsons" TV series-step one in realizing a society in which giant glass bubbles drop over your body and dress you every morning"

    [Appendix A, Section "Java Grew from a Little Oak, paragraph 1 (pg 634), capitals added in SMART APPLIANCES]

    the next paragraphs, why not, its intresting :)

    "To put research into action, Green developed a prototype device called the Star 7, a handheld gadget resembling today's PDA devices that could communicate with others of its own kind.

    The original idea was to develop the Star 7 operating system in C++, the popular object oriented programming language created by Bjarne Stroustrup. However, Green project member James Gosling became fed up with how C++ was performing on the task, so he barricaded himself in his office and wrote a new language to handle the Star 7 better.

    The language was called Oak, in honor of a tree Gosling could see out of his office window. It was later renamed Java in honor of the lawyers who found out about another product named Oak(and didn't want Sun to go on a limb).

    Because Java was designed for EMBEDDED ELECTRONIC DEVICES INSTEAD OF STATE-OF-THE ART PCs, it had to be small, efficient, and easily portable to a wide range of hardware devices. It also had to be reliable. People had learned to live with the occasional system crashes and lockups in a 30MB application. However, there aren't many people will to debig an elevator while its programmers work out the kinks"[again caps are added, use relative positioning guys]

    im tired, im sure you are, so ill stop there.

    : : C++, i would go for that. Heaven sake's, you could write OS's with ANSI C and C++ man!! (Although the API should be in C for non OOP langs) C++ is good for you, im sure.
    :
    : [blue]It will not be a very good OS sence you can't access CPU registers/accumulators and condition code registers etc with ANSI C/C++.
    : With some inline asm you could, but then it won't be ANSI C/C++ anymore.[/blue]
    :
    :

    the UNIX os was distributed in C, and inline ASM is fine, i guess...
    {2}rIng


  • : [b][red]This message was edited by Gregry2 at 2005-11-29 4:27:21[/red][/b][hr]
    : : : Embedded systems? Wasnt that its original purpose?
    : :
    : : [blue]It depends on what you mean with embedded. If you mean Pocket PC or mobile phones, then Java will work fine. If you mean controlling cars and airplanes or whatever, then Java is out of the question.[/blue]
    : :
    :
    : From my book, Teach Yourself Java in 21 days (its been more than 21 days...)
    :
    : "The Java Language was developed at Sun Microsystems in 1990 as part of a project code-named Green, a small research effort into consumer electronics. Researchers were working on a programming language for SMART APPLIANCES of the future to talk to each other, in the tradition of "The Jetsons" TV series-step one in realizing a society in which giant glass bubbles drop over your body and dress you every morning"
    :
    : [Appendix A, Section "Java Grew from a Little Oak, paragraph 1 (pg 634), capitals added in SMART APPLIANCES]
    :
    : the next paragraphs, why not, its intresting :)
    :
    : "To put research into action, Green developed a prototype device called the Star 7, a handheld gadget resembling today's PDA devices that could communicate with others of its own kind.
    :
    : The original idea was to develop the Star 7 operating system in C++, the popular object oriented programming language created by Bjarne Stroustrup. However, Green project member James Gosling became fed up with how C++ was performing on the task, so he barricaded himself in his office and wrote a new language to handle the Star 7 better.
    :
    : The language was called Oak, in honor of a tree Gosling could see out of his office window. It was later renamed Java in honor of the lawyers who found out about another product named Oak(and didn't want Sun to go on a limb).
    :
    : Because Java was designed for EMBEDDED ELECTRONIC DEVICES INSTEAD OF STATE-OF-THE ART PCs, it had to be small, efficient, and easily portable to a wide range of hardware devices. It also had to be reliable. People had learned to live with the occasional system crashes and lockups in a 30MB application. However, there aren't many people will to debig an elevator while its programmers work out the kinks"[again caps are added, use relative positioning guys]

    [blue]Lol, well from what we know from real life, Java isn't small, it isn't efficient and it isn't reliable. Nice try Sun, better luck next time :-)
    At least it is portable, somewhat. (I would like to see how they manage to implement java.swing as required by the standard, in a microcontroller without any graphical output...).

    To work smooth in a real-time application, the CPU core itself must contain the Java VM. I think there are such products out there, but they must be few and not used very often. They might get more popular in the future, I don't know. But my opinion is that there is no -reason- to put Java in a real-time app. Except if you own shares in Sun...
    [/blue]


    :
    : im tired, im sure you are, so ill stop there.
    :
    : : : C++, i would go for that. Heaven sake's, you could write OS's with ANSI C and C++ man!! (Although the API should be in C for non OOP langs) C++ is good for you, im sure.
    : :
    : : [blue]It will not be a very good OS sence you can't access CPU registers/accumulators and condition code registers etc with ANSI C/C++.
    : : With some inline asm you could, but then it won't be ANSI C/C++ anymore.[/blue]
    : :
    : :
    :
    : the UNIX os was distributed in C, and inline ASM is fine, i guess...
    : {2}rIng
    :

    [blue]I think UNIX was written in the old K&R C, which is not ANSI C.
    But there are no reasons to write an OS in strict ANSI C... I mean, why would you want to port an OS...? [/blue]
  • : [blue]I think UNIX was written in the old K&R C, which is not ANSI C.
    : But there are no reasons to write an OS in strict ANSI C... I mean, why would you want to port an OS...? [/blue]
    :
    Lol...

    Thanks for your replies

    I'm actually going to take a course(what ever it's named) in university preparing for chalmers (a gothenburgish ;-) school).
    Then it's 200 points (like hours), that I can choose wich course I want to take. They offer a lot but I want to have something with programming (or maybe I will like to do something else...)

    But I didn't get it, is it possible to make ordinary apps with C++.net, not .net?
    Is like 2 modes, one is .net(bad, slow) and the other is native(good, fast)?
  • [b][red]This message was edited by Lundin at 2005-11-29 7:32:22[/red][/b][hr]
    : : [blue]I think UNIX was written in the old K&R C, which is not ANSI C.
    : : But there are no reasons to write an OS in strict ANSI C... I mean, why would you want to port an OS...? [/blue]
    : :
    : Lol...
    :
    : Thanks for your replies
    :
    : I'm actually going to take a course(what ever it's named) in university preparing for chalmers (a gothenburgish ;-) school).
    : Then it's 200 points (like hours), that I can choose wich course I want to take. They offer a lot but I want to have something with programming (or maybe I will like to do something else...)
    :
    : But I didn't get it, is it possible to make ordinary apps with C++.net, not .net?
    : Is like 2 modes, one is .net(bad, slow) and the other is native(good, fast)?
    :

    Umm... I acctually found it in the programmersheaven FAQ :-o

    http://www.programmersheaven.com/2/FAQ-VCDOTNET-VC6-VCDOTNET-Differences

    Yep, it seems .NET is able to produce both "good" (common binary executabels) and "bad" (CLR .NET) code. :-)


  • : [b][red]This message was edited by Lundin at 2005-11-29 7:32:22[/red][/b][hr]
    : : : [blue]I think UNIX was written in the old K&R C, which is not ANSI C.
    : : : But there are no reasons to write an OS in strict ANSI C... I mean, why would you want to port an OS...? [/blue]
    : : :
    : : Lol...
    : :
    : : Thanks for your replies
    : :
    : : I'm actually going to take a course(what ever it's named) in university preparing for chalmers (a gothenburgish ;-) school).
    : : Then it's 200 points (like hours), that I can choose wich course I want to take. They offer a lot but I want to have something with programming (or maybe I will like to do something else...)
    : :
    : : But I didn't get it, is it possible to make ordinary apps with C++.net, not .net?
    : : Is like 2 modes, one is .net(bad, slow) and the other is native(good, fast)?
    : :
    :
    : Umm... I acctually found it in the programmersheaven FAQ :-o
    :
    : http://www.programmersheaven.com/2/FAQ-VCDOTNET-VC6-VCDOTNET-Differences
    :
    : Yep, it seems .NET is able to produce both "good" (common binary executabels) and "bad" (CLR .NET) code. :-)
    :
    I seem to recall that the default setting in the MS Compiler is to create managed C++ (runs in the CLR), but you can turn it off to create regular compiled code. The location and name of that switch was NOT intuitive as I recall. Haven't looked at it for several months, so I cannot recall where it was though.....
  • : :
    : : Umm... I acctually found it in the programmersheaven FAQ :-o
    : :
    : : http://www.programmersheaven.com/2/FAQ-VCDOTNET-VC6-VCDOTNET-Differences
    : :
    : : Yep, it seems .NET is able to produce both "good" (common binary executabels) and "bad" (CLR .NET) code. :-)
    : :
    : I seem to recall that the default setting in the MS Compiler is to create managed C++ (runs in the CLR), but you can turn it off to create regular compiled code. The location and name of that switch was NOT intuitive as I recall. Haven't looked at it for several months, so I cannot recall where it was though.....
    :

    I have thought over what gregry mentioned, to skip programming in the colige (we call it gymnasium, wich isn't the same in english). Mostly do all of it when I got time, (wich now is almost never :-().

    One more Q...
    When I have been trying to program in C++ before, (borland crashed for me, don't know why, and I got into other projects before I could get another compiler...), I used librarys like iostreams.h
    How is it in .net? I've seen things like std:iostream...
    How does it work?
  • Visual Studio .NET 2003 can produce unmanaged executable files. When you start the IDE, select File --> New --> Projects and you get a whole list of 21 different project types, both managed and unmanaged. There is no default setting for this -- just choose the project type you want to create.

    I haven't tried it yet, but I understand that a managed project can consist of modules from c#, VB, and C++. Mix and match the languages as you choose to build a single program, using manybe VB for windows io, c++ for speed of background tasks and C# for something else (web stuff??).
  • That is part of standard C++. using std::iostream, it saves typing so you don't have stuff like std::cin all over the place, the :: is called the scope resolution operator.

    You don't use the .h standard for most import statements

    import //for C++ libraries
    import//c libraries
    import "my_class.h"//custom files

    If you can, avoid .net, win32 API, boost or whatever at first. Learn C++ first, in its standards first. Once you have at least the basics, moving on is more productive once you learn the core language. And it keeps your options open, outside of the MS box.

    [italic][blue]Just my 2 bits[/blue][/italic]

  • [b][red]This message was edited by Gregry2 at 2005-11-29 19:58:20[/red][/b][hr]
    [b][red]This message was edited by Gregry2 at 2005-11-29 19:54:58[/red][/b][hr]
    : That is part of standard C++. using std::iostream, it saves typing so you don't have stuff like std::cin all over the place, the :: is called the scope resolution operator.
    :
    : You don't use the .h standard for most import statements
    :
    : import //for C++ libraries
    : import//c libraries
    : import "my_class.h"//custom files
    :
    : If you can, avoid .net, win32 API, boost or whatever at first. Learn C++ first, in its standards first. Once you have at least the basics, moving on is more productive once you learn the core language. And it keeps your options open, outside of the MS box.
    :
    : [italic][blue]Just my 2 bits[/blue][/italic]
    :
    :

    yeah, but for .h files, whihc probably arent needed in C++, they include entire files (called header files) which contain heaps of declarations NOT DEFINITIONS (mostly, there are some defs). The actually funcs and vars are in the library files in .o (object) files.

    I cant explain fully cause i dont have time. There were used in ANSI C and are probably in C++ only for backward compatibility

    EDIT: I reread ur question, it..soemthing i forgot...

    2ND EDIT: okay, sorry, iread it again! um college does give a cute transcript. I hope to establish my own reputation, whihc'll be hard. If you want to jump into programming for a corporation(forgot how to spell it) then college...i guess is beneficial. But if you choose to follow me, well good, its ur choice.

    ur future

    this
    using something;//for namespaces, something is the namespace
    it think there is an import statement as well, anyhow, C# is really MS's java.

    {2]rIng

    PS Java...well, i guess. I know, i dont expect swing to be implemented in stuff like that. In fact, i read past what i posted, and it said java didnt catch on as an embedded lang, but it was perfect for guess what? the internet. So there, i guess its right where it is.

    I'd like to bring it back to its roots though




  • : : :
    : : : Umm... I acctually found it in the programmersheaven FAQ :-o
    : : :
    : : : http://www.programmersheaven.com/2/FAQ-VCDOTNET-VC6-VCDOTNET-Differences
    : : :
    : : : Yep, it seems .NET is able to produce both "good" (common binary executabels) and "bad" (CLR .NET) code. :-)
    : : :
    : : I seem to recall that the default setting in the MS Compiler is to create managed C++ (runs in the CLR), but you can turn it off to create regular compiled code. The location and name of that switch was NOT intuitive as I recall. Haven't looked at it for several months, so I cannot recall where it was though.....
    : :
    :
    : I have thought over what gregry mentioned, to skip programming in the colige (we call it gymnasium, wich isn't the same in english). Mostly do all of it when I got time, (wich now is almost never :-().
    :
    : One more Q...
    : When I have been trying to program in C++ before, (borland crashed for me, don't know why, and I got into other projects before I could get another compiler...), I used librarys like iostreams.h
    : How is it in .net? I've seen things like std:iostream...
    : How does it work?
    :


    All socio-political/business practice dislike of Microsoft aside, I personally wouldn't waste my time with anything that isn't portable. Which is .NET in a nutshell.

    C++ seems like the best choice to me. 90% of Windows systems to date as well as Unix/Linux systems are coded with C/C++.

    I tried VB once before - for about 3 days.
    Never really liked straight up Java coding.

    And as for C#, I feel somewhat leery of a language which is combined with Java, being made from a language which bears resemblances to Java, in order to combat the "lack of Java" trend. ;)

  • :yeah, but for .h files, whihc probably arent needed in C++

    Huh??
    [italic][blue]Just my 2 bits[/blue][/italic]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories