Overwhelmed by the Simplicity of Python. Any Recommendation?
On 10/12/2018 1:06 PM, Chris Angelico wrote:
> There are many many different ways to write code, and you can approach
> your coding challenges from all sorts of directions. My recommendation
> is: Pseudo-code first, then implement in actual Python.
> Note how, in the Wiki page, there are a number of different forms of
> pseudocode. You're free to develop your own particular style. In
> general, pseudocode is a bit more rigorous than plain English, but
> less than actually-executable code.
Over two decades ago, I dubbed Python 'executable pseudocode'. I
recommend using it as such. Here is a common program template that
makes the basic logic clear
it = get_iterable()
<initialize other variables>
for item in it:
> Once you have some pseudocode
> written, make as few changes as you can, getting it to be runnable. In
> other words, you want your final code to look as much like pseudocode
> as you possibly can.
Either write the currently fake functions or replace the calls with
inline code. Do the latter for <pseudocode> items.
Terry Jan Reedy