BartC <b...@freeuk.com> writes:

> On 24/01/2017 15:51, Ben Bacarisse wrote:
>> Chris Angelico <ros...@gmail.com> writes:
>> <snip>
>>> ... I teach JavaScript as well as Python, and I've seen some
>>> pretty horrendous indentation flaws (examples available if people ask
>>> privately, but I will anonymize them because I'm not here to shame
>>> students) - but there have been nearly as many cases where the
>>> indentation's fine and the bracket nesting isn't.
>>
>> Can I ask what editor(s) your students have available?  I ask because
>> I've not given a moment's thought to indentation or what bracket matches
>> what for decades due to having a helpful editor.
>
> How would your editor detect the error in the example I gave earlier?

I'm not talking about detecting errors -- that's for the programmer --
but the editor can help the programmer to be sure they wrote what they
meant by doing things like matching brackets and auto-indenting code in
{}s.  (I'm replying to a post about JavaScript which has {}s.)

The trouble is that I've been programming for so long that I can't
remember what it's like to make block and/or indent errors.  Obviously I
make typos but they don't survive more than a few seconds.  I hoped that
Chris's students would provide an insight into how the tools do or
don't help.

> (Where a tab has been inadvertently removed - or added - but the
>result is still valid Python code.)

In Python the editor could, for example, highlight the block you are
typing in, so as soon as you leave the body of the 'if' it would stop
being marked and the containing code would be highlighted.  Just moving
the cursor up and down would show you what block everything is in.  I
don't know if any editors help like this -- that's part of my reason to
ask.

-- 
Ben.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to