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!feeder.eternal-september.org!news.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: grassroots level SPARK Initiation Date: Wed, 25 Apr 2018 19:14:20 +0300 Organization: Tidorum Ltd Message-ID: References: <0cef0914-30b1-4139-a341-40e8f32f85d9@googlegroups.com> <96a1828a-a1bc-43c3-b51c-434a257e1e8f@googlegroups.com> <69c72041-01c1-4080-b4d8-8b3aeb113375@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net /z1XPa+2D3okGUgi+PAM1QvTMVzfHxMrQz0t4lWIeK7iz5V/V/ Cancel-Lock: sha1:mmeGHwWRulmzyG6NpWf94aqw2Mo= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <69c72041-01c1-4080-b4d8-8b3aeb113375@googlegroups.com> Xref: reader02.eternal-september.org comp.lang.ada:51701 Date: 2018-04-25T19:14:20+03:00 List-Id: On 18-04-25 18:25 , Mehdi Saada wrote: > My problem is untold difficulty with algorithms. Even-though I may > understand easily how they operate in natural language (say, binary > search through a sorted container), I cannot code it: more than 25+ > lines (of myself), and I don't understand it anymore. Then I'm > "forced" to tweak things here and there, until it works. I know I > shouldn't debug like this, and I hate it too. especially not knowing > what I do. I find it helps me to describe in prose (in comments) exactly what every variable, parameter, subprogram, loop, etc. is intended to do and represent, including all the special cases (empty array, value not found, etc.). Then you don't need to hold it all in your mind, but can refer to the written descriptions as often as needed. And the bonus is that the descriptions remain available for anyone looking at or modifying the program, including a future version of yourself... -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .