Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Comments

top

Python 3.0 To Be Backwards Incompatible

Verte Re:Can we put in requests? (438 comments)

Ah - a true Python believer, huh? So, you'd rather believe that someone who wants to have the freedom to format their own code is a horrendous coder rather than accept that maybe - just maybe - there are real occasion when deviating from the rigid Python rules might actually ADD to the readability of certain kinds of code.
I don't doubt that there will be occasions when breaking the rules is ok. But there are very few cases. I have not come across such a case. If you do need to break the rules, you're more likely to be doing something silly and need to rethink your design.

If you were writing code for the Linux kernel, say, you'd follow Linus' style guide, which mandates 8-space indents. Now, if your code had more than five levels of indent such as to become unreadable, would you jump up and down about how the style is no good? Not if you actually want to get your code included. You'd recast some of the inner levels into their own functions, and inline them if you like. This makes the code much more readable. If this is ever a bad idea, it will be clear to the reader why you're breaking the rules. But in general, breaking the rules means you need to rethink your design for readability.

I guess we should never split a string across multiple lines or a function either.
What makes you say that? The following ways work great, and are easy enough to follow:
foo(bar,
      baz)
blee = "bl" +\
            "uu"

I guess copying and pasting code from a source that doesn't preserve formatting (like, oh say, a web page or e-mail) has never bitten you because indenting wasn't preserved correctly.
Sure, but you learn quickly :) some forums don't support pre tags, and some (though few) people use horrible email readers that don't preserve the format of text emails, and you learn quickly when that is the case. For email, most code is sent in a .py/.diff/.tar attachment. If you want to mix comments and code in a forum that doesn't support pre-tags, you can write a 3-liner to convert indents to non-breaking spaces, or whatever format system the forum uses.

The rest of us will go on indenting our Perl/C#/Java/Ruby/C++/whaterver code for readability and practicality and leave the the true belivers in the One-Python-Way to their religion.
I've never EVER had someone point me out to anything in PEP-8 that would be better done some other way. If code formatted to PEP-8 is ever unreadable, can you point out what you'd change?

Most people who use Python do use other languages regularly. Many of us write extensions in C/Java/whatever.Net, and many of us enjoy other languages too- I myself use C, Scheme and D daily; but I don't think any of us (who use Python daily, at least) would ever argue that another language would be as easy to read as Python.

more than 6 years ago

Submissions

Verte hasn't submitted any stories.

Journals

Verte has no journal entries.

Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>