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. Other Discussions
  3. The Weird and The Wonderful
  4. Horror from an article in CP

Horror from an article in CP

Scheduled Pinned Locked Moved The Weird and The Wonderful
question
13 Posts 12 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Ashish Kaila

    I wont say which article but here is the snippet: public static ViewInfoCollection FromXmlFile(string filename) { ViewInfoCollection @new = new ViewInfoCollection(); @new.ReadFromXml(filename); return @new; } Can anyone spot the horror ? :)

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

    A) It doesn't use a fully-qualified name so I have no way of knowing what a ViewInfoCollection is. D) Use of the @ prefix when simply picking a better name would suffice. E) I'm not concerned about the lack of a test for null. -- modified at 23:22 Saturday 1st September, 2007 Removed C, brain fart. -- modified at 23:31 Saturday 1st September, 2007 Removed B, after seeing that the class is defined in the article's code.

    1 Reply Last reply
    0
    • D DavidNohejl

      Hmm, it shouldn't compile? This link[^] says ViewInfoCollection is abstract class.


      [My Blog]
      "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn
      "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe

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

      I see, searching MSDN got me to the article, it defines its own ViewInfoCollection.

      1 Reply Last reply
      0
      • A Ashish Kaila

        I wont say which article but here is the snippet: public static ViewInfoCollection FromXmlFile(string filename) { ViewInfoCollection @new = new ViewInfoCollection(); @new.ReadFromXml(filename); return @new; } Can anyone spot the horror ? :)

        V Offline
        V Offline
        Vasudevan Deepak Kumar
        wrote on last edited by
        #5

        I would say you should have pointed out in the article's own message board so that the author can address this and give you a more quality tool. If the author does not address, you may anyway cast your Vote for the article. ;P

        Vasudevan Deepak Kumar Personal Homepage Tech Gossips

        R M 2 Replies Last reply
        0
        • V Vasudevan Deepak Kumar

          I would say you should have pointed out in the article's own message board so that the author can address this and give you a more quality tool. If the author does not address, you may anyway cast your Vote for the article. ;P

          Vasudevan Deepak Kumar Personal Homepage Tech Gossips

          R Offline
          R Offline
          Rajesh R Subramanian
          wrote on last edited by
          #6

          Vasudevan Deepak Kumar wrote:

          I would say you should have pointed out in the article's own message board so that the author can address this and give you a more quality tool.

          I agree with you.


          Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->ßRÅhmmÃ<-·´¯`·.

          D 1 Reply Last reply
          0
          • A Ashish Kaila

            I wont say which article but here is the snippet: public static ViewInfoCollection FromXmlFile(string filename) { ViewInfoCollection @new = new ViewInfoCollection(); @new.ReadFromXml(filename); return @new; } Can anyone spot the horror ? :)

            P Offline
            P Offline
            Pascal Ganaye
            wrote on last edited by
            #7

            I am glad it is not any of my articles. it is far too stressful though, stop that and write articles yourself.

            1 Reply Last reply
            0
            • A Ashish Kaila

              I wont say which article but here is the snippet: public static ViewInfoCollection FromXmlFile(string filename) { ViewInfoCollection @new = new ViewInfoCollection(); @new.ReadFromXml(filename); return @new; } Can anyone spot the horror ? :)

              O Offline
              O Offline
              OR0N
              wrote on last edited by
              #8

              No. Elaborate.

              M 1 Reply Last reply
              0
              • O OR0N

                No. Elaborate.

                M Offline
                M Offline
                Mike Dimmick
                wrote on last edited by
                #9

                I would generally reserve the use of @ to escape C# keywords for places where you're trying to use a class library where someone else has used a C# reserved word as a function or property name (for example). I would run screaming from code where it's used to give a private field or stack variable (in this case) a name the same as a C# reserved word.

                Stability. What an interesting concept. -- Chris Maunder

                P 1 Reply Last reply
                0
                • R Rajesh R Subramanian

                  Vasudevan Deepak Kumar wrote:

                  I would say you should have pointed out in the article's own message board so that the author can address this and give you a more quality tool.

                  I agree with you.


                  Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->ßRÅhmmÃ<-·´¯`·.

                  D Offline
                  D Offline
                  Drew_Benton
                  wrote on last edited by
                  #10

                  I'll be the brave one: Comment

                  S 1 Reply Last reply
                  0
                  • M Mike Dimmick

                    I would generally reserve the use of @ to escape C# keywords for places where you're trying to use a class library where someone else has used a C# reserved word as a function or property name (for example). I would run screaming from code where it's used to give a private field or stack variable (in this case) a name the same as a C# reserved word.

                    Stability. What an interesting concept. -- Chris Maunder

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

                    There's the difference between you and me. You would run screaming. I would hunt them down and burn them. Burn the witch. Burn the witch.

                    Deja View - the feeling that you've seen this post before.

                    1 Reply Last reply
                    0
                    • D Drew_Benton

                      I'll be the brave one: Comment

                      S Offline
                      S Offline
                      SimmoTech
                      wrote on last edited by
                      #12

                      You guys all have way too much time on your hands. :)

                      Cheers Simon

                      1 Reply Last reply
                      0
                      • V Vasudevan Deepak Kumar

                        I would say you should have pointed out in the article's own message board so that the author can address this and give you a more quality tool. If the author does not address, you may anyway cast your Vote for the article. ;P

                        Vasudevan Deepak Kumar Personal Homepage Tech Gossips

                        M Offline
                        M Offline
                        Mushtaque Nizamani
                        wrote on last edited by
                        #13

                        Vasudevan Deepak Kumar wrote:

                        I would say you should have pointed out in the article's own message board so that the author can address this and give you a more quality tool.

                        Well Said.

                        Best Regards, Mushq Mushtaque Ahmed Nizamani Software Engineer Ultimus Pakistan

                        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