Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 1
    It's not really about advantages or disadvantages. I wouldn't even say that there are disadvantages, since all you do is restrict yourself to a contract and if that contract isn't enough then.. well.. it wasn't the right contract in the first place. Another post on the subject: stackoverflow.com/questions/1484445/… Commented Apr 2, 2015 at 0:24
  • 1
    Naming that variable oCustomer is way, way out of fashion, a throwback to "Hungarian" notation (Microsoft, Charles Simonyi). The original purpose of Hungarian notation was to indicate the type of a variable, in the C language, since C has such a weakly enforced type system (virtually non-existent, really) and the tools were so much more primitive. The original C# language specification at Microsoft actually recommended explicitly against using Hungarian notation. I used to be a huge advocate, now it seems kind of obnoxious when I encounter it. Just an observation. ;-) Commented Apr 2, 2015 at 7:37
  • 1
    @Craig: The way I heard it, Hungarian notation was never meant to indicate type. It was to indicate type-like information like the units of a measurement or whether coordinates were relative to one thing or another. It only started being used for type once people completely misunderstood it and screwed the whole thing up. Commented Apr 2, 2015 at 17:56
  • 1
    @user2357112 I do sort of remember the history of the thing. I'm going to argue that using just an "o" as a prefix is actually pretty lame, though. It's so cargo cult... How many people are surprised to discover that an instance of Customer is an object (show of hands?). None. There's my point. If the prefix actually told you something more useful, like the old lpsz prefix in C which told you that you were (ostensibly) dealing with a long pointer to a null terminated plain old C string (as opposed to something like a BSTR), then the prefix would serve a purpose. :-) Commented Apr 2, 2015 at 18:08
  • 1
    @user2357112 Also, good call invoking Spoelsky. But do note the date on the article (10 years ago). Having said that, I PROFOUNDLY AGREE with Joel on this point: "4. You deliberately architect your code in such a way that your nose for uncleanliness makes your code more likely to be correct." I'm just no longer convinced that Hungarian notation plays a direct role in that with modern, strongly-typed languages. Just like I'm no longer convinced that using var instead of specific type names in variable declarations is an abomination. Commented Apr 2, 2015 at 18:09