From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f25e853f410d55da X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Time to join the fold? Date: 1999/02/01 Message-ID: #1/1 X-Deja-AN: 439481005 References: <78abg4$cnc$1@its.hooked.net> <78i8s4$hth$1@its.hooked.net> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1999-02-01T00:00:00+00:00 List-Id: In article Steve Whalen writes: > Spend more time thinking about your application's data, and your > application "as data" (by "application as data" I mean revisit program > logic, and see if it can be better represented in a "soft" data > structure somewhere)... > Even more importantly I want to benefit from thinking more deeply > about WHY some data should be a represented one way, instead of > another... > Bottom line: Getting the data structures and representations right > lets Ada help you build higher quality applications... Amen! I find that effort devoted to the package specifications, which contain most of the data types, either exported or in the private part, is the key part of programming in Ada. Once you know which types should be used where and why, writing the code is easy. But there is another part to Ada think. In many languages you are looking for a model which best fits the solution. In Ada it is almost always a big win to fit the model to the problem space. Generics and generic instantiation can be used to map a solution onto your problem. To take one simple example, if you are going to sort a list the ordering relation is a generic argument that can be a quite complex function of the data. If the sort order changes, you change that function, not the data. But if your requirements change in such a way that you need to represent additional aspects of reality in the data, this requires additional modifications. Hmmm... Not quite simple expressed that way. Say you have a bibliography. The effort required to sort by author, title, Library of Congress number, or even author's middle name, is small, assuming that all are present in the data. Your problem space is a bibliography, the sort package's problem space is lists to be sorted, and all you have to do is provide the glue. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...