4 ms·
Assume you've never programmed before. Would you want to debug a program that has a significant whitespace bug? It's much easier for the average person to spot
by malandrew 15y ago
Assume you've never programmed before. Would you want to debug a program that has a significant whitespace bug? It's much easier for the average person to spot an unbalanced parenthesis that an incorrectly sized whitespace.
Getting stuck and being frustrated hurts motivation a lot.
Now curly brackets and syntax may be seen by a person as an irritation or inconvenience compared to whitespace, but I'd say it's better to use a language with an inconvenience than one which is more likely to leave you stuck.
You, I and others used to programming with insignificant whitespace have developed and eye for detail and can rapidly spot a whitespace but. The general population with no programming experience can't consistently space most of the documents in their life, but they can typically place periods correctly.
- dextorious 15y ago"""Assume you've never programmed before. Would you want to debug a program that has a significant whitespace bug? It's much easier for the average person to spot an unbalanced parenthesis that an incorrectly sized whitespace.""" I'd argue that for a beginner it's equally difficult. And how about this equally difficult to spot classic bug: if (f==x) do_something() and_also_do_this() //oops! a language with significant whitespace does not permit it. It gets people using the correct indentation levels from the start, whay they should have used anyway in any language, even one where whitespace doesn't matter. I propose we don't talk about languages with "significant whitespace", but instead about "languages with proper indentation enforced".
- chimeracoder 15y ago> I propose we don't talk about languages with "significant whitespace", but instead about "languages with proper indentation enforced". Yes, 'significant whitespace' is too sweeping a term to be useful. I've heard people complain about Python's 'significant whitespace' until they realize that it uses basically the exact same whitespace rules as Java does, except with sensible indentation rules instead of braces. http://www.secnetix.de/olli/Python/block_indentation.hawk http://www.secnetix.de/olli/Python/block_indentation.hawk
- melling 15y agoWhy is this hard to catch? Format your code and the incorrect indentation goes away. A beginner should be taught to run the formatter to keep the code neat.
- malandrew 15y agoWhat language is that snippet supposed to be in?
- zephyrfalcon 15y ago""" It's much easier for the average person to spot an unbalanced parenthesis that an incorrectly sized whitespace.""" Is it? Assuming you use a fixed-width font, any incorrect/inconsistent indentation should stand out like a sore thumb. More so than counting { }s in nested blocks. (Of course, decent editors help with both cases, so I think it's essentially a non-issue.)
- malandrew 15y agoYou've never run into problems with hard spaces vs soft spaces vs tabs? Visually they look the same, but finding those problems is a pain.