Thread: C++/CLI arrogance

  1. #46
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    Quote Originally Posted by Mario F.
    I don't see hatred being the exchange currency on the thread, Fill. Some passionate arguments? Probably, yes. But that is healthy. I would hate to think we all behaved like perfect gentleman.
    it's the combination of here and in other threads. cboard in general seems very hostile to C++/CLI. Basically, people seem willing to accept C# for what it is, but can't deal with C++/CLI which accomplishes much of the same goal. I personally would prefer to do my windows coding in C++ in the future. So I am thrilled that there is this alternative to C#. That's the perspective I'm coming from. I don't wish for C++ to fade simply because of our stubborness
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  2. #47
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    The 'unsafe' keyword is emotionally charged.
    C++/CLI looks like MS's push to move C++ programmers
    C++/CLI is slow and bloated
    MS deprecated the standard library while providing C++/CLI
    MS might replace the WinAPI with a .Net interface
    Yes, these are the points. But you cannot ignore them as you did.
    Using UNSAFE because its short? Every word has a meaning. Psychology, yes I think MS has a team of psychologists. Even us (ppl in this thread) who know what is unsafe and safe code. That is managed and unmanaged and UNSAFE code can be safer than SAFE code in practice, will have a feeling that "Unmanaged code is unsafe" and "Managed code is safe". So we cannot ignore this naming.
    Second is not only a tie.
    Third is the most important.
    Forth today with a #define what about tomorrow? MS has a plan, and we guess what it is.
    And about the fifth one, as I understood from Microsoft, there is something named .Net3 that is Vista API. It is combination of .net2 and some new features. I didn't find anything else.
    I should clear that I don't hate MS but its strategy. I don't hate .net, it is idealand enjoying for usual Windows form programming.
    Last edited by siavoshkc; 07-28-2006 at 02:19 PM.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  3. #48
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    somebody's going to have to prove this "its slow" thing. As I understand it, the MSIL is compiled down to machine code at first run. Which should be damn near the same runtime speed.

    edit:

    interesting benchmark tests... msil faster?
    http://www.osnews.com/story.php?news_id=5602&page=3

    edit:

    another
    http://www.devhood.com/tutorials/tut...utorial_id=203
    Last edited by FillYourBrain; 07-28-2006 at 06:49 PM.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  4. #49
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    *pant pant* sorry I got here so late guys....Um....I don't know if anybody has mentioned this, but the reason why C++ is considered "unsafe" when compared to C++/CLI is because it's easier for a hacker to have his way with it. C++/CLI has several features that you can turn on/off that will check for buffer overruns, stack corruption, etc. Usually, a C++ program will fault because of this, but if you know what you're doing, you can make the program do whatever you want it to.

  5. #50
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Actually skorman, "safe" in the book is referring mainly to memory management and pointers. C++/CLI offers no pointers and uses references and it has it's own garbage collector. I don't think they mean 'unsafe' as in it's hackable since anything made with code can also be broken with code.

    So far it does not seem that the author is implying what you said, but it is a very valid point.

  6. #51
    Dump Truck Internet valis's Avatar
    Join Date
    Jul 2005
    Posts
    357
    I think these results may better display a languages ability.
    http://shootout.alioth.debian.org/

    There's a reason you don't often (keyword to your left in this one for those waiting to attack) hear of a high performance game being produced in C# and java.

  7. #52
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    why C++ is considered "unsafe" when compared to C++/CLI is because it's easier for a hacker to have his way with it. C++/CLI has several features that you can turn on/off that will check for buffer overruns, stack corruption, etc.
    .net is not magic, you can include these security enhencements in your unmanaged code maybe better than MS.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  8. #53
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    >>somebody's going to have to prove this "its slow" thing. As I understand it, the MSIL is compiled down to machine code at first run. Which should be damn near the same runtime speed.
    In first site:
    Microsoft Visual C++ 6.0 (SP5) IS OLD.
    And the optimization options is not mentioned.
    Last edited by siavoshkc; 07-29-2006 at 03:56 AM.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  9. #54
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    Quote Originally Posted by bubba
    Actually skorman, "safe" in the book is referring mainly to memory management and pointers. C++/CLI offers no pointers and uses references and it has it's own garbage collector. I don't think they mean 'unsafe' as in it's hackable since anything made with code can also be broken with code.
    Hmmm, yeah that is arrogant. I don't like it either lol.

    Any code can be broken with other code, C++/CLI just has some built in mechanisms to help prevent it =).

  10. #55
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Last edited by Dante Shamest; 07-29-2006 at 08:05 PM.

  11. #56
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    And then we have A Critical View of C++/CLI

    Also the speed test was on an algorithm base. That was a smart move. But doesn't really answer the speed issue, now does it? I mean... A Java coded FFT may not be much slower than a C++ one. What the author smartly enough chose to ignore was things like, for instance:

    "However, in the "newer programming languages" generics mean something quite different. C++/CLI Generics are instantiated by the Virtual Execution System (the .Net equivalent of Java’s JVM) at runtime, whereas C++ templates are instantiated at compile-time. Performance-wise, generics are slower than templates by magnitudes."
    He chose to ignore the language implementation aspects of which the above is one example.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  12. #57
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    mario f, the only problem is that half of what that guys is saying is a lie. multiple inheritance not there? lie. It's only not there on a ref or value class. On the traditional classes it's most certainly there. iostream and string not there? lie. I use them in my current .NET project. This is EXACTLY what I'm talking about. People who insist that its slower and criticize it for things they don't understand are talking about .NET parts! They are not using it correctly.

    If you use it in a SH1TTY WAY, you'll get SH1TTY results!!!! That's programming
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  13. #58
    Dump Truck Internet valis's Avatar
    Join Date
    Jul 2005
    Posts
    357
    I think that the fft case is actually a poor example, it's similar to the assembly C/C++/C#/etc. comparisons where the benchmarksman simply converts or hand compiles their stuff to assembly. Of course you're going to get similar performance because when you're writing in a different language you think differently. Critics of the cell do the same thing, they take a pre-mature compiler and compile x86 optimized, unparallel and vectorized code with most likely lots of disjoint data (since it doesn't really matter a lot on x86) and then complain when they don't get 10000000000000 times the performance.

    Also after seeing the code there is no reason there should be a difference in speed--the entire test is arithmetic (using mostly vars which should use the stack), if .net or cli performed poorly then the developers really would have had to screw up.

  14. #59
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    The speed issue is, for once, not what I'm debating here although it's not a complete deviation from the thread.

    Good comments...all of you. Now continue to play nice and keep the thread going as it is very good to see people's points of view on a technology we will have to use very soon.

  15. #60
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    Though Micorosoft sites only mention .net for Windows API, I found out (Told in MS forum) that Vista core is on base of core code of Windows Server 2003. So we can use its unmanaged functions.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

Popular pages Recent additions subscribe to a feed