1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Aren't interfaces useless?

Discussion in 'Programming' started by elixir, Nov 30, 2005.

  1. #1
    I tried, I really tried to find a meaning to interfaces, but I just can't =/

    As with many things in OOP, interfaces are really only supposed to have a semantical meaning, like encapsulation with public, private and protected is pretty much purely semantical. Making all of your variables public, for example, won't change anything in the compiled program, but instead make it easier to shoot yourself in the foot during coding and compilation.

    It seems to me, that this concept of a "contract" between the interface and the class to implement certain functions is useless, as your program will never compile if it ever calls non-existant functions, anyway. What is the point of implementing interfaces, besides communicating (to a the programmer using the classes) that this class is sure to have that&that functions? He'll know anyway, won't he?
     
    elixir, Nov 30, 2005 IP