Horror from an article in CP
-
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 ? :)
-
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 ? :)
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 -
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 ? :)
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.
-
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 MetcalfeI see, searching MSDN got me to the article, it defines its own ViewInfoCollection.
-
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 ? :)
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
-
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
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Ã<-·´¯`·.
-
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 ? :)
I am glad it is not any of my articles. it is far too stressful though, stop that and write articles yourself.
-
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 ? :)
-
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
-
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Ã<-·´¯`·.
I'll be the brave one: Comment
-
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
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.
-
I'll be the brave one: Comment
-
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
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