Click here to Skip to main content
15,895,746 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: CCC 6/1/14 Pin
Tom Lawton5-Jan-14 23:56
Tom Lawton5-Jan-14 23:56 
GeneralRe: CCC 6/1/14 Pin
pkfox6-Jan-14 0:09
professionalpkfox6-Jan-14 0:09 
GeneralMQOTD Pin
V.5-Jan-14 21:38
professionalV.5-Jan-14 21:38 
GeneralRe: MQOTD Pin
Nagy Vilmos5-Jan-14 21:41
professionalNagy Vilmos5-Jan-14 21:41 
GeneralRe: MQOTD Pin
OriginalGriff5-Jan-14 22:06
mveOriginalGriff5-Jan-14 22:06 
GeneralRe: MQOTD Pin
CBadger6-Jan-14 0:01
professionalCBadger6-Jan-14 0:01 
GeneralRe: MQOTD Pin
Corporal Agarn6-Jan-14 2:52
professionalCorporal Agarn6-Jan-14 2:52 
GeneralDuck typing Pin
Marco Bertschi5-Jan-14 20:43
protectorMarco Bertschi5-Jan-14 20:43 
In computer programming with object-oriented programming languages, duck typing is a style of typing in which an object's methods and properties determine the valid semantics, rather than its inheritance from a particular class or implementation of a specific interface.


An interesting read, but something remains unclear to me: Why would you want to have something like

C#
class Duck
{
  public void Quack() { ... }
  public void Walk() { ... }
}
class OtherDuck
{
  public void Quack() { ... }
  public void Walk() { ... }
}
...
void M(Duck bird)
{
  bird.Quack();
  bird.Walk();
}
...
M(new Duck()); // Legal
M(new OtherDuck()); // Illegal


rather than have <duck> and <otherduck> inherit from an interface <iduck>?
To me Duck Typing seems some [to be]* form of Duct Taping (I'll admit it: Pun intended).

* Fixed Typo - I forgot 'to be' in there.
Veni, vidi, caecus | Everything summarizes to Assembly code


modified 6-Jan-14 3:55am.

GeneralRe: Duck typing Pin
Kornfeld Eliyahu Peter5-Jan-14 21:11
professionalKornfeld Eliyahu Peter5-Jan-14 21:11 
GeneralRe: Duck typing Pin
Nagy Vilmos5-Jan-14 21:40
professionalNagy Vilmos5-Jan-14 21:40 
GeneralRe: Duck typing Pin
CBadger5-Jan-14 21:40
professionalCBadger5-Jan-14 21:40 
GeneralRe: Duck typing Pin
BillWoodruff5-Jan-14 21:57
professionalBillWoodruff5-Jan-14 21:57 
GeneralRe: Duck typing Pin
Gjeltema6-Jan-14 4:13
Gjeltema6-Jan-14 4:13 
AnswerRe: Duck typing Pin
Pablo Aliskevicius5-Jan-14 22:58
Pablo Aliskevicius5-Jan-14 22:58 
GeneralRe: Duck typing Pin
peterchen6-Jan-14 0:13
peterchen6-Jan-14 0:13 
GeneralRe: Duck typing Pin
Shameel5-Jan-14 23:09
professionalShameel5-Jan-14 23:09 
GeneralRe: Duck typing Pin
John Atten6-Jan-14 4:14
John Atten6-Jan-14 4:14 
GeneralRe: Duck typing Pin
Roger Wright6-Jan-14 8:58
professionalRoger Wright6-Jan-14 8:58 
GeneralSR-71 pron! Get in and take a look around! Pin
Dave Kreskowiak5-Jan-14 8:21
mveDave Kreskowiak5-Jan-14 8:21 
GeneralRe: SR-71 pron! Get in and take a look around! Pin
Mike Hankey5-Jan-14 9:22
mveMike Hankey5-Jan-14 9:22 
GeneralRe: SR-71 pron! Get in and take a look around! Pin
Member 41945935-Jan-14 10:32
Member 41945935-Jan-14 10:32 
General":@#^%^#$ cars Pin
Erudite_Eric5-Jan-14 6:52
Erudite_Eric5-Jan-14 6:52 
GeneralRe: ":@#^%^#$ cars Pin
Ron Anders5-Jan-14 7:56
Ron Anders5-Jan-14 7:56 
GeneralRe: ":@#^%^#$ cars Pin
Chris Maunder5-Jan-14 17:04
cofounderChris Maunder5-Jan-14 17:04 
GeneralRe: ":@#^%^#$ cars Pin
Erudite_Eric5-Jan-14 18:57
Erudite_Eric5-Jan-14 18:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.