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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: some trivial questions? Date: Thu, 2 Nov 2017 17:54:25 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <6a5368c5-f015-4dcb-9291-e77b40fa1bf1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 2 Nov 2017 16:54:25 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="d230e5ec7f82f2617b433abbfd95b463"; logging-data="26699"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18HL2pXk9rXKkaldQQZWTN9amKDiiLNM/Y=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:k/5E0Qi/w7ytoXaXX9eRUePkZ5U= Xref: news.eternal-september.org comp.lang.ada:48705 Date: 2017-11-02T17:54:25+01:00 List-Id: On 11/02/2017 02:19 AM, tclwarrior@gmail.com wrote: > > i meant to say, why doesn't "use" imply "with" > i think every time you insert > a use, you will most definitely add a with No. One reason they're separate is because you can "use" things that you can't "with". > i think in a program with a large import (use) list of libraries, this can > save many lines and looks cleaner If you have long lists of use statements in your context clauses, then your code is unreadable so it doesn't matter. There is a trade off between using and not using use in terms of readability. Judicious use of use can make code more readable, but too much use has the opposite effect. In pedagogic code I tend to avoid use completely. In real code I have no problem with use statements with fairly large scope for common and well known pkgs, such as Ada.Strings.Unbounded. For other pkgs I tend to prefer to limit use statements to fairly small scopes in which there are enough references to entities from the used pkg to make it worthwhile (for me, that tends to be about 5). -- Jeff Carter "I've seen projects fail miserably for blindly applying the Agile catechism: we're Agile, we don't need to stop and think, we just go ahead and code!" Bertrand Meyer 150