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. To like or dislike C Sharp

To like or dislike C Sharp

Scheduled Pinned Locked Moved The Lounge
csharpc++learning
44 Posts 27 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.
  • A Argonia

    At work i am working alone on the only remaining c++ project. But now new we started working on a new project in c#. So i am writing one of its projects (I pity my coworkers for working with me on the same project) and i was thinking "Oh i will make The class A private so it will be used only with the Class B and just use friend" but of course M$ had other ideas. Today was a good day i found another reason to dislike C Sharp. So i wonder what makes you people like or dislike C Sharp

    Microsoft ... the only place where VARIANT_TRUE != true

    G Offline
    G Offline
    glennPattonWork3
    wrote on last edited by
    #25

    I got into the whole C# vs. C++ with a previous company the end result was C++ will let you build the gallows and hang yourself, while C# will give you the gallows but makes it hard(er) to hang your self. I must admit not to being very fond of object orientation & classes (give me a struct any day!) My Two pennies worth any now back to stick a test rig together. :)

    1 Reply Last reply
    0
    • OriginalGriffO OriginalGriff

      Precisely!

      G Offline
      G Offline
      Gizz
      wrote on last edited by
      #26

      Seconded. Anyway, friend? really?

      A 1 Reply Last reply
      0
      • A Argonia

        The beauty of c++ is that it will never die. It doesn't stop growing. For example in the latest update c++ 11 we see something very interesting for strongly typed language, the type auto. After few years/decades/centuries(lets hope) M$ will stop supporting .Net Platform and c# will die with it. C++ doesn't need any Platforms unlike c#

        Microsoft ... the only place where VARIANT_TRUE != true

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #27

        Argonia wrote:

        After few years/decades/centuries(lets hope) M$ will stop supporting .Net Platform and c# will die with it.

        Why would C# die with it? It doesn't need to run on .NET - there is at least one alternative to the .NET framework, and C# is now producing code for iOS and Android as well.

        P 1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          I like it. If you stop thinking "cut down C++" and consider it as a separate language in it's own right, it is very good - in some ways a lot better than C++ in that it is a lot harder to write impenetrable cr@p in C# than it is in C++. If you want a class that is only available to Class B, then declare it as private and part of the B Class:

          public class B
          {
          private class A
          {
          ...
          }
          A a = new A();
          }

          C Offline
          C Offline
          Chris Losinger
          wrote on last edited by
          #28

          OriginalGriff wrote:

          it is a lot harder to write impenetrable cr@p in C# than it is in C++.

          maybe, as long as you don't get near LINQ or anonymous functions.

          image processing toolkits | batch image processing

          OriginalGriffO D R 3 Replies Last reply
          0
          • OriginalGriffO OriginalGriff

            I like it. If you stop thinking "cut down C++" and consider it as a separate language in it's own right, it is very good - in some ways a lot better than C++ in that it is a lot harder to write impenetrable cr@p in C# than it is in C++. If you want a class that is only available to Class B, then declare it as private and part of the B Class:

            public class B
            {
            private class A
            {
            ...
            }
            A a = new A();
            }

            W Offline
            W Offline
            W Balboos GHB
            wrote on last edited by
            #29

            Impenetrable? Humph. Anyway - not to start a debate, but don't you find something intrinsically wrong with your example? Class inside of class (inside of class (inside of class (inside of class (inside of class (inside of class . . . ??? I look at it this way C# is a good lure to get lifetime-rookies away from VB. But it hides what you're really doing. There's no distinction, visibly between a namespace or a class in terms of separation, for example. (in C++, we have ::, ., and -> vs. . the C#). It makes things easier and masks understanding. I also like the possibility of multiple inheritance without a cascade of derivations - not too often, but when I want it I want it) It's not so much cut-down as light. Per my VB->C# view, that's a good thing . . . as an intermediate step to the real thing.

            "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

            "As far as we know, our computer has never had an undetected error." - Weisert

            "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

            OriginalGriffO 1 Reply Last reply
            0
            • C Chris Losinger

              OriginalGriff wrote:

              it is a lot harder to write impenetrable cr@p in C# than it is in C++.

              maybe, as long as you don't get near LINQ or anonymous functions.

              image processing toolkits | batch image processing

              OriginalGriffO Offline
              OriginalGriffO Offline
              OriginalGriff
              wrote on last edited by
              #30

              They can get a bit...difficult...but not as much as a carelessly written regex! :laugh:

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
              "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

              1 Reply Last reply
              0
              • W W Balboos GHB

                Impenetrable? Humph. Anyway - not to start a debate, but don't you find something intrinsically wrong with your example? Class inside of class (inside of class (inside of class (inside of class (inside of class (inside of class . . . ??? I look at it this way C# is a good lure to get lifetime-rookies away from VB. But it hides what you're really doing. There's no distinction, visibly between a namespace or a class in terms of separation, for example. (in C++, we have ::, ., and -> vs. . the C#). It makes things easier and masks understanding. I also like the possibility of multiple inheritance without a cascade of derivations - not too often, but when I want it I want it) It's not so much cut-down as light. Per my VB->C# view, that's a good thing . . . as an intermediate step to the real thing.

                "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

                "As far as we know, our computer has never had an undetected error." - Weisert

                "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

                OriginalGriffO Offline
                OriginalGriffO Offline
                OriginalGriff
                wrote on last edited by
                #31

                *cough* C# has the dereferencing operator -> but it's only available in unsafe code. I agree, something like the scope resolution operator would be useful, but it's not vital. No I don't find anything "intrinsically wrong" - if a class is supposed to be used only within a different class, then why the heck not declare it within that class? It doesn't have to be in the same file if you use partial classes, and it does reflect the structure of the code better than C++ friend in my opinion. BTW: I came up through C -> C++ -> C# and I occasionally do still use C and C++. C++ shows it's ancestry, while C# shows it was designed to work with .NET from day one. Linq and suchlike are obvious bolt-ons which could have been done so much better if they had been considered when C# was designed - as could many features of modern C++! :laugh:

                "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                1 Reply Last reply
                0
                • A Argonia

                  At work i am working alone on the only remaining c++ project. But now new we started working on a new project in c#. So i am writing one of its projects (I pity my coworkers for working with me on the same project) and i was thinking "Oh i will make The class A private so it will be used only with the Class B and just use friend" but of course M$ had other ideas. Today was a good day i found another reason to dislike C Sharp. So i wonder what makes you people like or dislike C Sharp

                  Microsoft ... the only place where VARIANT_TRUE != true

                  N Offline
                  N Offline
                  Nemanja Trifunovic
                  wrote on last edited by
                  #32

                  Here is my point of view[^]. It was written in 2008, and after that I had opportunity to work with both languages, but my opinion is pretty much the same: C# is good enough for a typical enterprise application, but there is really nothing interesting or exciting about it.

                  utf8-cpp

                  1 Reply Last reply
                  0
                  • A Argonia

                    At work i am working alone on the only remaining c++ project. But now new we started working on a new project in c#. So i am writing one of its projects (I pity my coworkers for working with me on the same project) and i was thinking "Oh i will make The class A private so it will be used only with the Class B and just use friend" but of course M$ had other ideas. Today was a good day i found another reason to dislike C Sharp. So i wonder what makes you people like or dislike C Sharp

                    Microsoft ... the only place where VARIANT_TRUE != true

                    D Offline
                    D Offline
                    Don Kackman
                    wrote on last edited by
                    #33

                    It's been awhile since I've worked in C++ but as I skim stackoverflow and glance at the occasional specificaiton or example of C++11 I can't help but think to myself that it has become an amalgam of every computer language trend since C. How anybody figures out to write C++11 coherently, using the correct language features, at the correct time in the correct way is now beyond me. So I for one do not miss friend classes or private inheritance (or multiple inheriteance for that matter). I say Yay C# for its relative simplicity!

                    10 PRINT "Software is hard. - D. Knuth" 20 GOTO 10

                    1 Reply Last reply
                    0
                    • A Argonia

                      At work i am working alone on the only remaining c++ project. But now new we started working on a new project in c#. So i am writing one of its projects (I pity my coworkers for working with me on the same project) and i was thinking "Oh i will make The class A private so it will be used only with the Class B and just use friend" but of course M$ had other ideas. Today was a good day i found another reason to dislike C Sharp. So i wonder what makes you people like or dislike C Sharp

                      Microsoft ... the only place where VARIANT_TRUE != true

                      P Offline
                      P Offline
                      PIEBALDconsult
                      wrote on last edited by
                      #34

                      I like C#. I don't like C++.

                      1 Reply Last reply
                      0
                      • A Argonia

                        At work i am working alone on the only remaining c++ project. But now new we started working on a new project in c#. So i am writing one of its projects (I pity my coworkers for working with me on the same project) and i was thinking "Oh i will make The class A private so it will be used only with the Class B and just use friend" but of course M$ had other ideas. Today was a good day i found another reason to dislike C Sharp. So i wonder what makes you people like or dislike C Sharp

                        Microsoft ... the only place where VARIANT_TRUE != true

                        M Offline
                        M Offline
                        Marc Clifton
                        wrote on last edited by
                        #35

                        Argonia wrote:

                        Oh i will make The class A private so it will be used only with the Class B and just use friend

                        Good grief. Even when I was coding C++ (which I did for years) I thought private classes and "friends" were a bad design. Yes, C++ templates are a lot more flexible than C# generics, yes, multiple inheritance does have its uses when used carefully and interfaces don't always cut it, but other than that, I quite enjoy the ease of C# development. And you can specify "friend" assemblies in C#, but again, I consider it a bad idea. Marc

                        Day 1: Spider Database Navigator Unit Testing Succinctly

                        P pkfoxP 2 Replies Last reply
                        0
                        • C Chris Losinger

                          OriginalGriff wrote:

                          it is a lot harder to write impenetrable cr@p in C# than it is in C++.

                          maybe, as long as you don't get near LINQ or anonymous functions.

                          image processing toolkits | batch image processing

                          D Offline
                          D Offline
                          Dan Neely
                          wrote on last edited by
                          #36

                          It's a new syntax; but as long as you resist the urge to be stupid* with it linq one liners can be as easy to understand as the 3-6 line loops they replaced while taking less actual time to read because they're much shorter. * Or to click yes every time R#er says "I can Linqify that loop for you" because it can and does produce truly awful results in some cases. OTOH most of those WTFs can also be written as a much nicer Linq expression if you ask Google for advice.

                          Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

                          1 Reply Last reply
                          0
                          • A Argonia

                            At work i am working alone on the only remaining c++ project. But now new we started working on a new project in c#. So i am writing one of its projects (I pity my coworkers for working with me on the same project) and i was thinking "Oh i will make The class A private so it will be used only with the Class B and just use friend" but of course M$ had other ideas. Today was a good day i found another reason to dislike C Sharp. So i wonder what makes you people like or dislike C Sharp

                            Microsoft ... the only place where VARIANT_TRUE != true

                            D Offline
                            D Offline
                            Deflinek
                            wrote on last edited by
                            #37

                            Argonia wrote:

                            "Oh i will make The class A private so it will be used only with the Class B and just use friend"

                            Ahhh the joys of C++, where friends can touch your private mem.... ;)

                            -- "My software never has bugs. It just develops random features."

                            1 Reply Last reply
                            0
                            • G Gizz

                              Seconded. Anyway, friend? really?

                              A Offline
                              A Offline
                              Albert Holguin
                              wrote on last edited by
                              #38

                              Nobody likes friends! ;P :laugh:

                              1 Reply Last reply
                              0
                              • L Lost User

                                Most C++ programmers starting with C# like it. Maybe you don't like C++?

                                A Offline
                                A Offline
                                Albert Holguin
                                wrote on last edited by
                                #39

                                I don't think I'd agree with that statement...

                                1 Reply Last reply
                                0
                                • M Marc Clifton

                                  Argonia wrote:

                                  Oh i will make The class A private so it will be used only with the Class B and just use friend

                                  Good grief. Even when I was coding C++ (which I did for years) I thought private classes and "friends" were a bad design. Yes, C++ templates are a lot more flexible than C# generics, yes, multiple inheritance does have its uses when used carefully and interfaces don't always cut it, but other than that, I quite enjoy the ease of C# development. And you can specify "friend" assemblies in C#, but again, I consider it a bad idea. Marc

                                  Day 1: Spider Database Navigator Unit Testing Succinctly

                                  P Offline
                                  P Offline
                                  PIEBALDconsult
                                  wrote on last edited by
                                  #40

                                  Hear! Hear!

                                  1 Reply Last reply
                                  0
                                  • OriginalGriffO OriginalGriff

                                    I like it. If you stop thinking "cut down C++" and consider it as a separate language in it's own right, it is very good - in some ways a lot better than C++ in that it is a lot harder to write impenetrable cr@p in C# than it is in C++. If you want a class that is only available to Class B, then declare it as private and part of the B Class:

                                    public class B
                                    {
                                    private class A
                                    {
                                    ...
                                    }
                                    A a = new A();
                                    }

                                    J Offline
                                    J Offline
                                    jschell
                                    wrote on last edited by
                                    #41

                                    OriginalGriff wrote:

                                    in that it is a lot harder to write impenetrable cr@p in C# than it is in C++.

                                    Pretty sure it is ridiculously easy to write impenetrable code in any language.

                                    1 Reply Last reply
                                    0
                                    • M Marc Clifton

                                      Argonia wrote:

                                      Oh i will make The class A private so it will be used only with the Class B and just use friend

                                      Good grief. Even when I was coding C++ (which I did for years) I thought private classes and "friends" were a bad design. Yes, C++ templates are a lot more flexible than C# generics, yes, multiple inheritance does have its uses when used carefully and interfaces don't always cut it, but other than that, I quite enjoy the ease of C# development. And you can specify "friend" assemblies in C#, but again, I consider it a bad idea. Marc

                                      Day 1: Spider Database Navigator Unit Testing Succinctly

                                      pkfoxP Offline
                                      pkfoxP Offline
                                      pkfox
                                      wrote on last edited by
                                      #42

                                      +1 for not liking *friends* they go against the grain of *encapsulation* for one thing, and another thing *I don't like them* ;-) We can’t stop here, this is bat country - Hunter S Thompson RIP

                                      1 Reply Last reply
                                      0
                                      • P Pete OHanlon

                                        Argonia wrote:

                                        After few years/decades/centuries(lets hope) M$ will stop supporting .Net Platform and c# will die with it.

                                        Why would C# die with it? It doesn't need to run on .NET - there is at least one alternative to the .NET framework, and C# is now producing code for iOS and Android as well.

                                        P Offline
                                        P Offline
                                        PIEBALDconsult
                                        wrote on last edited by
                                        #43

                                        Exactly; a language is just a language. In theory it can be implemented for any system.

                                        1 Reply Last reply
                                        0
                                        • C Chris Losinger

                                          OriginalGriff wrote:

                                          it is a lot harder to write impenetrable cr@p in C# than it is in C++.

                                          maybe, as long as you don't get near LINQ or anonymous functions.

                                          image processing toolkits | batch image processing

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

                                          Yes, yes, yes. 100% yes.

                                          Regards, Rob Philpott.

                                          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