Framework Design Guidelines: Word Choice

 

Continuing in the series of discussing topics from the Framework Design Guidelines

 

Expert from 3.2.5 Word Choice

 

DO NOT use Hungarian notation.

 

KRZYSZTOF CWALINA There have always been both positive and negative

effects of using the Hungarian naming convention and they still exist

today. Positives include better readability (if used correctly). Negatives

include cost of maintenance, confusion if maintenance was not done properly,

and finally, Hungarian makes the API more cryptic (less approachable)

to some developers. In the world of procedural languages (e.g., C) and the

separation of the System APIs for advanced developers from framework

libraries for a much wider developer group, the positives seemed to be

greater than the negatives. Today, with System APIs designed to be

approachable to more developers, and with object-oriented languages, the

trade-off seems to be pulling in the other direction. OO encapsulation

brings variable declaration and usage points closer together, OO style

favors short, well-factored methods, and abstractions often make the exact

type less important or even meaningless.

Keep in mind, this guideline is focused on PUBLICLY exposed APIs… so it is ok (even good?) to use Hungarian in your implementation details, but don’t pollute your APIs with them.