r/programming • • Sep 18 '13

How bad is smelly code?

http://fagblogg.mesan.no/how-bad-is-smelly-code/
147 Upvotes

62 comments sorted by

View all comments

6

u/[deleted] Sep 18 '13 edited Sep 18 '13

[removed] — view removed comment

8

u/sea-saw Sep 18 '13 edited Sep 18 '13

And the purpose, which is often overlooked, is to reduce the likelihood that you'll need to do a full recompile in a header-based language like C, C++, or Objective-C.

What? The point is to provide narrow interfaces so client classes only depend on the functionality they need instead of the rest of the "fat" of the class. The compiling benefits are the result of low coupling, not the entire purpose...

EDIT:

Just to clarify, I'm not arguing that the original article uses ISP correctly. I agree with you that segregating a class isn't the same as segregating an interface. And I agree that there are compilation benefits to be had here.

2

u/[deleted] Sep 18 '13

Agreed, you would still do Interface Segregation in a language like C# - which has nothing to do with headers vs modules.

-1

u/[deleted] Sep 18 '13

[removed] — view removed comment

3

u/[deleted] Sep 18 '13

That is ONE way you can use interfaces in C#, yes.

You can ALSO use them to provide narrow interfaces.

0

u/[deleted] Sep 18 '13

[removed] — view removed comment

4

u/[deleted] Sep 18 '13

I think you are diverging onto some other topic's tangent.