Obfuscating “Hello World” in Python
41–50 of 59 posts
Re: Obfuscating “Hello World” in Python
#42Earlier quoted context omitted.
I will never understand the whitespace complaint. Any code you read in python will follow standardized indenting, by necessity. Why on earth is that a problem?
- 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 wit…
Re: Obfuscating “Hello World” in Python
#43"There should be one-- and preferably only one --obvious way to do it."
BTW my intuition say turing completness require that there are many ways to do it, for at least some values of "it", but I can't proove it.
Re: Obfuscating “Hello World” in Python
#44Earlier quoted context omitted.
- 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 wit…
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 ri…
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
#45Earlier quoted context omitted.
I will never understand the whitespace complaint. Any code you read in python will follow standardized indenting, by necessity. Why on earth is that a problem?
- 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 wit…
Re: Obfuscating “Hello World” in Python
#46"There should be one-- and preferably only one --obvious way to do it."
I don't think this counts as "obvious". BTW my intuition say turing completness require that there are many ways to do it, for at least some values of "it", but I can't proove it.
Re: Obfuscating “Hello World” in Python
#47Earlier quoted context omitted.
I will never understand the whitespace complaint. Any code you read in python will follow standardized indenting, by necessity. Why on earth is that a problem?
Personally I don't care, although copy-pasting Python can be annoying. If your biggest concern with any general-purpose programming language is its syntax, you have probably not put enough thought into semantics issues - the ones that persist no matter how familiar the syntax becomes. Anyway, Walter Bright, designer of D language, wrote an article on language design [1] touching on the issue: > Yes, the grammar shoul…
"The syntax is terse" doesn't help if the libraries aren't. We want libraries and common concepts to be terse. That's why I feel that any language designed without heavy consideration for how it's standard libraries are to be used is a regressive exercise. Write your libraries how you want them to be used, then figure out the syntax from that.
Re: Obfuscating “Hello World” in Python
#48Re: Obfuscating “Hello World” in Python
#49I still have problems fathoming how Python managed to get such a big mindshare within the developer community with its icky syntax and forced use of whitespace. What makes it good? I have looked into the alternatives and they all seem to be better.
I use it (full-time for 8 years) because of the syntax and the forced use of white space. The language encourages people to write better and more maintainable code. Out of interest, what language are you using that you prefer the syntax of? Python is notoriously similar to pseudocode, and I can't think of a mainstream language (other than Ruby) that even seems to care about syntax.
Python lowers the barrier to entry for programming. Nowadays lots of business analyst types and such are getting into programming because of Python. As a result I have seen some horrendous looking Python code out there which performs quite poorly.
Re: Obfuscating “Hello World” in Python
#50Earlier quoted context omitted.
I will never understand the whitespace complaint. Any code you read in python will follow standardized indenting, by necessity. Why on earth is that a problem?
- 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 wit…