comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada2012 : When to use expression functions rather than function bodies?
Date: Fri, 16 Dec 2011 14:24:15 +0100
Date: 2011-12-16T14:24:15+01:00	[thread overview]
Message-ID: <1s7pzkf4hmdl5.15o0cmwoy5alh$.dlg@40tude.net> (raw)
In-Reply-To: d98a9754-62bb-4f95-bba4-45f498c703bd@z1g2000vbx.googlegroups.com

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



  reply	other threads:[~2011-12-16 13:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-16 12:25 Ada2012 : When to use expression functions rather than function bodies? Martin
2011-12-16 13:24 ` Dmitry A. Kazakov [this message]
2011-12-17  1:03   ` Randy Brukardt
2011-12-16 18:03 ` Adam Beneschan
2011-12-16 20:36   ` Martin Dowie
2011-12-16 21:34     ` Adam Beneschan
2011-12-16 23:08       ` Adam Beneschan
2011-12-17 12:26   ` georg bauhaus
2011-12-16 22:01 ` Jeffrey Carter
2011-12-16 22:52   ` Adam Beneschan
2011-12-16 23:09     ` Adam Beneschan
2011-12-17  1:21     ` Randy Brukardt
2011-12-17 12:45       ` georg bauhaus
2011-12-17 13:11         ` Dmitry A. Kazakov
2011-12-19 23:34           ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox