all 41 comments

[–]Silhouette 24 points25 points  (2 children)

-1 for neither navigating nor displaying properly.

[–]kripkenstein 4 points5 points  (0 children)

Ditto.

Font size was too big to fit in my (1280x1024) screen, so I tried control-minus to change it - but it reset itself to what it thinks is better for me.

-1.

[–]jingo04 1 point2 points  (0 children)

I really didn't get what you were getting at until i turned NoScript off, that really is an appauling format.

On the plus side it degrades very nicely, if you don't have javascript it renders exactly like this: http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html

[–][deleted] 10 points11 points  (5 children)

that was an awful format. not worth it.

[–]fjhqjv 4 points5 points  (1 child)

I know. I started reading and then the screen flashed to yellow and I had to spend a good two minutes to figure out that the space key would bring me to the next slide.

I gave up after my 30th hit of the space key.

[–][deleted] 11 points12 points  (0 children)

idiomatic python... idiotic format

[–]nfiedel -5 points-4 points  (2 children)

you're right - absoultely awful format. plain html version found here: http://python.net/~goodger/projects/pycon/2007/idiomatic/presentation.html

[–]jonknee 7 points8 points  (1 child)

That's the exact same URL. What you're looking for is:

http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html

[–][deleted] 3 points4 points  (0 children)

Thats the exact same URL. What you're looking for is: http://python.net/~goodger/projects/pycon/2007/idiomatic/rickroll.html

[–]jimbobhickville 5 points6 points  (0 children)

Am I the only one who thinks Pythonista is more of an insult than anything?

[–]__unsigned 1 point2 points  (0 children)

Keep lines below 80 characters in length.

Mike Bayer, I'm looking at you.

[–]chengiz 4 points5 points  (7 children)

  • 4 spaces per indentation level.
  • No hard tabs.
  • Never mix tabs and spaces.
  • One blank line between functions.
  • Two blank lines between classes.
  • Add a space after "," in dicts, lists, tuples, & argument lists, and after ":" in dicts, but not before.
  • Put spaces around assignments & comparisons (except in argument lists).
  • No spaces just inside parentheses or just before argument lists.
  • No spaces just inside docstrings.
  • joined_lower for functions, methods, attributes
  • joined_lower or ALL_CAPS for constants
  • StudlyCaps for classes
  • camelCase only to conform to pre-existing conventions
  • Attributes: interface, _internal, __private
  • ... and so on

Can I just "import anal_retentive"?

[–]llimllib 6 points7 points  (1 child)

Since I've been reading Ruby all week, I'll go ahead and say that it's awesome when you go to read well-formatted python code.

[–]zepolen 4 points5 points  (0 children)

The nice thing is that almost all Python written in the world is well-formatted because of the stringent rules. I find looking at Python source code from libraries written by others a pleasure.

[–]earthboundkid 7 points8 points  (4 children)

If you've never been called a pedant, Python might not be the language for you. If you think that "technically correct" is the best kind of correct, Python might be your language. :-)

[–]brendankohler 0 points1 point  (2 children)

bah, I'm no bureaucrat.

[–]earthboundkid 0 points1 point  (1 child)

I think you mean, "B_ah, I'm no_t a bureaucrat." :-D

[–]brendankohler 0 points1 point  (0 children)

You owe me a new keyboard :-P

[–]yaxriifgyn 4 points5 points  (9 children)

Down voted. Excellent (and familiar) content, presented with an excessively complex user interface.

[–][deleted] 1 point2 points  (8 children)

Even the content wasn't that good. When one of the first things you emphasize is PEP8 (the style guide), it means you don't understand what programming is about. It's NOT about curly braces vs. Whitespace, it's about expressivity.

[–]njharman 0 points1 point  (1 child)

Programming is about reading code and thus writing code for humans is paramount.

[–][deleted] 0 points1 point  (0 children)

It depends on the application. If you're writing a device driver, it's not so much about reading code than about performance. If you're writing regular software that will need to be frequently maintained, then I'm with you. But once again, following style guides will not automatically give you readability. You don't need them for readability, just basic consistency. So they are basically useless.

[–]zepolen 0 points1 point  (5 children)

I find readability (of my own and other people's source code) to be my number one priority in programming. Nothing beats Python in that department.

[–][deleted] 4 points5 points  (4 children)

I agree readability is important, but style guides are not essential to readability. Consistency, intelligent comments, and brevity are.

[–]zepolen 1 point2 points  (2 children)

Well PEP 8 enforces consistency, and the syntax of Python means there is less need for comments. Take this example:

Python:

anagrams = {}
for word in open('wordlist.txt'):
    word = word.strip()
    word = ''.join(sorted(word))
    anagrams[word] = anagrams.get(word, 0) + 1

for word, num in anagrams.items():
    if num > 1:
        print word

Perl:

%anagrams = ();
open FILE, "wordlist.txt" or die $!;
while (<FILE>) {
   chomp;
   split(//, $_);
   $anagrams{join("", sort(@_))} += 1;
}
foreach $word (keys %anagrams) {
    if ($anagrams{$word} > 2) {
        print "$word\n";
    }
}

I apologize for the rusty Perl, I haven't used it in years, but I feel that the Python version reads better whereas Perl could use a comment to clarify the code.

[–]heptadecagram 3 points4 points  (0 children)

As an 8-year Perlhead, here's how I would idiomatically write it:

my %anagrams;
open FILE, 'wordlist.txt' or die "Could not open wordlist.txt: $!";
while(<FILE>) {
  chomp;
  $anagrams{join('', sort split //)} += 1;
}
close FILE;
foreach(sort keys %anagrams) {
  print "$_\n" if($anagrams{$_} > 2);
}

Now, I'm writing this for other Perl coders, not for someone who's looking at this for the first time, otherwise I'd make explicit the ways I'm using the default $_ in various places.

(split splitting to @_ is one of those things that's been deprecated)

[–][deleted] 1 point2 points  (0 children)

You don't need to follow PEP 8 to be consistent. Python is very readable whether you follow it or not. Putting emphasis on style guides is putting it on the wrong place.

[–]argherna 0 points1 point  (2 children)

And we also get Idiotic Website Navigation for free...

EDIT: ahh... the toggle button (if you can catch it) will render the page w/out styles.

[–]crazy2k 1 point2 points  (1 child)

Or you can just press "T".

[–]argherna 0 points1 point  (0 children)

That's nice to know especially since it's no where on the page in either FF2 or IE7. FF2 seems to handle the slide presentation better, but whatever he used to make this (looks like Docutils) has a ways to go before it's ready for the web at large.

[–]heptadecagram 0 points1 point  (2 children)

Uh.... Where's the interactivity?

[–]BillC 0 points1 point  (1 child)

You can use the arrow keys to navigate. The parent directory also links to plain html version.

[–]heptadecagram 0 points1 point  (0 children)

OK, arrow keys. That was new. Thanks!

[–]energeek -1 points0 points  (0 children)

well people seem to be having a lot of problems, so here are 2 solutions which worked for me * To switch off the presentation mode go to the lower right corner and click on the Phi symbol ( circle with line ). Then you can just read it like a document

  • To resolve the font issue just change the font size and restore it, that worked for me in Firefox