comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: grassroots level SPARK Initiation
Date: Wed, 25 Apr 2018 19:14:20 +0300
Date: 2018-04-25T19:14:20+03:00	[thread overview]
Message-ID: <fkbnqlFqcf8U1@mid.individual.net> (raw)
In-Reply-To: <69c72041-01c1-4080-b4d8-8b3aeb113375@googlegroups.com>

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
       .      @       .


  reply	other threads:[~2018-04-25 16:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 14:05 grassroots level SPARK Initiation Mehdi Saada
2018-03-23 14:16 ` Mehdi Saada
2018-03-23 14:24 ` Bojan Bozovic
2018-03-23 16:33 ` Shark8
2018-04-25 15:02   ` Mehdi Saada
2018-04-25 15:25     ` Mehdi Saada
2018-04-25 16:14       ` Niklas Holsti [this message]
2018-04-26  1:59     ` Paul Rubin
2018-05-24 18:55 ` Mehdi Saada
2018-05-24 20:52   ` Paul Rubin
2018-05-24 23:50     ` Mehdi Saada
2018-05-25  1:09       ` Paul Rubin
replies disabled

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