News for hackers. Stuff that matters.
Re:Obfuscating “Hello World” in Python by pjc50 on Friday December 19, 2014 @09:38AM (#8772362)
- Cutting and pasting code may change its functionality. Especially from a non-source medium like web pages.

- I find myself fighting my editor's indentation a lot more as a result. Hitting return at the start of a line in the middle of an existing chunk of code indents to the previous line's indentation not the current line's indentation.

- It's asymmetrical: code drifts off to the right as you go down. Together with the editor issue I've taken to inserting a single '#' at points of down-indentation to mark this.

Re:Obfuscating “Hello World” in Python by qzcx on Friday December 19, 2014 @11:53AM (#8773041)
Your first complaint can be easily solved with a good text editor. I use sublime and it will handle whitespace differences when pasting. I haven't had any trouble pulling from webpages. Secondly, it isn't any harder to indent after hitting return than to add a Bracket. Same number of keystrokes and again, a decent editor can fix this problem too. Lastly, this is just a personal preference. Clojure code also drifts right, but its just a matter of training your brain to interpret it.
Re:Obfuscating “Hello World” in Python by jameshart on Friday December 19, 2014 @01:14PM (#8773521)
How can it handle whitespace differences when pasting correctly?

I have a conditional block. I want to paste some code at the end of it. Do I want to paste it inside the condition, so indented the same as the preceding line - or outside the condition,so indented one level less than the preceding line?

With a brace delimited language, if I put the cursor inside or outside the brace and paste, an editor has enough information to correctly indent it. With whitespace delimiting, the editor doesn't have enough information.

Re:Obfuscating “Hello World” in Python by Retra on Friday December 19, 2014 @02:35PM (#8774028)
Those are valid complaints, but they are kind of on the same level as saying "I have to type 'int' to declare an int, what a drag!"
Re:Obfuscating “Hello World” in Python by cmdrfred on Friday December 19, 2014 @07:37PM (#8775385)
I have to click 'indent'? Ugh! I might as well write this in assembly.
Re:Obfuscating “Hello World” in Python by njharman on Friday December 19, 2014 @02:01PM (#8773837)
Not supporting Copy & Paste is a feature.