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.
  • 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
    Grimolfr
    wrote on last edited by
    #13

    Can't you simulate it using reflection?

    Grim MCDBA, MCSD, MCP+SB SELECT * FROM users WHERE clue IS NOT NULL (0 row(s) affected)

    1 Reply Last reply
    0
    • R Rocky Moore

      Actually, you could use the "web application projects" to structure the site in the older method. Now with VS2008, you have a Web Application (old method with Codebehind files) or "Website"s which offer the new method. I prefer the older method as the site is precompiled and source is not required at the site.

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

      F Offline
      F Offline
      fletchsod
      wrote on last edited by
      #14

      > I prefer the older method as the site is precompiled and source is not required at the site. I prefer the latter. It's a lot faster in updating a website. Nobody want to change the code, recompile the website and wait for the web browser to appear then login to get to the webpage you're trying to work on. Most of the time, I can update the code on the fly and just refresh the web browser instead of going through the whole process. Beside the IIS web server won't make this App_Code visible to the web browser. This come in handy when the website get bigger and bigger.

      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

        D Offline
        D Offline
        Dave Buhl
        wrote on last edited by
        #15

        As you seem to have discovered, C# is NOT C++. C# uses different paradigms to achieve the same goals. Trying to apply C++ concepts to C# is like trying to mix French words and sentence structure into a Spanish conversation. Even those who know both languages will be confused and frustrated. If you really feel the need to program with C++ put it in a library and call if from C#, that is the beauty of our multiple languages. If done appropriately, we all really can get along.

        J 1 Reply Last reply
        0
        • L lainon

          And the internal keyword...? Very useful, truly... You must try it before... :(

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

          The internal keyword is lame. It hides things from external non-friend assemblies. It does absolutely no good for classes within an assembly. The result is to force code to be ugly and to not use data and method hiding.

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

          1 Reply Last reply
          0
          • S smindlos

            Multiple inheritance (in C++) sure was handy but equally evil. Interfaces/abstracts would be the way to go.

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

            smindlos wrote:

            Interfaces/abstracts would be the way to go.

            Interfaces are okay, but ultimately way too underpowered to be fully effective. Even worse, a class using an interface MUST implement all the items in the interface. This either means lots of pain with a large interface or intentionally writing the interface to be small and marginally useful. It's a hack.

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

            1 Reply Last reply
            0
            • D Dave Buhl

              As you seem to have discovered, C# is NOT C++. C# uses different paradigms to achieve the same goals. Trying to apply C++ concepts to C# is like trying to mix French words and sentence structure into a Spanish conversation. Even those who know both languages will be confused and frustrated. If you really feel the need to program with C++ put it in a library and call if from C#, that is the beauty of our multiple languages. If done appropriately, we all really can get along.

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

              Dave Buhl wrote:

              As you seem to have discovered, C# is NOT C++.

              I discovered that five years ago. I also discovered that the .NET designers were lazy asses who eliminated valid OO concepts in C# for no good reason. (They also forgot to implement many useful things in Win32. .NET 2.0 went a long way to fixing this, but I'm still astonished how how much interop I have to do. The problem is that too many of the .NET designers never did application development--seriously, one key designer was hired straight out of college and had never designed classes let alone an application of any significance. This lack of real-world experience really shows.)

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

              D 1 Reply Last reply
              0
              • R Rocky Moore

                Actually, you could use the "web application projects" to structure the site in the older method. Now with VS2008, you have a Web Application (old method with Codebehind files) or "Website"s which offer the new method. I prefer the older method as the site is precompiled and source is not required at the site.

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

                C Offline
                C Offline
                Christopher Duncan
                wrote on last edited by
                #19

                Do you have a notion as to how much hassle it is to move an existing project to the older method? I, too, prefer the precompiled approach. I know you can still precompile with 2.0, but it changes the assembly name each time, and if you want to use fixed names it spits out a different dll for each page. Yuck.

                Christopher Duncan Author of The Career Programmer and Unite the Tribes Coming soon: Got a career question? Ask the Attack Chihuahua! www.PracticalUSA.com

                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

                  S Offline
                  S Offline
                  Syed Muhammad Fahad
                  wrote on last edited by
                  #20

                  I too missed this keyword alot

                  Syed Muhammad Fahad Application Development Tyler Technologies -- TEMS Division mfahad@mazikusa.com

                  1 Reply Last reply
                  0
                  • J Joe Woodbury

                    Dave Buhl wrote:

                    As you seem to have discovered, C# is NOT C++.

                    I discovered that five years ago. I also discovered that the .NET designers were lazy asses who eliminated valid OO concepts in C# for no good reason. (They also forgot to implement many useful things in Win32. .NET 2.0 went a long way to fixing this, but I'm still astonished how how much interop I have to do. The problem is that too many of the .NET designers never did application development--seriously, one key designer was hired straight out of college and had never designed classes let alone an application of any significance. This lack of real-world experience really shows.)

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

                    D Offline
                    D Offline
                    Dave Buhl
                    wrote on last edited by
                    #21

                    I don't totally disagree. But, how long has C# been around as compared to C or C++? How many C or C++ programmers consider VB a serious programming environment? How long did it take for C++ to become a widely accepted language compared to C#? Friend is a technique used by a language to help implement the OO concepts of encapsulation, abstraction, and information hiding. There was a link, I think in yesterdays code project news letter, to an interview with Mr Stroustrup discussing upcoming changes to the C++ Standard that will be implementing techniques common in C# today and a lot of things he wanted to include but couldn't that are part of C#. Because of the enormity of what was made available in the .NET framework, it would be very difficult to implement functionallity for every concievable operation. At some point, you have to identify what fits with your design and if something can be done in a different way that actually fits better with your design, what the majority of users will take advantage of and draw a line. Much of the .NET framework is simply wrappers around the win32 API, so if something is not available you can always roll your own. Point is, every language has its followers, every language has good/bad/ugly points, every language has its evangelists, but calling engineers lazy asses because a feature from another language was not implemented in the same way in this one is way out of bounds. Not trying to start a flame war but there is my two cents.

                    J 1 Reply Last reply
                    0
                    • D Dave Buhl

                      I don't totally disagree. But, how long has C# been around as compared to C or C++? How many C or C++ programmers consider VB a serious programming environment? How long did it take for C++ to become a widely accepted language compared to C#? Friend is a technique used by a language to help implement the OO concepts of encapsulation, abstraction, and information hiding. There was a link, I think in yesterdays code project news letter, to an interview with Mr Stroustrup discussing upcoming changes to the C++ Standard that will be implementing techniques common in C# today and a lot of things he wanted to include but couldn't that are part of C#. Because of the enormity of what was made available in the .NET framework, it would be very difficult to implement functionallity for every concievable operation. At some point, you have to identify what fits with your design and if something can be done in a different way that actually fits better with your design, what the majority of users will take advantage of and draw a line. Much of the .NET framework is simply wrappers around the win32 API, so if something is not available you can always roll your own. Point is, every language has its followers, every language has good/bad/ugly points, every language has its evangelists, but calling engineers lazy asses because a feature from another language was not implemented in the same way in this one is way out of bounds. Not trying to start a flame war but there is my two cents.

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

                      Dave Buhl wrote:

                      but calling engineers lazy asses because a feature from another language was not implemented in the same way in this one is way out of bounds.

                      I'm not calling them lazy asses simply because they didn't implement something in C# the same way as C++, I'm calling them lazy because they knew about C++, Java, Object Pascal and so forth and yet still made a language and framework that more resembled a toy than something useful for writing commercial applications. (Do understand that I remember quite clearly the official Microsoft evangelizing of .NET 1.0 and how all applications should now be written in .NET. When I dealt with Microsoft at the time concerning .NET, it was a nearly endless stream of whining about how what we wanted was too hard and that it would break the purity of the CLI and all sorts of other nonsense. I was told straight out that C# templates would "never happen." This was true of many of the coolest features of .NET 2.0, which leads me to believe there was some change in management between .NET 1.0 and .NET 2.0. Add to that the almost complete contempt the Visual Studio team had toward C++/MFC/ATL/WTL and I've gotten pretty jaded about the Microsoft development tools division.) PS. While I'm glad Stroustrup invented C++, I'm equally glad he didn't do many of the things he now claims he should have done. I think he's forgetting many of his design constraints and doing some historical revisionism along the way, since some of these concepts NEVER showed up in any of the contemporary writing he did. I'm opposed to some of the proposed changes for C++; I find them to be breaking changes and better implemented as part of a new language that is to C++ as C++ is to C. (Yeah, some people claim D is it.)

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

                      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
                        coding4ever
                        wrote on last edited by
                        #23

                        Now I feel sorry for C#, it has no friends......

                        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

                          T Offline
                          T Offline
                          TomGarth
                          wrote on last edited by
                          #24

                          I think I remember hearing that C# was sort of an afterthought that was thrown into the mix to pacify the C++ community. :(( .NET was written for VB. :)

                          Tom Garth Developer R. L. Nelson and Associates, Inc., Virginia

                          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

                            B Offline
                            B Offline
                            bwilhite
                            wrote on last edited by
                            #25

                            Seems to me like some people have just gotten used to doing things a certain way. C# is certainly adequate for commercial applications, imo.

                            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

                              B Offline
                              B Offline
                              bwilhite
                              wrote on last edited by
                              #26

                              Seems to me like some people have just gotten used to doing things a certain way and are unwilling/unable to think in another way. C# is certainly adequate for commercial applications, imo.

                              1 Reply Last reply
                              0
                              • B bwilhite

                                Seems to me like some people have just gotten used to doing things a certain way. C# is certainly adequate for commercial applications, imo.

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

                                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

                                B A 2 Replies 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

                                  B Offline
                                  B Offline
                                  bwilhite
                                  wrote on last edited by
                                  #28

                                  Well, if hedge funds and banks are looking to employ C# developers (and yes, they are), then that is a pretty good indication to me :) Granted, the demand is still mostly for C++, but still... Not to mention there's also demand in other industries. So going so far as to say it's not fit for commercial development is at the least a bit of an exaggeration. Of course some day maybe I'll be the one complaining about how somebody "screwed up" their technology...

                                  J 1 Reply Last reply
                                  0
                                  • B bwilhite

                                    Well, if hedge funds and banks are looking to employ C# developers (and yes, they are), then that is a pretty good indication to me :) Granted, the demand is still mostly for C++, but still... Not to mention there's also demand in other industries. So going so far as to say it's not fit for commercial development is at the least a bit of an exaggeration. Of course some day maybe I'll be the one complaining about how somebody "screwed up" their technology...

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

                                    bwilhite wrote:

                                    Well, if hedge funds and banks are looking to employ C# developers (and yes, they are),

                                    Many of these are providing web services and for web services, .NET is fantastic. For basic database front ends, .NET is fantastic. For complex client applications, it's not so great.

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

                                    B 1 Reply Last reply
                                    0
                                    • F fletchsod

                                      > I prefer the older method as the site is precompiled and source is not required at the site. I prefer the latter. It's a lot faster in updating a website. Nobody want to change the code, recompile the website and wait for the web browser to appear then login to get to the webpage you're trying to work on. Most of the time, I can update the code on the fly and just refresh the web browser instead of going through the whole process. Beside the IIS web server won't make this App_Code visible to the web browser. This come in handy when the website get bigger and bigger.

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

                                      Well, that would apply if you develop directly to your production server. I develop everything usually locally and the pump it to the production server. This also keeps most of your source off the production server where it might get exposed if the server gets hacked and in shared hosting, it means your actual code is not available to admins.

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

                                      1 Reply Last reply
                                      0
                                      • J Joe Woodbury

                                        bwilhite wrote:

                                        Well, if hedge funds and banks are looking to employ C# developers (and yes, they are),

                                        Many of these are providing web services and for web services, .NET is fantastic. For basic database front ends, .NET is fantastic. For complex client applications, it's not so great.

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

                                        B Offline
                                        B Offline
                                        bwilhite
                                        wrote on last edited by
                                        #31

                                        I emphatically disagree (and from experience). But I won't try to talk you into my POV. I will say this...there have been a few times when I did wish C# had 'friend.' Sometimes that keyword would've helped me to solve the problem exactly how I wanted.

                                        1 Reply Last reply
                                        0
                                        • C Christopher Duncan

                                          Do you have a notion as to how much hassle it is to move an existing project to the older method? I, too, prefer the precompiled approach. I know you can still precompile with 2.0, but it changes the assembly name each time, and if you want to use fixed names it spits out a different dll for each page. Yuck.

                                          Christopher Duncan Author of The Career Programmer and Unite the Tribes Coming soon: Got a career question? Ask the Attack Chihuahua! www.PracticalUSA.com

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

                                          Yeah, screwy new dll naming has been a pain. I think they figured most people would just post the entire code to the server and be done with it. There was a HUGE outcry to give us the old style back. I know it took me quite some time to get used to the new style, but now that the old style is a first class citizen once again, I will be making more use of it along with ASP.NET MVC (in the near future when they get it a bit more settled). For those interested in the conversion to web apps (2005) http://webproject.scottgu.com/CSharp/Migration2/Migration2.aspx[^]

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

                                          C 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