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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7ae8393ad9100e97 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.189.233 with SMTP id gl9mr7991307pbc.8.1324041884804; Fri, 16 Dec 2011 05:24:44 -0800 (PST) Path: lh20ni29177pbb.0!nntp.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada2012 : When to use expression functions rather than function bodies? Date: Fri, 16 Dec 2011 14:24:15 +0100 Organization: cbb software GmbH Message-ID: <1s7pzkf4hmdl5.15o0cmwoy5alh$.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-12-16T14:24:15+01:00 List-Id: On Fri, 16 Dec 2011 04:25:09 -0800 (PST), Martin wrote: > Are there any good arguments for *not* replacing all simple, single > line functions that don't [directly] access package body state > information with expression functions? 1. Readability 2. Proper encapsulation (to have interface and implementation separated) 3. Re-use (the same function must be refactored) 4. Maintainability (because of 1..3) 5. Safety (proper bodies are defined on the context where they have no access to the caller's context, otherwise than through parameters) 6. Deployment (proper bodies can be put into a library, have versions etc) 7. It is not Ada -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de