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.
  • 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
                      • realJSOPR realJSOP

                        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 Offline
                        C Offline
                        CMullikin
                        wrote on last edited by
                        #32

                        :thumbsup: :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.

                          A Offline
                          A Offline
                          agolddog
                          wrote on last edited by
                          #33

                          jim lahey wrote:

                          I've taken to just saying whatever mate. trying to reason with him is like trying to teach calculus to your dog.

                          Nah, at least then you're able to have a conversation with an intelligent animal.

                          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.

                            B Offline
                            B Offline
                            BrainiacV
                            wrote on last edited by
                            #34

                            Wow, except for the Delphi part and gender, I would have thought you were talking about my Former Bitch Supervisor From Helltm. After I joined the company and was under her thumb, she let loose with such gems like, "Microsoft's Memory Allocation does not work." I thought that was going to be a surprise to the millions of other Microsoft C programmers in the world, least of all Microsoft. I then found they had implemented not one, but five versions of their own (in the same project). They determined that it didn't work because they had allocated 16 bytes, deallocated those 16 bytes, and then when they reallocated 16 bytes, it did not have the same address as the first allocation. Obviously they were not hip to chunkiness. I was also told that the C compiler produced code just as efficient as Assembler. Being an Assembler programmer, I knew that was BS, and I later learned how they had come to that conclusion. They wrote a program in C, compiled, ran, and timed it. They then told the C compiler to generate an assembly listing, which they then assembled, ran, and timed, and gee whiz, it ran in the exact same time!

                            Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.

                            J 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()

                              R Offline
                              R Offline
                              RafagaX
                              wrote on last edited by
                              #35

                              It seems your colleague suffers from an acute not-invented-here syndrome, i recommnend you to fire him or put him on fire, whichever you think will work best for him. ;P This really made me laught:

                              jim lahey wrote:

                              "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"

                              Although there are other servers for ASP.NET (Webdev.Webhost and Cassini) usually an ASP.NET site is meant to be run on IIS, at least he didn't suggested that you must support Linux. :)

                              CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

                              J 1 Reply Last reply
                              0
                              • R RafagaX

                                It seems your colleague suffers from an acute not-invented-here syndrome, i recommnend you to fire him or put him on fire, whichever you think will work best for him. ;P This really made me laught:

                                jim lahey wrote:

                                "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"

                                Although there are other servers for ASP.NET (Webdev.Webhost and Cassini) usually an ASP.NET site is meant to be run on IIS, at least he didn't suggested that you must support Linux. :)

                                CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

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

                                RafagaX wrote:

                                It seems your colleague suffers from an acute not-invented-here syndrome

                                Our entire company is a bit like that to be honest. Some of the jaw-dropping things I've encountered in my first year to date: A homegrown language file system that uses line and space delimited text files, because .net doesn't have an equivalent and Zeta Resource Editor doesn't make editing the .resx files which don't exist anyway any easier A webservice not hosted in IIS but in ArcGIS Server that does not actually use any ArcGIS Server Object Extension functionality, complete with homegrown SOAP implementation. At least that's one standard being adhered to I suppose.. ASP.net GridViews with 100+ lines of homegrown paging, copy pasted everybloodywhere One very random page of a web application that builds a Html table layout from an Xml template run through an Xsl transform. Debugging that is probably the worst thing I've seen in over a decade and I've used VB6, RealBasic and PHP in years gone by Database designs with no FK constraints so referential integrity is non-existent Web.config or app.config only used to point to a separate Xml config file, which can then point to other files, which wait for it, can point to some other files. Find the error in that lot. Credit where credit is due, another guy actually gave a talk on creating proper configuration sections. Top man.

                                RafagaX wrote:

                                i recommnend you to fire him or put him on fire, whichever you think will work best for him

                                I've come to the conclusion that getting wound up about it won't do anything to fix the situation. Every time I find something like this I tell my manager, make an alternative suggestion and if necessary do a presentation of the alternative suggestion. The first talk I give next year will probably make a few people soil themselves, it's on interfaces, decoupling and dependency injection. Happy days.

                                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
                                  BrainiacV
                                  wrote on last edited by
                                  #37

                                  Give a man a fire and he will be warm for a day, set a man on fire and he'll be warm for the rest of his life.

                                  Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.

                                  1 Reply Last reply
                                  0
                                  • B BrainiacV

                                    Wow, except for the Delphi part and gender, I would have thought you were talking about my Former Bitch Supervisor From Helltm. After I joined the company and was under her thumb, she let loose with such gems like, "Microsoft's Memory Allocation does not work." I thought that was going to be a surprise to the millions of other Microsoft C programmers in the world, least of all Microsoft. I then found they had implemented not one, but five versions of their own (in the same project). They determined that it didn't work because they had allocated 16 bytes, deallocated those 16 bytes, and then when they reallocated 16 bytes, it did not have the same address as the first allocation. Obviously they were not hip to chunkiness. I was also told that the C compiler produced code just as efficient as Assembler. Being an Assembler programmer, I knew that was BS, and I later learned how they had come to that conclusion. They wrote a program in C, compiled, ran, and timed it. They then told the C compiler to generate an assembly listing, which they then assembled, ran, and timed, and gee whiz, it ran in the exact same time!

                                    Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.

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

                                    So was just that they were all stupid or that they were naive and being led by an idiot?

                                    B 1 Reply Last reply
                                    0
                                    • J jschell

                                      So was just that they were all stupid or that they were naive and being led by an idiot?

                                      B Offline
                                      B Offline
                                      BrainiacV
                                      wrote on last edited by
                                      #39

                                      Upper management were all idiots and she was their fair haired child. They really wanted nothing to do with computers, but market forces literally dragged them kicking and screaming all the way into the information age. The team I was with was the best group of programmers I ever worked with. We were just strangled by bureaucracy. Our shining moment was when I was accidentally left in charge for a few months and instead of plodding through the writing of specifications (the plan handed down from on high was to spend 2 months writing specs, 1 month writing test plans, and then finally 2 months writing code to the specs, followed by 1 month of testing. I wish I was making that up), that instead we were to drop everything and hunt bugs. The original plan fell apart after the CEO went off to a conference where he was going to describe all the new features we were going to add. I suspect the users met him at the door with baseball bats, we had shipped the previous version with 150 KNOWN defects and they made it clear they didn't care how many features it had if it didn't work. So I got to lead the team in cleaning up the code. Even then management did everything they could to thwart us. They had a non-technical committee deciding what bugs were going to be fixed and in what order. I was not invited. We had to perform analysis on the nature of each of the known bugs and give estimates on how long it would take to fix each one before we were allowed to fix them. I got yelled at for forwarding lists of bugs with titles like "Division by Zero error." "What the hell does that mean and what consequence is it to the user?" I could go on for hours, but despite all that, we hummed along at such a rate that QA begged us to slow down, they couldn't keep up with the testing. The best story I have to relate about all that was when the VP called the department asking how to log out. The application over the seven years he had been using it had never stayed up long enough for him need to do that. That and my supervisor, who finally returned from her leave of absence and was horrified at what she saw, was promoted to be an aide to the VP of Technology as a reward for her brilliant leadership.

                                      Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.

                                      B 1 Reply Last reply
                                      0
                                      • B BrainiacV

                                        Upper management were all idiots and she was their fair haired child. They really wanted nothing to do with computers, but market forces literally dragged them kicking and screaming all the way into the information age. The team I was with was the best group of programmers I ever worked with. We were just strangled by bureaucracy. Our shining moment was when I was accidentally left in charge for a few months and instead of plodding through the writing of specifications (the plan handed down from on high was to spend 2 months writing specs, 1 month writing test plans, and then finally 2 months writing code to the specs, followed by 1 month of testing. I wish I was making that up), that instead we were to drop everything and hunt bugs. The original plan fell apart after the CEO went off to a conference where he was going to describe all the new features we were going to add. I suspect the users met him at the door with baseball bats, we had shipped the previous version with 150 KNOWN defects and they made it clear they didn't care how many features it had if it didn't work. So I got to lead the team in cleaning up the code. Even then management did everything they could to thwart us. They had a non-technical committee deciding what bugs were going to be fixed and in what order. I was not invited. We had to perform analysis on the nature of each of the known bugs and give estimates on how long it would take to fix each one before we were allowed to fix them. I got yelled at for forwarding lists of bugs with titles like "Division by Zero error." "What the hell does that mean and what consequence is it to the user?" I could go on for hours, but despite all that, we hummed along at such a rate that QA begged us to slow down, they couldn't keep up with the testing. The best story I have to relate about all that was when the VP called the department asking how to log out. The application over the seven years he had been using it had never stayed up long enough for him need to do that. That and my supervisor, who finally returned from her leave of absence and was horrified at what she saw, was promoted to be an aide to the VP of Technology as a reward for her brilliant leadership.

                                        Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.

                                        B Offline
                                        B Offline
                                        BrainiacV
                                        wrote on last edited by
                                        #40

                                        Oh, by the way, the first 6 years of development on this POS was by consultants.

                                        Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.

                                        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