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. Curse the .NET designers

Curse the .NET designers

Scheduled Pinned Locked Moved The Lounge
csharpc++
45 Posts 21 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 Rocky Moore

    About the only thing I miss from c/c++ was the mutliple base classes. That was handy at times.

    Rocky <>< Blog Post: Handy utility app that is always on my machines! Tech Blog Post: Microsoft Live Writer Plug-ins!

    T Offline
    T Offline
    Tim Yen
    wrote on last edited by
    #35

    Not me. Multiple inheritance was just a painful way of doing things, actually inheritance in general is a painful way of locking in things. Thats why I've read a number of recommendations to program with interfaces instead of inheritance and I agree. Its just easier to modify when you need to change it

    R 1 Reply Last reply
    0
    • J Joe Woodbury

      I need to take a moment to publicly curse the .NET designers for not implementing the "friend" keyword in C# as it is in C++. For the third time in a week, the lack of this has prevented me from making what would be an elegant implementation of some classes.

      Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

      K Offline
      K Offline
      Kevin McFarlane
      wrote on last edited by
      #36

      Joe Woodbury wrote:

      not implementing the "friend" keyword in C# as it is in C++

      Even better would have been Eiffel-style "selective export" - more fine-grained than C++ friend. I've not seen this copied in any of the mainstream languages, e.g., see An Improvement on the Access Control Features of C#[^]

      Kevin

      J 1 Reply Last reply
      0
      • J Joe Woodbury

        I need to take a moment to publicly curse the .NET designers for not implementing the "friend" keyword in C# as it is in C++. For the third time in a week, the lack of this has prevented me from making what would be an elegant implementation of some classes.

        Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

        C Offline
        C Offline
        Chris_Green
        wrote on last edited by
        #37

        And what about not supporting abstract base classes for forms or controls? Just try to bring up your form in the designer and see it puke all over the screen. Way to encourage good OO design there fellas.

        1 Reply Last reply
        0
        • J Joe Woodbury

          I need to take a moment to publicly curse the .NET designers for not implementing the "friend" keyword in C# as it is in C++. For the third time in a week, the lack of this has prevented me from making what would be an elegant implementation of some classes.

          Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

          G Offline
          G Offline
          GreenShoes
          wrote on last edited by
          #38

          Just out of interest, how does this compare to the VB.NET 'Friend' scope? (apart from being a different language). Surely it can be done in C# then if it all compiles down to the same?:confused:

          J 1 Reply Last reply
          0
          • K Kevin McFarlane

            Joe Woodbury wrote:

            not implementing the "friend" keyword in C# as it is in C++

            Even better would have been Eiffel-style "selective export" - more fine-grained than C++ friend. I've not seen this copied in any of the mainstream languages, e.g., see An Improvement on the Access Control Features of C#[^]

            Kevin

            J Offline
            J Offline
            Joe Woodbury
            wrote on last edited by
            #39

            I like the solution the authors came up with.

            Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

            K 1 Reply Last reply
            0
            • G GreenShoes

              Just out of interest, how does this compare to the VB.NET 'Friend' scope? (apart from being a different language). Surely it can be done in C# then if it all compiles down to the same?:confused:

              J Offline
              J Offline
              Joe Woodbury
              wrote on last edited by
              #40

              It's the same thing as internal; it allows visibility to everything within the assembly, but only in that assembly.

              Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

              G 1 Reply Last reply
              0
              • J Joe Woodbury

                I like the solution the authors came up with.

                Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

                K Offline
                K Offline
                Kevin McFarlane
                wrote on last edited by
                #41

                I think I stumbled on something similar a while back while investigating a different problem but I can't remember how I did it! :(

                Kevin

                1 Reply Last reply
                0
                • T Tim Yen

                  Not me. Multiple inheritance was just a painful way of doing things, actually inheritance in general is a painful way of locking in things. Thats why I've read a number of recommendations to program with interfaces instead of inheritance and I agree. Its just easier to modify when you need to change it

                  R Offline
                  R Offline
                  Rocky Moore
                  wrote on last edited by
                  #42

                  Tim Yen wrote:

                  Thats why I've read a number of recommendations to program with interfaces instead of inheritance and I agree. Its just easier to modify when you need to change it

                  How is that? You are still locked in with an Inteface. Multiple Inheritance is the same as interfaces except you do not have to "implement" them every time as with Interfaces.

                  Rocky <>< Blog Post: Handy utility app that is always on my machines! Tech Blog Post: Microsoft Live Writer Plug-ins!

                  T 1 Reply Last reply
                  0
                  • R Rocky Moore

                    Tim Yen wrote:

                    Thats why I've read a number of recommendations to program with interfaces instead of inheritance and I agree. Its just easier to modify when you need to change it

                    How is that? You are still locked in with an Inteface. Multiple Inheritance is the same as interfaces except you do not have to "implement" them every time as with Interfaces.

                    Rocky <>< Blog Post: Handy utility app that is always on my machines! Tech Blog Post: Microsoft Live Writer Plug-ins!

                    T Offline
                    T Offline
                    Tim Yen
                    wrote on last edited by
                    #43

                    You don't have to know what every method does of the parent class(es). You just have to implement the interface. If you don't know what the parent class(es) do then when you modify an existing class structure you may leave in (fail to override) code that will just not work. And that applies all the way up the inheritance tree too. The deeper the inheritance tree the more you have to know if your going to modify the structure. Usually I find just using a class is fine, but modifying a class hierarchy to me requires you understand it on a deeper level. Now maybe this is just an argument against inheritance in general but multiple inheritance just makes it harder and binds things together more tightly. In general I'm moving away from inheritance as it has 1. largely failed to provide code reuse on a big scale, 2. has a habit of hiding implementation details and 3. locks in structure based on assumptions/goals that change and make it hard(er) to modify. The best form of code reuse I have heard of is in components, in particular VB components and they don't use inheritance in that model as far as I know. Though internally the component may.

                    1 Reply Last reply
                    0
                    • J Joe Woodbury

                      It's the same thing as internal; it allows visibility to everything within the assembly, but only in that assembly.

                      Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

                      G Offline
                      G Offline
                      GreenShoes
                      wrote on last edited by
                      #44

                      Thanks! (that makes more sense now!) :-D PS: Any good links on the C++ 'friend' keyword then?

                      1 Reply Last reply
                      0
                      • J Joe Woodbury

                        bwilhite wrote:

                        C# is certainly adequate for commercial applications, imo.

                        Yeah, and that's why the market is flooded with them. The few commercial client applications I have used that are written in .NET run terrible. They remind me of those awful VB apps of old.

                        Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

                        A Offline
                        A Offline
                        azonenberg
                        wrote on last edited by
                        #45

                        I do all of my client development in C++ and write my servers in C++ or PHP. I've never had a serious performance issue with any of my apps once I finished them.

                        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