4 ms·
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. Tr
by david927 11y ago
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.
- JupiterMoon 11y agoThere 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.
- david927 11y agoLinters I take back "brightest minds"
- JupiterMoon 11y agoWhy?
- anentropic 11y agoit's 2015 and you're still using the wrong editor
- moistgorilla 11y agoWhat? He doesn't even mention anywhere in his comment what editor he is using
- orf 11y agoAnd he didn't need to, any editor that mixes space indents with tabs is the wrong editor.
- edanm 11y agoUntrue - 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.
- pmalynin 11y agoSublime Text's Anaconda will complain about tabs / spaces mismatch.
- takeda 11y agoAll 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.
- JadeNB 11y ago> 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.
- task_queue 11y agoIt's the wrong one if it doesn't convert tabs to spaces.
- makeset 11y agoThat 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.
- toolslive 11y agoDoesn't exposing a 9-year old to Python register as child abuse?