Hacker News new | past | comments | ask | show | jobs | submit login

Yesterday I had to explain to my 9-year-old daughter that the bug in her Python script was due to the fact that she indented with a tab and not four spaces. Trying to publish her program so that her friends could use it was a nightmare (it's a console app).

It's 2015 and we have the brightest minds working on this stuff and it's all shit.




There are linters to handle syntax issues like tabs for spaces. Furthermore every text editor I've ever used has supported automatic handling of tabs/spaces and how many to indent.

Not sure on publishing but maybe try packaging it properly (I believe python apps can be wrapped into .exe files) and putting the package into something like dropbox folder?

It's 2015 and these problems are solved already.


Linters

I take back "brightest minds"


Why?


it's 2015 and you're still using the wrong editor


That there are right and wrong editors for Python is exactly the point. A 9-year-old could understand BASIC 30 years ago without having to worry about choosing the "right" editor to handle different types of blank space.


What? He doesn't even mention anywhere in his comment what editor he is using


And he didn't need to, any editor that mixes space indents with tabs is the wrong editor.


Untrue - start editing a file in a tabs editor, download a snippet from the internet that has spaces in it, and voila - you've screwed up your file.

And this happens all the time to professional developers, much less 9-year-old beginners.


All is needed is to have editor that can show white spaces (i.e. show tabs differently than spaces, after all those are two different characters).

With that the whole issue with tabs and spaces no longer exists.

BTW if you are copying snippets of code from website "as is" in any language you will have to reformat it to fit your structure. Also if you copy code so often that this is becoming an issue I'm not sure I would want someone like that working for me.


> Also if you copy code so often that this is becoming an issue I'm not sure I would want someone like that working for me.

This seems like a cruel comment in a thread specifically talking about a 9-year-old learning her first language.


Sublime Text's Anaconda will complain about tabs / spaces mismatch.


It's the wrong one if it doesn't convert tabs to spaces.


Doesn't exposing a 9-year old to Python register as child abuse?




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

Search: