Re: How an editor can help with block nesting (was Re: How coding in Python is bad for you)

2017-01-25 Thread Ben Iannitelli
On Wed, Jan 25, 2017 at 6:31 AM, Ben Bacarisse wrote: 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 th

Re: How an editor can help with block nesting (was Re: How coding in Python is bad for you)

2017-01-24 Thread Dan Sommers
On Wed, 25 Jan 2017 12:31:11 +1100, Steve D'Aprano wrote: > But now I type something which cannot possibly be indented there: > > def func(a, b): > if condition: > spam() > elif something: | > > and hit ENTER again. There's nothing ambiguous about this, and th

Re: How an editor can help with block nesting (was Re: How coding in Python is bad for you)

2017-01-24 Thread Chris Angelico
On Wed, Jan 25, 2017 at 12:31 PM, Steve D'Aprano wrote: >> With my JavaScript students, the greatest help is probably a keystroke >> beautifier. You edit your code with sloppy indentation, and then bam, >> it reindents for you. > > Really? I wouldn't want that, or find it helpful to type badly for

Re: How an editor can help with block nesting (was Re: How coding in Python is bad for you)

2017-01-24 Thread Steve D'Aprano
On Wed, 25 Jan 2017 08:19 am, Chris Angelico wrote: > I kinda like the idea of showing what the innermost active block > heading is for any given line of code. That would be fairly > straight-forward: scroll up till you find a non-blank line with less > indentation than the one you're on, and put

How an editor can help with block nesting (was Re: How coding in Python is bad for you)

2017-01-24 Thread Chris Angelico
On Wed, Jan 25, 2017 at 6:31 AM, Ben Bacarisse wrote: > 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