Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've taught Python for beginners for many years. I've had zero problems with the significant whitespace.

JavaScript syntax is outright bizarre compared to Python. Care to share your slides teaching the semicolon rules, four or so different scopings, the damn "new", type coercions and so on to learners?

Javascript has mostly nicer semantics, but buried deep in ugly pile of mess. And CPython is a disgrace.



My “problems” with semantic white space are more along the lines of “oh, well, this is clearly unintuitive or is creating small errors”. It’s also one of the most persistent thing that learners will forget, even the good ones, when writing their own code. Defining a class method, and then indenting back to the original scope has some degree of cognitive overhead that simply enclosing things in typical c-like lexicon, i.e. with the interpreter noting brackets and not white space, doesn’t have.

As for teaching JavaScript’s pain points... that’s not really how I operate. I’d rather they know the general rules and come across edge-cases when they’re in a position to solve them, rather than overload them with information. Automatic semi-colon insertion is powerful enough to get you through several large-scale projects, so there’s essentially no point to discuss it prematurely as anything but a curiosity, “this could be a gotcha, so keep your code clean”.

Finally, comparing the error linters in VSC for Python versus javascript, especially if you //@ts-check... I think JavaScript actually does a better job.


Maybe people perceive code/indentation differently. For me there's nothing unintuitive about semantic whitespace. I don't really even see braces or other block delimiters when reading a language with those (although lisps' parenthesis mess is just too in your face...), and more easily tripped by mismatching indentation and delimiters. Maybe some people have harder time seeing the relative indentation? Does an editor showing the levels with e.g. vertical lines help with this?

I have hard time understanding how changing the indent has somehow more overhead. Even with dead-simple automation where the current indentation level is kept for a new line the blocking is literally controlled with just backspace, tab and enter (space indenters and their enablers shall rot in hell).

Braces are also awkward to type with many keyboard layouts. Once you get used to it it's not much of a problem, but for beginners in can be an annoyance distracting from the actual programming.

Javascript quirks are so prevalent that you're bound to encounter them even in the very beginning. E.g. in comparison operators or accidentally assigning to global scope.

I don't use linters and haven't really felt the need. Heavy use of linters tends to be caused by bad language design and/or obsessing over pointless cosmetics.


I think that people do indeed have a harder time perceiving the physical structure of the code, especially if they’re not spatially oriented as thinkers, e.g. myself, I’m a Linguistics person first and foremost, not very good at spatial reasoning.

You should really consider using linters as a teaching aid. They help a lot, and would indeed catch the problem you noted about js.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: