Skip to content.

Manageability

Sections
Personal tools
You are here: Home » blog » archive » get, set Functions and if Statement Considered Evil
Views
  • State: published

get, set Functions and if Statement Considered Evil

Document Actions
20021030162218

From time to time I run into a technical article that continues to perplex me for a long time.  I recall two from www.javaworld.com , one is the set of articles by Alan Holub on Building User Interfaces for Object Oriented Systems, which has a particularly perplexing quote "get and set functions are evil."

I fully comprehend "new considered harmful" and still am trying to grasp "If Statement Considered Harmful". Well it turns out, there's even more, if your interested here's a list:

Inheritance Considered Harmful and this. , Object-Oriented Considered Harmful, I/O Considered Harmful, Lists with "Current" Considered Harmful, Class-Based Modeling Considered Harmful, Use Cases Considered Harmful, Eager evaluation considered Harmful

Now I haven't read all these, I probably won't, but I'm going to read over and over until I get it why "get, set Functions and if Statement Considered Evil".

Oh, I digressed, the second javaworld article Reflection vs. Code Generation, has another perplexing statement: As for code generation: the more I work with it, the more I like it. With every refactoring and increase in functionality, the code becomes clearer and more understandable. However, runtime reflection has the opposite effect. The more I increase its functionality, the more it increases in complexity.


Last modified 2003-07-31 07:09 AM

Get/Set is Evil

Posted by Anonymous User Anonymous User at 2005-08-09 08:29 AM

My interpretation of the article is that the author was trying to say what Robert martin said in his Software Development column "The Craftsman" in the episode "Its Not the Rules" (http://www.sdmagazine.com/documents/s=7764/sdm0410h/). The debate is using public variables versus using private variables and public methods that simply read and write the private variables. What's the point?

How doing something illogically is "evil" is beyond me. That word is overused, in my opinion.

My two cents,

Dale Hurtt code_ronin at yahoo.com

visitors
reading
 
 

Powered by Plone

This site conforms to the following standards: