Abstract Data Types

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 818 Views - Last Post: 01 February 2018 - 10:20 AM Rate Topic: -----

#16 tony jay   User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 50
  • Joined: 31-January 18

Re: Abstract Data Types

Posted 01 February 2018 - 03:15 AM

One point I take issue with is what you say about the standard library.
Yes it is part of the ISO standard but it remains separate from the core language as such.

I understand that its de facto use makes it appear to be part of the core language - that is, in fact, the intent.
Creating (implementing, if you insist) ADT's in C++ one wishes to create much the same impression.
Was This Post Helpful? 0
  • +
  • -

#17 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6166
  • View blog
  • Posts: 21,268
  • Joined: 05-May 12

Re: Abstract Data Types

Posted 01 February 2018 - 06:51 AM

The questions I initially asked in post #7 were not meant to be cryptic. I was trying to tease out if there was some kind of new feature(s) in current versions of C++ or in upcoming versions that actually let somebody define an ADT while declaring without actually creating an implementation; and if those features not only captured the "shape" of the ADT's interface, but also behavior expected from the ADT not only in terms of what it does, but also in expected time complexity, and thread safety. I'm sorry if you took it to be mean spirited.

After more browsing around, I think I see where the line between ADT and implementation of an ADT starts to blur, specially in the way ADTs are taught in conjunction with C++. I thought that the Book example in the ODU CS lecture was insightful. While defining the ADT, the he was trying to stick with what functions could be done with a book and not show the function implementations, and then when it came to implement the ADT, he shows how the functions almost directly map into a C++ class functions, and it's just a matter of writing implementations for those functions.
Was This Post Helpful? 0
  • +
  • -

#18 baavgai   User is offline

  • Dreaming Coder
  • member icon


Reputation: 7164
  • View blog
  • Posts: 14,932
  • Joined: 16-October 07

Re: Abstract Data Types

Posted 01 February 2018 - 10:15 AM

@Skydiver: I don't think you scanned down far enough your cited Wikipedia for the concrete support of your point:

Quote

ADTs are a theoretical concept in computer science, used in the design and analysis of algorithms, data structures, and software systems, and do not correspond to specific features of computer languages—mainstream computer languages do not directly support formally specified ADTs. However, various language features correspond to certain aspects of ADTs, and are easily confused with ADTs proper; these include abstract types, opaque data types, protocols, and design by contract.
-- https://en.wikipedia...tract_data_type


I'd say "design by contract," i.e. interfaces in programming languages, are the gray area between an ADT and an implementation. C++ doesn't have explicit "interface" syntax, as pure abstract classes fill the same role in a language that supports multiple inheritance.
Was This Post Helpful? 1
  • +
  • -

#19 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6166
  • View blog
  • Posts: 21,268
  • Joined: 05-May 12

Re: Abstract Data Types

Posted 01 February 2018 - 10:20 AM

I actually saw that, but wasn't quite clicking in at 2AM in the morning after about a week of running on just about 3 hours of sleep a night.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2