News for hackers. Stuff that matters.
Re:Obfuscating “Hello World” in Python by erikb on Friday December 19, 2014 @05:38AM (#8771725)
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.
Re:Obfuscating “Hello World” in Python by ObviousScience on Friday December 19, 2014 @06:25AM (#8771824)
I 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.
Re:Obfuscating “Hello World” in Python by erikb on Saturday December 20, 2014 @05:01AM (#8776279)
Yeah 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.