Skip to contentSkip to conversation

programming methodology terminology

DISCUSSION Hans Reiser 4 participants 5 messages Jan 30, 2006 – Feb 2, 2006

lore
Share & tools
lore
#0 lore raw

suppose there are two distinct layers of abstraction, one on top of the other. Suppose someone uses the error condition names of the top layer in coding the bottom layer when the return values it is used for in the bottom layer have not the same purpose as those of the top layer, and when it would be an error for the return value to actually get propagated all the way out of the top layer. What is this bad programming practice called, there is a name for it isn't there? When you use a return value #define for two different meanings, is there a name for that? It is generally accepted to be bad style, yes?

Hans

#1 lore raw

It seems like a form of layering violation to me. Conflation of meaning for a #define is definitely undue obfuscation, if not out right bad coding.

Ivan...

Quoted 12 lines · Hans Reiser

suppose there are two distinct layers of abstraction, one on top of the other. Suppose someone uses the error condition names of the top layer in coding the bottom layer when the return values it is used for in the bottom layer have not the same purpose as those of the top layer, and when it would be an error for the return value to actually get propagated all the way out of the top layer. What is this bad programming practice called, there is a name for it isn't there? When you use a return value #define for two different meanings, is there a name for that? It is generally accepted to be bad style, yes?

Hans

#2 lore raw
In reply to Hans Reiser
Quoted 9 lines · Hans Reiser

suppose there are two distinct layers of abstraction, one on top of the other. Suppose someone uses the error condition names of the top layer in coding the bottom layer when the return values it is used for in the bottom layer have not the same purpose as those of the top layer, and when it would be an error for the return value to actually get propagated all the way out of the top layer. What is this bad programming practice called, there is a name for it isn't there? When you use a return value #define for two different meanings, is there a name for that? It is generally accepted to be bad style, yes?

I'd say it's definitely a layering violation - but I don't know if there's a more specific name for this particular situation.

Signature · 2 lines
Regards,
Christian Iversen
#3 lore raw
In reply to Hans Reiser

Hans Reiser wrote on Sun, 29 Jan 2006 23:15:41 -0800:

Quoted 3 lines

When you use a return value #define for two different meanings, is there a name for that? It is generally accepted to be bad style, yes?

It might be called something overloading, perhaps Semantic Overloading?

- Alex

#4 lore raw
Quoted 9 lines · Alexander G. M. Smith

Hans Reiser wrote on Sun, 29 Jan 2006 23:15:41 -0800:

Quoted 5 lines

When you use a return value #define for two different meanings, is there a name for that? It is generally accepted to be bad style, yes?

Quoted 7 lines

It might be called something overloading, perhaps Semantic Overloading?

- Alex

That sounds right. At any rate, we should avoid doing it the way we do with -E_REPEAT and its cousins..... ;-)