Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 internet speed test! ×

Comment Re:Can we put in requests? (Score 1) 438

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.

Submission + - The Java Popup you Can't Stop (hackademix.net) 1

An anonymous reader writes: In his brand new hackademix.net blog, Giorgio Maone, known as the author of the NoScript security extension for Firefox, reveals how popup blockers can be easily circumvented using Java. Worse, popups opened this way are really evil, because they can be sized to cover the whole desktop (the wet dream of any phisher) and cannot be closed by user (the wet dream of any web advertiser).

Impressive demos available, all cross-browser and cross-platform, in the best Java tradition: "Write once, hack anywhere" (WOHA).

Slashdot Top Deals

"Luke, I'm yer father, eh. Come over to the dark side, you hoser." -- Dave Thomas, "Strange Brew"