Not really - A missing bracket is immediately a parsing error.
Mis-indented whitespace is not.
if(err) {
console.log('something bad happened')
recover()
continue()
Immediately throws an unmatched brackets error.
No such luck for
if err
print("something bad happened")
recover()
continue()
now you can spend minutes trying to figure out why continue isn't being called as you expect it to in the success case. It's obvious enough once you open that specific file and see the indentation, but the tooling is no help at all.
I think that's an unfair comparison: in the first example, you have indentation to tell you what the intent was.
With inexperienced programmers like you bring up, if it was mistyped instead:
if(err) {
console.log('something bad happened')
recover()
continue()
I don't believe that compiler syntax error would help one iota (eg. they might just stick } after the continue() to get the compiler to let the code through).
Significant indentation can throw someone for a loop in a very narrow set of copy-paste mistakes (i.e. where pasted code is still indented in a way to pass the syntax checks, since you can't mix and match number of spaces in Python either).
Though having good editor support is crucial for programming.
> You can just as easily make a mistake in bracketing
I actually strongly disagree with this. There's a reason basically every style guide under the sun defaults to requiring brackets for things like single-line conditionals (where they're optional in a lot of languages): It removes this class of error entirely.
There are lots of other ways to fuck things up with brackets, so no arguments there.
> If you're blindly running software that has never been looked at, tested, and even run once to verify it works, the main problem is elsewhere.
I don't think this is really relevant. In this context - the goal of the student isn't to produce good python code, it's to complete the lab they're working on with their partners. The single biggest case I see where this happens is as follows:
1 - Student A writes some code
2 - Student B writes some code
3 - Student A wants to use what student B wrote
4 - Student A copies the code from student B into their file, but the indentation is wrong.
5 - Student A then starts removing indentation (line by line - which is the real mistake, really) and goes one line too far, or one line too short.
6 - Student A and B test one of the cases for the integrated code (either the success or the failure) and it works fine (in my example, imagine they test the error case and see it does what they expect)
7 - Then later they realize the other case is breaking, but they don't know why: usually because it's been half an hour since they pasted that code into their editor, and checking indentation doesn't immediately come to mind.
There is easy to learn and easy to use, they are not always equal.
They shouldn't be copy and pasting between each other if they don't understand how indentation works. Basics first.
A good editor can help. Geany is good for beginners and can show whitespace. I also recommend the tool pyflakes to everyone, beginner and expert alike.
Mis-indented whitespace is not.
Immediately throws an unmatched brackets error.No such luck for
now you can spend minutes trying to figure out why continue isn't being called as you expect it to in the success case. It's obvious enough once you open that specific file and see the indentation, but the tooling is no help at all.