Announcing: Slashdot Deals - Explore geek apps, games, gadgets and more. (what is this?)

Thank you!

We are sorry to see you leave - Beta is different and we value the time you took to try it out. Before you decide to go, please take a look at some value-adds for Beta and learn more about it. Thank you for reading Slashdot, and for making the site better!



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:
blee = "bl" +\

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


Verte hasn't submitted any stories.


Verte has no journal entries.

Slashdot Login

Need an Account?

Forgot your password?