3 ms·
Yeah, I also don't get that. My Python code even has the same indentation as my Java code in university had. I just don't have to spell out the ; and the {}. Bu
by erikb 12y ago
Yeah, I also don't get that. My Python code even has the same indentation as my Java code in university had. I just don't have to spell out the ; and the {}. But in the beginning it was really tough, especially because my eyes were trained to structuring code by {}. I think it's mostly a question about if you want to put in the effort to retrain your instincts or not.
- ObviousScience 12y agoI prefer having to add the {}'s and ;'s, even if the spacing is the same, because they provide a clear and definite bound on scoping, which (unfortunately) often gets messed up in Python.
- erikb 12y agoYeah that's pretty much what I also experienced. You won't get into that trouble that often, though, after you have trained yourself to the Python look. There are some quite tough problems where I really need to think if I put a line into an if block or not, but that the kind of trouble you have for logical reasons not because of having {} or not. I work full time on a Python project and I can't remember a single instance where I "misclicked" a line into or out of a block.