Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Pub dispute – Come on, back me up...

Pub dispute – Come on, back me up...

Scheduled Pinned Locked Moved The Lounge
csharpc++algorithmsdebuggingquestion
14 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Rob Philpott

    Tonight I’ve enjoyed an evening of too much booze and mindless conversation into the small hours, I really need sleep, but before I go to bed I beg your opinion on two things I’ve spent the whole evening arguing with a bunch of ex-colleagues. So, without consulting Google – Stainless Steel. Does it rust and what’s it made of? My opinion is that it does NOT rust, and it’s a blend of iron and (a tiny amount of) carbon. You can’t call it an alloy because carbon isn’t a metal. There may be some tiny amounts of zinc or tin thrown in too, not sure. My friends believe it can rust and it is an alloy. Who’s right? No cheating! Secondly, and more appropriately the age old argument of what performs best C++ or C#. I argue for C# and before I left my last place of work silenced them all by showing that a simple algorithm for calculating prime numbers or something similar performed better in C# then it did in C++ (on my Athlon box). Several months later after I've left it seems this is now disputed with claims that my C++ was in debug and not release and that I cheated. I know having being one previously that C++ developers deeply mistrust .NET at first, but as Richter points out in his excellent book the gain you make through target-native JIT compilation could well offset any managed overhead. I didn’t believe it at first and I do know that a large managed C# app will on startup be a bit sluggish, but after jitting or getting ngened I reckon its just as good as C++. Especially if you C++ compiler expects an Intel chip, 17 seconds C++, 16 C# (allegedly debug). Please, back me up here so I can send a smug message with a link to my foolish friends in the morning. They’re all wrong an I’m right. Again.

    Regards, Rob Philpott.

    A Offline
    A Offline
    Anthony Mushrow
    wrote on last edited by
    #3

    Stainless steel can rust. And there you have it folks. Also stainless steel is iron, carbon, and chromium. And last i checked, chromium was a metal. But, depending on the qaulity of the steel, it can be rather quite difficult to get it to go all rusty. And it'll never end up like an iron pipe left outside (poor pipe).

    My current favourite word is: Waffle Cheese is still good though.

    1 Reply Last reply
    0
    • C Christian Graus

      Any .NET method is compiled the first time it runs. Therefore, once any code path has been run once, I'd expect it to perform well after that, and I'd consider the initial cost likely to be negligible. However, if I had to say which performs better, I'd say C++, for sure. I'd more point to the difference being small, and C# being a better choice because of speed and ease of development.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      B Offline
      B Offline
      bryce
      wrote on last edited by
      #4

      ahh christian is awake ;) is that a yes or no Taswegian? Bryce

      --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
      Publitor, making Pubmed easy. http://www.sohocode.com/publitor

      Our kids books :The Snot Goblin, and Book 2 - the Snotgoblin and Fluff

      1 Reply Last reply
      0
      • R Rob Philpott

        Tonight I’ve enjoyed an evening of too much booze and mindless conversation into the small hours, I really need sleep, but before I go to bed I beg your opinion on two things I’ve spent the whole evening arguing with a bunch of ex-colleagues. So, without consulting Google – Stainless Steel. Does it rust and what’s it made of? My opinion is that it does NOT rust, and it’s a blend of iron and (a tiny amount of) carbon. You can’t call it an alloy because carbon isn’t a metal. There may be some tiny amounts of zinc or tin thrown in too, not sure. My friends believe it can rust and it is an alloy. Who’s right? No cheating! Secondly, and more appropriately the age old argument of what performs best C++ or C#. I argue for C# and before I left my last place of work silenced them all by showing that a simple algorithm for calculating prime numbers or something similar performed better in C# then it did in C++ (on my Athlon box). Several months later after I've left it seems this is now disputed with claims that my C++ was in debug and not release and that I cheated. I know having being one previously that C++ developers deeply mistrust .NET at first, but as Richter points out in his excellent book the gain you make through target-native JIT compilation could well offset any managed overhead. I didn’t believe it at first and I do know that a large managed C# app will on startup be a bit sluggish, but after jitting or getting ngened I reckon its just as good as C++. Especially if you C++ compiler expects an Intel chip, 17 seconds C++, 16 C# (allegedly debug). Please, back me up here so I can send a smug message with a link to my foolish friends in the morning. They’re all wrong an I’m right. Again.

        Regards, Rob Philpott.

        E Offline
        E Offline
        El Corazon
        wrote on last edited by
        #5

        Rob Philpott wrote:

        So, without consulting Google – Stainless Steel. Does it rust and what’s it made of? My opinion is that it does NOT rust, and it’s a blend of iron and (a tiny amount of) carbon. You can’t call it an alloy because carbon isn’t a metal. There may be some tiny amounts of zinc or tin thrown in too, not sure. My friends believe it can rust and it is an alloy. Who’s right? No cheating!

        I don't know the allow/combo/other but stainless steel will rust. You are down to the age old issue of water resistant and water proof. Stainless steel is rust resistant, it is not rust proof. I've seen many a rusted stainless steel sink because it was deliberately uncared for.

        Rob Philpott wrote:

        Secondly, and more appropriately the age old argument of what performs best C++ or C#. I argue for C# and before I left my last place of work silenced them all by showing that a simple algorithm for calculating prime numbers or something similar performed better in C# then it did in C++ (on my Athlon box). Several months later after I've left it seems this is now disputed with claims that my C++ was in debug and not release and that I cheated.

        release the hell hounds, call in the warg riders, unleash the Kraken! hmmmm oh... well.... different movies.... the truth is, both, and either. C# has the advantage of a framework that can slowly be optimized inching ahead in performance assuming that it always improves and never deteriorates (which is another assumption, but we'll ignore that for now). But anything that can be optimized in C# can also be optimized in C++, and probably better optimized. The question becomes a level of effort issue. You can get libraries in C++ that run very fast because they have been designed to do so, you can do the same with C#, and the two can battle until dawn. The truth is, the language and the compiler are ALWAYS at the mercy of the programmer. The programmer is the single largest optimization problem there is. He is the one that puts in the code, he is the one that makes the assumptions, which he believes to be true, and he is the one that ultimately breaks the cache, locks a thread, or misuses a function to the point of increased complexity and lost time. C++ compilers are efficent, and back to back with C#, when the programmer is removed, are usually better. The problem is you cannot remove the programmer. Thus your test proves more which language YOU are more

        R 1 Reply Last reply
        0
        • C Christian Graus

          Any .NET method is compiled the first time it runs. Therefore, once any code path has been run once, I'd expect it to perform well after that, and I'd consider the initial cost likely to be negligible. However, if I had to say which performs better, I'd say C++, for sure. I'd more point to the difference being small, and C# being a better choice because of speed and ease of development.

          Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          R Offline
          R Offline
          Rob Philpott
          wrote on last edited by
          #6

          Fair 'nuff, Agreed on all counts. Slightly too balanced and accurate for my liking though....

          Regards, Rob Philpott.

          1 Reply Last reply
          0
          • R Rob Philpott

            Tonight I’ve enjoyed an evening of too much booze and mindless conversation into the small hours, I really need sleep, but before I go to bed I beg your opinion on two things I’ve spent the whole evening arguing with a bunch of ex-colleagues. So, without consulting Google – Stainless Steel. Does it rust and what’s it made of? My opinion is that it does NOT rust, and it’s a blend of iron and (a tiny amount of) carbon. You can’t call it an alloy because carbon isn’t a metal. There may be some tiny amounts of zinc or tin thrown in too, not sure. My friends believe it can rust and it is an alloy. Who’s right? No cheating! Secondly, and more appropriately the age old argument of what performs best C++ or C#. I argue for C# and before I left my last place of work silenced them all by showing that a simple algorithm for calculating prime numbers or something similar performed better in C# then it did in C++ (on my Athlon box). Several months later after I've left it seems this is now disputed with claims that my C++ was in debug and not release and that I cheated. I know having being one previously that C++ developers deeply mistrust .NET at first, but as Richter points out in his excellent book the gain you make through target-native JIT compilation could well offset any managed overhead. I didn’t believe it at first and I do know that a large managed C# app will on startup be a bit sluggish, but after jitting or getting ngened I reckon its just as good as C++. Especially if you C++ compiler expects an Intel chip, 17 seconds C++, 16 C# (allegedly debug). Please, back me up here so I can send a smug message with a link to my foolish friends in the morning. They’re all wrong an I’m right. Again.

            Regards, Rob Philpott.

            C Offline
            C Offline
            CataclysmicQuantum
            wrote on last edited by
            #7

            That is what you discuss at a bar? :laugh:

            R 1 Reply Last reply
            0
            • E El Corazon

              Rob Philpott wrote:

              So, without consulting Google – Stainless Steel. Does it rust and what’s it made of? My opinion is that it does NOT rust, and it’s a blend of iron and (a tiny amount of) carbon. You can’t call it an alloy because carbon isn’t a metal. There may be some tiny amounts of zinc or tin thrown in too, not sure. My friends believe it can rust and it is an alloy. Who’s right? No cheating!

              I don't know the allow/combo/other but stainless steel will rust. You are down to the age old issue of water resistant and water proof. Stainless steel is rust resistant, it is not rust proof. I've seen many a rusted stainless steel sink because it was deliberately uncared for.

              Rob Philpott wrote:

              Secondly, and more appropriately the age old argument of what performs best C++ or C#. I argue for C# and before I left my last place of work silenced them all by showing that a simple algorithm for calculating prime numbers or something similar performed better in C# then it did in C++ (on my Athlon box). Several months later after I've left it seems this is now disputed with claims that my C++ was in debug and not release and that I cheated.

              release the hell hounds, call in the warg riders, unleash the Kraken! hmmmm oh... well.... different movies.... the truth is, both, and either. C# has the advantage of a framework that can slowly be optimized inching ahead in performance assuming that it always improves and never deteriorates (which is another assumption, but we'll ignore that for now). But anything that can be optimized in C# can also be optimized in C++, and probably better optimized. The question becomes a level of effort issue. You can get libraries in C++ that run very fast because they have been designed to do so, you can do the same with C#, and the two can battle until dawn. The truth is, the language and the compiler are ALWAYS at the mercy of the programmer. The programmer is the single largest optimization problem there is. He is the one that puts in the code, he is the one that makes the assumptions, which he believes to be true, and he is the one that ultimately breaks the cache, locks a thread, or misuses a function to the point of increased complexity and lost time. C++ compilers are efficent, and back to back with C#, when the programmer is removed, are usually better. The problem is you cannot remove the programmer. Thus your test proves more which language YOU are more

              R Offline
              R Offline
              Rob Philpott
              wrote on last edited by
              #8

              El Corazon wrote:

              Thus your test proves more which language YOU are more proficient in, and actually demonstrates little or nothing about the languages in question

              These were practically the same line for line. Just that C# needed it in a class.

              El Corazon wrote:

              So your answer: you proved you are a better C# programmer than C++.

              I damn well hope so. I can't remember C++ anymore. Thanks for your response. :)

              Regards, Rob Philpott.

              E 1 Reply Last reply
              0
              • C CataclysmicQuantum

                That is what you discuss at a bar? :laugh:

                R Offline
                R Offline
                Rob Philpott
                wrote on last edited by
                #9

                Entirely! If I wanted to talk about anything of any merit what-so-ever I'd talk to a girl. (if they'd talk back mind). That's what the chaps do - talk nonsense and argue about nothing.

                Regards, Rob Philpott.

                1 Reply Last reply
                0
                • R Rob Philpott

                  El Corazon wrote:

                  Thus your test proves more which language YOU are more proficient in, and actually demonstrates little or nothing about the languages in question

                  These were practically the same line for line. Just that C# needed it in a class.

                  El Corazon wrote:

                  So your answer: you proved you are a better C# programmer than C++.

                  I damn well hope so. I can't remember C++ anymore. Thanks for your response. :)

                  Regards, Rob Philpott.

                  E Offline
                  E Offline
                  El Corazon
                  wrote on last edited by
                  #10

                  Rob Philpott wrote:

                  These were practically the same line for line. Just that C# needed it in a class.

                  But the languages handle things differently. As posted previously in the lounge, I recompiled the same code with a significant improvement. Part of programming is knowing more than syntax. The syntax may be the same, but did the logic work the same? Did the compiler optimize them the same? That is why I said you have to sit down and understand the result. People complain about concurrency, but knowing concurrency is a skill. A programmer who understands that has extra value. A programmer who doesn't know it, just complains about how difficult it is. Neither argument shows how difficult the problem is, but shows the relative skill and knowledge of the programmer.

                  Rob Philpott wrote:

                  I can't remember C++ anymore.

                  and this qualified you to make a comparison between the two? :-D

                  _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                  1 Reply Last reply
                  0
                  • R Rob Philpott

                    Tonight I’ve enjoyed an evening of too much booze and mindless conversation into the small hours, I really need sleep, but before I go to bed I beg your opinion on two things I’ve spent the whole evening arguing with a bunch of ex-colleagues. So, without consulting Google – Stainless Steel. Does it rust and what’s it made of? My opinion is that it does NOT rust, and it’s a blend of iron and (a tiny amount of) carbon. You can’t call it an alloy because carbon isn’t a metal. There may be some tiny amounts of zinc or tin thrown in too, not sure. My friends believe it can rust and it is an alloy. Who’s right? No cheating! Secondly, and more appropriately the age old argument of what performs best C++ or C#. I argue for C# and before I left my last place of work silenced them all by showing that a simple algorithm for calculating prime numbers or something similar performed better in C# then it did in C++ (on my Athlon box). Several months later after I've left it seems this is now disputed with claims that my C++ was in debug and not release and that I cheated. I know having being one previously that C++ developers deeply mistrust .NET at first, but as Richter points out in his excellent book the gain you make through target-native JIT compilation could well offset any managed overhead. I didn’t believe it at first and I do know that a large managed C# app will on startup be a bit sluggish, but after jitting or getting ngened I reckon its just as good as C++. Especially if you C++ compiler expects an Intel chip, 17 seconds C++, 16 C# (allegedly debug). Please, back me up here so I can send a smug message with a link to my foolish friends in the morning. They’re all wrong an I’m right. Again.

                    Regards, Rob Philpott.

                    R Offline
                    R Offline
                    RoswellNX
                    wrote on last edited by
                    #11

                    Mild steel (car bodies, etc.) rusts. Stainless doesn't, but it often has a layer of iron on the surface that does oxidize when exposed to acids. So basically it can develop ugly brown spots, but those can be easily removed without them chewing all the way thru. Roswell

                    "Angelinos -- excuse me. There will be civility today."
                    Antonio VillaRaigosa
                    City Mayor, Los Angeles, CA

                    1 Reply Last reply
                    0
                    • R Rob Philpott

                      Tonight I’ve enjoyed an evening of too much booze and mindless conversation into the small hours, I really need sleep, but before I go to bed I beg your opinion on two things I’ve spent the whole evening arguing with a bunch of ex-colleagues. So, without consulting Google – Stainless Steel. Does it rust and what’s it made of? My opinion is that it does NOT rust, and it’s a blend of iron and (a tiny amount of) carbon. You can’t call it an alloy because carbon isn’t a metal. There may be some tiny amounts of zinc or tin thrown in too, not sure. My friends believe it can rust and it is an alloy. Who’s right? No cheating! Secondly, and more appropriately the age old argument of what performs best C++ or C#. I argue for C# and before I left my last place of work silenced them all by showing that a simple algorithm for calculating prime numbers or something similar performed better in C# then it did in C++ (on my Athlon box). Several months later after I've left it seems this is now disputed with claims that my C++ was in debug and not release and that I cheated. I know having being one previously that C++ developers deeply mistrust .NET at first, but as Richter points out in his excellent book the gain you make through target-native JIT compilation could well offset any managed overhead. I didn’t believe it at first and I do know that a large managed C# app will on startup be a bit sluggish, but after jitting or getting ngened I reckon its just as good as C++. Especially if you C++ compiler expects an Intel chip, 17 seconds C++, 16 C# (allegedly debug). Please, back me up here so I can send a smug message with a link to my foolish friends in the morning. They’re all wrong an I’m right. Again.

                      Regards, Rob Philpott.

                      F Offline
                      F Offline
                      Francois Benadie
                      wrote on last edited by
                      #12

                      I don't knwo much about the ins and outs of C++ vs C# as I am still trying to get to grips with the latter. So can't help your case there, but I think somebody will. As for the Stainless Steel issue: yep it can "rust" or more accurately oxidation of the Iron component does take place in the pressence of oxygen. Oxygen is pressent everywhere and more likely the contact will be with water of some type. I worked as a chemist at a power station and we had all kinds of water - very salty to ultra pure water and we used stainless steel where we had contact with the ultra pure water specifically because ultra pure water is rather acidic and it will corode metals faster than normal tap or river water. If there was a weak spot in the bonds between the Fe-C-Cr mix, this will be exploited and the Iron will start to oxidise and you will get corrosion or "rust": it is called localised corrosion. (You can get the exact reaction on google or any chemistry textbook.) But this is an extremely slow process and it wont be as notacible as with a pure Iron metal as the Chromium/Carbon mix tries to inhibit this reaction. It can be sped up if there are enhanced conditions at the surface such as when there is a bit of microbiological growth (slimey layer) forming at the weakend spot. The bacteria growing there excrete acids as a byproduct and this will tend to speed of the localised corrosion. You will see this as a blackend crystal like growth if you scrape the slimey film away. If you let them grow they will "eat" through a 3 mm thick normal Ferrous metal plate in about a year, probably longer with Stainless. This might seem long but in an industrial setting it is very quick and normally very costly with down time and repairs. If anybody is still awake after that I thank you and good night

                      Francois Benadie

                      1 Reply Last reply
                      0
                      • R Rob Philpott

                        Tonight I’ve enjoyed an evening of too much booze and mindless conversation into the small hours, I really need sleep, but before I go to bed I beg your opinion on two things I’ve spent the whole evening arguing with a bunch of ex-colleagues. So, without consulting Google – Stainless Steel. Does it rust and what’s it made of? My opinion is that it does NOT rust, and it’s a blend of iron and (a tiny amount of) carbon. You can’t call it an alloy because carbon isn’t a metal. There may be some tiny amounts of zinc or tin thrown in too, not sure. My friends believe it can rust and it is an alloy. Who’s right? No cheating! Secondly, and more appropriately the age old argument of what performs best C++ or C#. I argue for C# and before I left my last place of work silenced them all by showing that a simple algorithm for calculating prime numbers or something similar performed better in C# then it did in C++ (on my Athlon box). Several months later after I've left it seems this is now disputed with claims that my C++ was in debug and not release and that I cheated. I know having being one previously that C++ developers deeply mistrust .NET at first, but as Richter points out in his excellent book the gain you make through target-native JIT compilation could well offset any managed overhead. I didn’t believe it at first and I do know that a large managed C# app will on startup be a bit sluggish, but after jitting or getting ngened I reckon its just as good as C++. Especially if you C++ compiler expects an Intel chip, 17 seconds C++, 16 C# (allegedly debug). Please, back me up here so I can send a smug message with a link to my foolish friends in the morning. They’re all wrong an I’m right. Again.

                        Regards, Rob Philpott.

                        N Offline
                        N Offline
                        NormDroid
                        wrote on last edited by
                        #13

                        Funny you should say that, the other day I found rusty stainless steel dinner knife. I thought stainless steel can't rust but I definitely know surgical steel doesn't rust.

                        WPF - Imagineers Wanted Follow your nose using DoubleAnimationUsingPath

                        1 Reply Last reply
                        0
                        • R Rob Philpott

                          Tonight I’ve enjoyed an evening of too much booze and mindless conversation into the small hours, I really need sleep, but before I go to bed I beg your opinion on two things I’ve spent the whole evening arguing with a bunch of ex-colleagues. So, without consulting Google – Stainless Steel. Does it rust and what’s it made of? My opinion is that it does NOT rust, and it’s a blend of iron and (a tiny amount of) carbon. You can’t call it an alloy because carbon isn’t a metal. There may be some tiny amounts of zinc or tin thrown in too, not sure. My friends believe it can rust and it is an alloy. Who’s right? No cheating! Secondly, and more appropriately the age old argument of what performs best C++ or C#. I argue for C# and before I left my last place of work silenced them all by showing that a simple algorithm for calculating prime numbers or something similar performed better in C# then it did in C++ (on my Athlon box). Several months later after I've left it seems this is now disputed with claims that my C++ was in debug and not release and that I cheated. I know having being one previously that C++ developers deeply mistrust .NET at first, but as Richter points out in his excellent book the gain you make through target-native JIT compilation could well offset any managed overhead. I didn’t believe it at first and I do know that a large managed C# app will on startup be a bit sluggish, but after jitting or getting ngened I reckon its just as good as C++. Especially if you C++ compiler expects an Intel chip, 17 seconds C++, 16 C# (allegedly debug). Please, back me up here so I can send a smug message with a link to my foolish friends in the morning. They’re all wrong an I’m right. Again.

                          Regards, Rob Philpott.

                          R Offline
                          R Offline
                          Russell Jones
                          wrote on last edited by
                          #14

                          Rob Philpott wrote:

                          So, without consulting Google – Stainless Steel. Does it rust and what’s it made of? My opinion is that it does NOT rust, and it’s a blend of iron and (a tiny amount of) carbon. You can’t call it an alloy because carbon isn’t a metal. There may be some tiny amounts of zinc or tin thrown in too, not sure. My friends believe it can rust and it is an alloy. Who’s right? No cheating!

                          iron and carbon would make steel or even pig iron if the quantities were wrong. stainless contains things like vanadium and manganese if i remember correctly. In marine environments stainless corrodes very fast (measured in mm per year). There are versions of stainless that are designed for the marine environment that don't corrode under the influence of salt water. Interestingly most "normal" versions of stainless are non-magnetic as a friend discovered after buying a very expensive sheet to hang kitchen magnets on.

                          Rob Philpott wrote:

                          Secondly, and more appropriately the age old argument of what performs best C++ or C#. I argue for C# and before I left my last place of work silenced them all by showing that a simple algorithm for calculating prime numbers or something similar performed better in C# then it did in C++ (on my Athlon box). Several months later after I've left it seems this is now disputed with claims that my C++ was in debug and not release and that I cheated.

                          if you're running c++ on .net the test doesn't count ;-)

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups