Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualHodgman

Posted 13 September 2012 - 08:57 AM

In practical terms, outside of the classroom, people don't use the terms abstract data type and concrete data type very often.

I've seen ADT used a bit by C-educated colleagues. Where a C++-based programmer might say "abstract base class", or a Java programmer might say "interface", these guys would say "abstract data type", but we'd all mean the same thing.
e.g. the abstract part
//Java guy says:
public interface Interface
{
  int DoStuff();
}
public class InterfaceFactory
{
  public static Interface Create();
}
//C++ guy says:
class ABC
{
public:
  static ABC* New();
  virtual ~ABC() = 0;
  virtual int DoStuff() = 0;
};
//C guy says
typedef struct {} ADT;
ADT* ADT_Create();
void ADT_Destroy(ADT*);
int ADT_DoStuff(ADT*);
And the (hidden) concrete backing:
//Java guy says:
public class Concrete implements Interface
{
  public int DoStuff() { return 42 };
}
public class InterfaceFactory
{
  public static Interface Create() { return new Concrete; }
}
//C++ guy says:
class Concrete : public ABC
{
public:
  int DoStuff() { return 42; }
};
static ABC* ABC::New() { return new Concrete; }
//C guy says
typedef struct {} Concrete;
ADT* ADT_Create() { return (ADT*)malloc(sizeof(Concrete)); }
void ADT_Destroy(ADT* o) { free(o); }
int ADT_DoStuff(ADT* o) { return 42; }

#8Hodgman

Posted 13 September 2012 - 08:56 AM

In practical terms, outside of the classroom, people don't use the terms abstract data type and concrete data type very often.

I've seen ADT used a bit by C-educated colleagues. Where a C++-based programmer might say "abstract base class", or a Java programmer might say "interface", these guys would say "abstract data type", but we'd all mean the same thing.
e.g. the abstract part
//Java guy says:
public interface Interface
{
  int DoStuff();
}
public class InterfaceFactory
{
  public static Interface Create();
}
//C++ guy says:
class ABC
{
public:
  static ABC* New();
  virtual ~ABC() = 0;
  virtual int DoStuff() = 0;
};
//C guy says
typedef struct {} ADT;
ADT* ADT_Create();
void ADT_Destroy(ADT*);
int ADT_DoStuff(ADT*);
And the (hidden) concrete backing:
//Java guy says:
public class Concrete implements Interface
{
  public int DoStuff() { return 42 };
}
public class InterfaceFactory
{
  public static Interface Create() { return new Concrete; }
}
//C++ guy says:
class Concrete : public ABC
{
public:
  int DoStuff() { return 42; }
};
static ABC* ABC::New() { return new Concrete; }
//C guy says
typedef struct {} Concrete;
ADT* ADT_Create() { return (ADT*)malloc(sizeof(Concrete)); }
void ADT_Destroy(ADT* o) { free o; }
int ADT_DoStuff(ADT* o) { return 42; }

#7Hodgman

Posted 13 September 2012 - 08:56 AM

In practical terms, outside of the classroom, people don't use the terms abstract data type and concrete data type very often.

I've seen ADT used a bit by C-educated colleagues. Where a C++-based programmer might say "abstract base class", or a Java programmer might say "interface", these guys would say "abstract data type", but we'd all mean the same thing.
e.g. the abstract part
//Java guy says:
public interface Interface
{
  int DoStuff();
}
public class InterfaceFactory
{
  public static Interface Create();
}
//C++ guy says:
class ABC
{
public:
  static ABC* New();
  virtual ~ABC() = 0;
  virtual int DoStuff() = 0;
};
//C guy says
typedef struct {} ADT;
ADT* ADT_Create();
void ADT_Destroy(ADT*);
int ADT_DoStuff(ADT*);
And the concrete backing
//Java guy says:
public class Concrete implements Interface
{
  public int DoStuff() { return 42 };
}
public class InterfaceFactory
{
  public static Interface Create() { return new Concrete; }
}
//C++ guy says:
class Concrete : public ABC
{
public:
  int DoStuff() { return 42; }
};
static ABC* ABC::New() { return new Concrete; }
//C guy says
typedef struct {} Concrete;
ADT* ADT_Create() { return (ADT*)malloc(sizeof(Concrete)); }
void ADT_Destroy(ADT* o) { free o; }
int ADT_DoStuff(ADT* o) { return 42; }

#6Hodgman

Posted 13 September 2012 - 08:55 AM

In practical terms, outside of the classroom, people don't use the terms abstract data type and concrete data type very often.

I've seen ADT used a bit by C-educated colleagues. Where a C++-based programmer might say "abstract base class", or a Java programmer might say "interface", these guys would say "abstract data type", but we'd all mean the same thing.
e.g. the abstract part
//Java guy says:
public interface Interface
{
  int DoStuff();
}
public class InterfaceFactory
{
  public static Interface Create();
}
//C++ guy says:
class ABC
{
public:
  static ABC* New();
  virtual ~ABC() = 0;
  virtual int DoStuff() = 0;
};
//C guy says
typedef struct {} ADT;
ADT* ADT_Create();
void ADT_Destroy(ADT*);
int ADT_DoStuff(ADT*);
And the concrete backing
//Java guy says:
public class Concrete implements Interface
{
  int DoStuff() { return 42 };
}
public class InterfaceFactory
{
  public static Interface Create() { return new Concrete; }
}
//C++ guy says:
class Concrete : public ABC
{
public:
  int DoStuff() { return 42; }
};
static ABC* ABC::New() { return new Concrete; }
//C guy says
typedef struct {} Concrete;
ADT* ADT_Create() { return (ADT*)malloc(sizeof(Concrete)); }
void ADT_Destroy(ADT* o) { free o; }
int ADT_DoStuff(ADT* o) { return 42; }

#5Hodgman

Posted 13 September 2012 - 08:51 AM

In practical terms, outside of the classroom, people don't use the terms abstract data type and concrete data type very often.

I've seen ADT used a bit by C-educated colleagues. Where a C++-based programmer might say "abstract base class", or a Java programmer might say "interface", these guys would say "abstract data type", but we'd all mean the same thing.
e.g.
//Java guy says:
public interface Interface
{
  int DoStuff();
}
public class InterfaceFactory
{
  public static Interface Create();
}
//C++ guy says:
class ABC
{
public:
  static ABC* New();
  virtual ~ABC() = 0;
  virtual int DoStuff() = 0;
};
//C guy says
typedef struct {} ADT;
ADT* ADT_Create();
void ADT_Destroy(ADT*);
int ADT_DoStuff(ADT*);

#4Hodgman

Posted 13 September 2012 - 08:50 AM

In practical terms, outside of the classroom, people don't use the terms abstract data type and concrete data type very often.

I've seen ADT used a bit by C-educated colleagues. Where a C++-based programmer might say "abstract base class", or a Java programmer might say "interface", these guys would say "ADT".
e.g.
//Java guy says:
public interface Interface
{
  int DoStuff();
}
public class InterfaceFactory
{
  public static Interface Create();
}
//C++ guy says:
class ABC
{
public:
  static ABC* New();
  virtual ~ABC() = 0;
  virtual int DoStuff() = 0;
};
//C guy says
typedef struct {} ADT;
ADT* ADT_Create();
void ADT_Destroy(ADT*);
int ADT_DoStuff(ADT*);

PARTNERS