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. Namspace and Using Statements

Namspace and Using Statements

Scheduled Pinned Locked Moved The Lounge
helpcsharpquestion
40 Posts 18 Posters 5 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 jim lahey

    We've got StyleCop at work in one project <sarcasm>thanks to a colleague</sarcasm> and I think it's the single most pointless tool you can get. Not only that, but if you're not careful the StyleCop installer trashes your Visual Studio class and interface templates, exactly by putting namespaces inside and not outside. The thing is that Microsoft is the manufacturer. The manufacturer's templates specify namespace includes outside of the file's namespace, but someone who doesn't know you from Adam or what you're working on thinks they know better. As soon as I'm on another project it's getting uninstalled. ReSharper contains much of the same functionality as standard but is actually useful which is why it's allowed to stay. The same colleague also comes out with stuff like: "3rd party dependencies are really bad, they make everything too complicated" - so instead of using an ORM he reimplements ADO.net from scratch, taking months, despite ADO.net's presence in .net "You're referencing System.ServiceModel from a client application? That needs removing immediately. You're breaking separation of concerns" - despite the fact that System.ServiceModel contains stuff for client connections to WCF Services "I don't use interfaces because they're too complicated and I can't find the implementation" - despite right click + goto implementation "I prefix all my classes with 'X' so I know if a class is ours or not" - despite the fact that our classes reside in our own namespaces "How is your ASP.net web application going to work if you don't have IIS? you need to remove all dependencies to IIS altogether and find another way" - Whiskey Tango Foxtrot. and he doesn't like List<T> so any time he uses a method that returns a generic list he for loops over the result and turns it into an array - despite .ToArray()

    R Offline
    R Offline
    R Giskard Reventlov
    wrote on last edited by
    #12

    Seriously? Wow: amazed that people with this level of ineptitude last more than a week, anywhere.

    "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me

    A 1 Reply Last reply
    0
    • P Pete OHanlon

      Is his name Myron (pronounced Moron)? What an idiot. Seriously, if he worked for me, he'd be out the door for lack of understanding.

      *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

      "Mind bleach! Send me mind bleach!" - Nagy Vilmos

      CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

      J Offline
      J Offline
      jim lahey
      wrote on last edited by
      #13

      Nope, he's a very long-serving member of staff who comes from the Delphi world. I count myself very lucky that he's not above me in the team hierarchy and my team leader tends to agree with me on most things. The colleague in question has cemented his place in the company forever because he's one of only a few who have in depth knowledge of our legacy Delphi stuff (conveniently undocumented of course), which I refuse to touch because I didn't spend the last 12 years getting proficient in .net just to go and live in the past. Oh yeah, I almost forgot another couple of gems: "You have far less deployment issues with COM .dlls than .net assemblies" "There's too many assemblies in your web front end and wcf application (11 including unit test projects and implementiations totally decoupled from their interfaces), can't you reduce them?" - while he has solutions with 50+ projects, no meaningful unit tests and point blank refuses to use UML to visualise the bird's nest of dependencies he's just created I've taken to just saying whatever mate. trying to reason with him is like trying to teach calculus to your dog. If I was in charge I'd get all the legacy stuff documented in detail and tell him to get his act together or find another job. Attitudes like his are just a barrier to quality, progress and productivity, some of which has rubbed off on someone who sits next to him but that's an entirely different rant altogether.

      C realJSOPR J A B 5 Replies Last reply
      0
      • J jim lahey

        We've got StyleCop at work in one project <sarcasm>thanks to a colleague</sarcasm> and I think it's the single most pointless tool you can get. Not only that, but if you're not careful the StyleCop installer trashes your Visual Studio class and interface templates, exactly by putting namespaces inside and not outside. The thing is that Microsoft is the manufacturer. The manufacturer's templates specify namespace includes outside of the file's namespace, but someone who doesn't know you from Adam or what you're working on thinks they know better. As soon as I'm on another project it's getting uninstalled. ReSharper contains much of the same functionality as standard but is actually useful which is why it's allowed to stay. The same colleague also comes out with stuff like: "3rd party dependencies are really bad, they make everything too complicated" - so instead of using an ORM he reimplements ADO.net from scratch, taking months, despite ADO.net's presence in .net "You're referencing System.ServiceModel from a client application? That needs removing immediately. You're breaking separation of concerns" - despite the fact that System.ServiceModel contains stuff for client connections to WCF Services "I don't use interfaces because they're too complicated and I can't find the implementation" - despite right click + goto implementation "I prefix all my classes with 'X' so I know if a class is ours or not" - despite the fact that our classes reside in our own namespaces "How is your ASP.net web application going to work if you don't have IIS? you need to remove all dependencies to IIS altogether and find another way" - Whiskey Tango Foxtrot. and he doesn't like List<T> so any time he uses a method that returns a generic list he for loops over the result and turns it into an array - despite .ToArray()

        C Offline
        C Offline
        CafedeJamaica
        wrote on last edited by
        #14

        Its the drugs

        1 Reply Last reply
        0
        • J jim lahey

          We've got StyleCop at work in one project <sarcasm>thanks to a colleague</sarcasm> and I think it's the single most pointless tool you can get. Not only that, but if you're not careful the StyleCop installer trashes your Visual Studio class and interface templates, exactly by putting namespaces inside and not outside. The thing is that Microsoft is the manufacturer. The manufacturer's templates specify namespace includes outside of the file's namespace, but someone who doesn't know you from Adam or what you're working on thinks they know better. As soon as I'm on another project it's getting uninstalled. ReSharper contains much of the same functionality as standard but is actually useful which is why it's allowed to stay. The same colleague also comes out with stuff like: "3rd party dependencies are really bad, they make everything too complicated" - so instead of using an ORM he reimplements ADO.net from scratch, taking months, despite ADO.net's presence in .net "You're referencing System.ServiceModel from a client application? That needs removing immediately. You're breaking separation of concerns" - despite the fact that System.ServiceModel contains stuff for client connections to WCF Services "I don't use interfaces because they're too complicated and I can't find the implementation" - despite right click + goto implementation "I prefix all my classes with 'X' so I know if a class is ours or not" - despite the fact that our classes reside in our own namespaces "How is your ASP.net web application going to work if you don't have IIS? you need to remove all dependencies to IIS altogether and find another way" - Whiskey Tango Foxtrot. and he doesn't like List<T> so any time he uses a method that returns a generic list he for loops over the result and turns it into an array - despite .ToArray()

          A Offline
          A Offline
          AspDotNetDev
          wrote on last edited by
          #15

          "jim lahey wrote:

          I don't use interfaces because they're too complicated and I can't find the implementation" - despite right click + goto implementation

          I don't think he means the actual interface. He probably means the classes that implement the interface. It can be hard to tell which class is being used unless you have a breakpoint set at runtime.

          Thou mewling ill-breeding pignut!

          J 1 Reply Last reply
          0
          • R R Giskard Reventlov

            Seriously? Wow: amazed that people with this level of ineptitude last more than a week, anywhere.

            "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me

            A Offline
            A Offline
            AspDotNetDev
            wrote on last edited by
            #16

            Give a man a fish, and he'll eat for a day. Teach a man to fish, and he'll eat for a lifetime. Teach a man to fish poorly, and he'll spend all of his time fishing and not have time to learn much else.

            Thou mewling ill-breeding pignut!

            B B 2 Replies Last reply
            0
            • J jim lahey

              Nope, he's a very long-serving member of staff who comes from the Delphi world. I count myself very lucky that he's not above me in the team hierarchy and my team leader tends to agree with me on most things. The colleague in question has cemented his place in the company forever because he's one of only a few who have in depth knowledge of our legacy Delphi stuff (conveniently undocumented of course), which I refuse to touch because I didn't spend the last 12 years getting proficient in .net just to go and live in the past. Oh yeah, I almost forgot another couple of gems: "You have far less deployment issues with COM .dlls than .net assemblies" "There's too many assemblies in your web front end and wcf application (11 including unit test projects and implementiations totally decoupled from their interfaces), can't you reduce them?" - while he has solutions with 50+ projects, no meaningful unit tests and point blank refuses to use UML to visualise the bird's nest of dependencies he's just created I've taken to just saying whatever mate. trying to reason with him is like trying to teach calculus to your dog. If I was in charge I'd get all the legacy stuff documented in detail and tell him to get his act together or find another job. Attitudes like his are just a barrier to quality, progress and productivity, some of which has rubbed off on someone who sits next to him but that's an entirely different rant altogether.

              C Offline
              C Offline
              CMullikin
              wrote on last edited by
              #17

              jim lahey wrote:

              who comes from the Delphi world

              That's all you had to say... :laugh:

              The United States invariably does the right thing, after having exhausted every other alternative. -Winston Churchill America is the only country that went from barbarism to decadence without civilization in between. -Oscar Wilde Wow, even the French showed a little more spine than that before they got their sh*t pushed in.[^] -Colin Mullikin

              B F 2 Replies Last reply
              0
              • C CMullikin

                jim lahey wrote:

                who comes from the Delphi world

                That's all you had to say... :laugh:

                The United States invariably does the right thing, after having exhausted every other alternative. -Winston Churchill America is the only country that went from barbarism to decadence without civilization in between. -Oscar Wilde Wow, even the French showed a little more spine than that before they got their sh*t pushed in.[^] -Colin Mullikin

                B Offline
                B Offline
                BobJanova
                wrote on last edited by
                #18

                Hey now I coded quite a bit of Delphi and I'm not an idiot :~

                C realJSOPR 2 Replies Last reply
                0
                • J jim lahey

                  Nope, he's a very long-serving member of staff who comes from the Delphi world. I count myself very lucky that he's not above me in the team hierarchy and my team leader tends to agree with me on most things. The colleague in question has cemented his place in the company forever because he's one of only a few who have in depth knowledge of our legacy Delphi stuff (conveniently undocumented of course), which I refuse to touch because I didn't spend the last 12 years getting proficient in .net just to go and live in the past. Oh yeah, I almost forgot another couple of gems: "You have far less deployment issues with COM .dlls than .net assemblies" "There's too many assemblies in your web front end and wcf application (11 including unit test projects and implementiations totally decoupled from their interfaces), can't you reduce them?" - while he has solutions with 50+ projects, no meaningful unit tests and point blank refuses to use UML to visualise the bird's nest of dependencies he's just created I've taken to just saying whatever mate. trying to reason with him is like trying to teach calculus to your dog. If I was in charge I'd get all the legacy stuff documented in detail and tell him to get his act together or find another job. Attitudes like his are just a barrier to quality, progress and productivity, some of which has rubbed off on someone who sits next to him but that's an entirely different rant altogether.

                  realJSOPR Offline
                  realJSOPR Offline
                  realJSOP
                  wrote on last edited by
                  #19

                  jim lahey wrote:

                  trying to reason with him is like trying to teach calculus to your dog.

                  My dogs all have the combination to the gun safe.

                  ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                  -----
                  You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                  -----
                  "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997

                  B 1 Reply Last reply
                  0
                  • realJSOPR realJSOP

                    jim lahey wrote:

                    trying to reason with him is like trying to teach calculus to your dog.

                    My dogs all have the combination to the gun safe.

                    ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                    -----
                    You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                    -----
                    "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997

                    B Offline
                    B Offline
                    Big Daddy Farang
                    wrote on last edited by
                    #20

                    Good start. How's that dexterity training progressing?

                    BDF I often make very large prints from unexposed film, and every one of them turns out to be a picture of myself as I once dreamed I would be. -- BillWoodruff

                    C 1 Reply Last reply
                    0
                    • A AspDotNetDev

                      Give a man a fish, and he'll eat for a day. Teach a man to fish, and he'll eat for a lifetime. Teach a man to fish poorly, and he'll spend all of his time fishing and not have time to learn much else.

                      Thou mewling ill-breeding pignut!

                      B Offline
                      B Offline
                      Big Daddy Farang
                      wrote on last edited by
                      #21

                      Probably just sit in the boat and drink beer. But that's the whole point of fishing, isn't it?

                      BDF I often make very large prints from unexposed film, and every one of them turns out to be a picture of myself as I once dreamed I would be. -- BillWoodruff

                      F 1 Reply Last reply
                      0
                      • B BobJanova

                        Hey now I coded quite a bit of Delphi and I'm not an idiot :~

                        C Offline
                        C Offline
                        CMullikin
                        wrote on last edited by
                        #22

                        I didn't intend any offense to anyone. It was more of a joke. I am coding in Delphi as we speak. The company I work for is almost entirely a Delphi shop, and doesn't show any intentions of coming to their senses... :laugh:

                        The United States invariably does the right thing, after having exhausted every other alternative. -Winston Churchill America is the only country that went from barbarism to decadence without civilization in between. -Oscar Wilde Wow, even the French showed a little more spine than that before they got their sh*t pushed in.[^] -Colin Mullikin

                        1 Reply Last reply
                        0
                        • B Big Daddy Farang

                          Good start. How's that dexterity training progressing?

                          BDF I often make very large prints from unexposed film, and every one of them turns out to be a picture of myself as I once dreamed I would be. -- BillWoodruff

                          C Offline
                          C Offline
                          CMullikin
                          wrote on last edited by
                          #23

                          Big Daddy Farang wrote:

                          How's that dexterity training progressing?

                          Actually, it reads tail wags. No hands necessary. :laugh:

                          The United States invariably does the right thing, after having exhausted every other alternative. -Winston Churchill America is the only country that went from barbarism to decadence without civilization in between. -Oscar Wilde Wow, even the French showed a little more spine than that before they got their sh*t pushed in.[^] -Colin Mullikin

                          1 Reply Last reply
                          0
                          • J jim lahey

                            Nope, he's a very long-serving member of staff who comes from the Delphi world. I count myself very lucky that he's not above me in the team hierarchy and my team leader tends to agree with me on most things. The colleague in question has cemented his place in the company forever because he's one of only a few who have in depth knowledge of our legacy Delphi stuff (conveniently undocumented of course), which I refuse to touch because I didn't spend the last 12 years getting proficient in .net just to go and live in the past. Oh yeah, I almost forgot another couple of gems: "You have far less deployment issues with COM .dlls than .net assemblies" "There's too many assemblies in your web front end and wcf application (11 including unit test projects and implementiations totally decoupled from their interfaces), can't you reduce them?" - while he has solutions with 50+ projects, no meaningful unit tests and point blank refuses to use UML to visualise the bird's nest of dependencies he's just created I've taken to just saying whatever mate. trying to reason with him is like trying to teach calculus to your dog. If I was in charge I'd get all the legacy stuff documented in detail and tell him to get his act together or find another job. Attitudes like his are just a barrier to quality, progress and productivity, some of which has rubbed off on someone who sits next to him but that's an entirely different rant altogether.

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

                            jim lahey wrote:

                            "There's too many assemblies in your web front end and wcf application (11 including unit test projects and implementiations totally decoupled from their interfaces), can't you reduce them?"

                            There is a windows tool that combines assemblies.

                            B J 2 Replies Last reply
                            0
                            • B BobJanova

                              Hey now I coded quite a bit of Delphi and I'm not an idiot :~

                              realJSOPR Offline
                              realJSOPR Offline
                              realJSOP
                              wrote on last edited by
                              #25

                              BobJanova wrote:

                              Hey now I coded quite a bit of Delphi and I'm not an idiot

                              Notice "coded", as in used to code in Delphi. I presume you no longer code in Delphi, so you're right, you're no longer an idiot. :)

                              ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                              -----
                              You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                              -----
                              "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997

                              C 1 Reply Last reply
                              0
                              • J jschell

                                jim lahey wrote:

                                "There's too many assemblies in your web front end and wcf application (11 including unit test projects and implementiations totally decoupled from their interfaces), can't you reduce them?"

                                There is a windows tool that combines assemblies.

                                B Offline
                                B Offline
                                Big Daddy Farang
                                wrote on last edited by
                                #26

                                jschell wrote:

                                There's an app for that.

                                FTFY

                                BDF I often make very large prints from unexposed film, and every one of them turns out to be a picture of myself as I once dreamed I would be. -- BillWoodruff

                                1 Reply Last reply
                                0
                                • J jschell

                                  jim lahey wrote:

                                  "There's too many assemblies in your web front end and wcf application (11 including unit test projects and implementiations totally decoupled from their interfaces), can't you reduce them?"

                                  There is a windows tool that combines assemblies.

                                  J Offline
                                  J Offline
                                  jim lahey
                                  wrote on last edited by
                                  #27

                                  ILMerge by any chance? Been there.. I suggested it and the reply was "why use different projects at all if you're going to merge them?"

                                  1 Reply Last reply
                                  0
                                  • A AspDotNetDev

                                    "jim lahey wrote:

                                    I don't use interfaces because they're too complicated and I can't find the implementation" - despite right click + goto implementation

                                    I don't think he means the actual interface. He probably means the classes that implement the interface. It can be hard to tell which class is being used unless you have a breakpoint set at runtime.

                                    Thou mewling ill-breeding pignut!

                                    J Offline
                                    J Offline
                                    jim lahey
                                    wrote on last edited by
                                    #28

                                    That's exactly what I tried to say. He can't find the implementation. The right click + goto implementation still applies in my opinion, even if there are several classes that implement the same interface. You just pick from the list. I agree that it isn't 100% intuitive but this guy actively looks for reasons to negate things that are considered good practice.

                                    1 Reply Last reply
                                    0
                                    • realJSOPR realJSOP

                                      We are using StyleCop at work and I happened to ask my boss if there was a way to turn off the inside-the-namespace placement of using statements, and he informed me that there were subtle differences in the way .Net resolves class names depending on whether your using statements are inside or outside of the namespace. I accepted that, and then he added that only one of our assemblies can't be placed inside the namespace, but that he wasn't sure why. When I tried it, sure enough I got an Error 43 (_“The type or namespace name 'Namespace2' does not exist in the namespace 'Namespace0.Namespace1' (are you missing an assembly reference?)”_). The problem turns out to be that of all the (dozens of) assemblies in the solution, only one doesn't have the NameSpace0 namespace prefix, which instead is just Namespace1.Namespace2. Given the extensive use of the namespace elsewhere in the code as it exists today, I'm not sure we should try to "fix" the problem. Sometimes, sleuthing can be as interesting as writing the code itself, even if it turns out to be a bad idea to fix the problem.

                                      ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                                      -----
                                      You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                                      -----
                                      "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997

                                      F Offline
                                      F Offline
                                      Florin Jurcovici
                                      wrote on last edited by
                                      #29

                                      IMO you could really use the refactoring support provided by Eclipse for Java. Maybe there's something similar for C#? OTOH, what source control system do you use? In order not to loose history, the operation might be more complicated - if it involves moving files. IME, what you think is not worth fixing is the type of problem that will re-occur a million times every year for the next ten years while the code is in maintenanance. This definitely makes it worth fixing, IMO.

                                      1 Reply Last reply
                                      0
                                      • C CMullikin

                                        jim lahey wrote:

                                        who comes from the Delphi world

                                        That's all you had to say... :laugh:

                                        The United States invariably does the right thing, after having exhausted every other alternative. -Winston Churchill America is the only country that went from barbarism to decadence without civilization in between. -Oscar Wilde Wow, even the French showed a little more spine than that before they got their sh*t pushed in.[^] -Colin Mullikin

                                        F Offline
                                        F Offline
                                        Florin Jurcovici
                                        wrote on last edited by
                                        #30

                                        I don't think there's any relation. I think every language has its share of stupid, unskilled programmers who think they know the moon in the sky and can teach Kent Beck or Fowler lessons about programming.

                                        1 Reply Last reply
                                        0
                                        • B Big Daddy Farang

                                          Probably just sit in the boat and drink beer. But that's the whole point of fishing, isn't it?

                                          BDF I often make very large prints from unexposed film, and every one of them turns out to be a picture of myself as I once dreamed I would be. -- BillWoodruff

                                          F Offline
                                          F Offline
                                          Florin Jurcovici
                                          wrote on last edited by
                                          #31

                                          Nah, that's after he gets bored with how good a fisherman he is - after he has figured out that the whole world conspires to make fishing extremely difficult just for him.

                                          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