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

> I know people who wrote code for their thesis in Python but can't grasp why indentation matters.

How can one write code (that runs!) for one's thesis without paying attention to Python's semantically significant whitespace?



> How can one write code (that runs!) for one's thesis without paying attention to Python's semantically significant whitespace?

By fiddling around with different indentations levels till the code works.

So much code out there is written this way.

Kind of gives a new meaning to 'iterating' on one's code doesn't it?


That's exactly my point.

I expect it was, as the other commenter said, probably via an IDE like PyCharm. I never asked because there's no good way to ask a question like that.

But that's my point, people's knowledge is all over the place. It's probably a joke, but it could easily not be.


Perhaps an IDE/editor that autoformats python code?


I am now more than a little embarrassed that this didn't even occur to me...


It doesn't make a whole ton of sense because you'd still need to know when to un-indent in order to get out of a conditional block. IDEs can't read your mind.


I've never asked the details, I just know that they used Python before but couldn't cope with indentation when I worked with them on code.


How did they fail to cope with it?


I had an answer typed up, but it felt like picking on them rather than explaining the issue. Text is hard.

After submitting changes that started 10 indents past the previous line, and had little to no rhyme or reason for subsequent indentation, we asked them to reformat and resubmit. When it became clear that they could not, we reviewed the code itself separately from the indentation and reformatted it ourselves.

Multiple co-workers sat next to them to try to explain how to line things up vertically, but they were unable to do so without said help.

This was over the course of about two weeks in which we were instructed to try to bring them onboard some of our projects. Both our and their projects at the time were frontend web projects.

I have not looked at any of their code outside what was submitted to our side, but I do know they are praised for the quality of their work by management.


Thanks. Interesting.


But they can auto-format copy-pasted code from Stack Overflow.


That's what they want you to think.




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

Search: