Slashdot Mirror


Foundations of Python Network Programming

Sarusa writes "This may be the easiest book review I've ever written. If you program in Python and you want to write Internet applications, go buy Foundations of Python Network Programming by John Goerzen. There. What, you wanted more? Well, okay, but then I'm back to playing Katamari Damacy." Read on for the rest of Sarusa's review. Foundations of Python Network Programming author John Goerzen pages 500 publisher Apress rating 9 of 10 reviewer Sarusa ISBN 1590593715 summary If you program in Python, and you want to write Internet applications, you need this book.

First of all, 'Network' means 'Internet.' Everything in the book concerns protocols running over IP, which is almost anything useful these days. That said, this is a lot of ground to cover -- there's FTP, HTTP, POP3, IMAP, DNS, a veritable explosion of acronyms, and this book does a great job of hitting all the ones you're likely to need.

Foundations assumes you already know Python, but nothing about network programming. The first 100 pages covers the basics of IP, TCP, UDP, sockets and ports, server vs. daemon, clients, DNS, and more advanced topics like broadcast and IPv6. And in case you already know all that, how Python deals with them. This is the only part of the book you will probably read in order. After that you pick what you need.

Find a topic you need to know how to deal with, such as using XML-RPC, and locate the appropriate section of the book. There he'll cover the basics of the topic, show you how to use the correct Python module(s) to implement it, explain any gotchas (this is key!), and write a short but functional application or two that uses it. I'm not sure why this book isn't called 'Practical Python Network Programming.' It's eminently Practical. It won't make your heart race, but it tells you exactly what you need to get the job done.

All this information is out there to find for free, but having it all collected and summarized is worth every penny. And the real value is having the edge conditions and not-so-obvious practical details explained by someone who's obviously used this stuff in the field. Python and its excellent libraries make Internet tasks relatively easy, but it's even easier with some expert help, and the libraries assume you already know what you're trying to do. For example, if you're doing a DNS.Request() record query and using a DNS.Type.ANY, it (for good reason) returns information cached by your local servers, which may be incomplete. If you really need all the records you need to skip your local servers and issue a query to the name server for the domain. This is isn't hard; you just have to know what's going on. Or do you know which exceptions can get raised if you're using urllib to fetch web pages? It's here. Exception handling is not neglected.

So you know what you're getting, here's a laundry list of topics: IP, TCP, UDP, sockets, timeouts, network data formats, inetd/xinetd, syslog, DNS, IPv6, broadcast, binding to specific addresses, poll and select, writing a web client, SSL, parsing HTML and XHTML, XML and XML-RPC, email composition and decoding, MIME, SMTP, POP, IMAP, FTP, MySQL/PostgreSQL/zxJDBC (though you won't learn SQL), HTTP and XML-RPC servers, CGI, and mod_python. As a bonus you get some chapters on forking and threading (for writing servers) and handling asynchronous communication in general.

Just to find something to complain about churlishly, I wish Goerzen had managed to do all this and make it scintillatingly brilliant and witty from cover to cover (all 500 pages); perhaps dropping juicy bon mots of gossip from the Debian project. And while I'm at it I'd like a pony. No, seriously. If you program in Python, intend to do anything Internet related, and aren't already a Python networking god, you need Foundations of Python Network Programming. In terms of 'hours I could have saved if only I had this book sooner' it would have paid for itself many times over.

You can purchase Foundations of Python Network Programming from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

144 comments

  1. Amazon by RangerRick98 · · Score: 2, Informative

    The book is cheaper through Amazon

    --
    "You're older than you've ever been, and now you're even older."
    1. Re:Amazon by justMichael · · Score: 4, Informative

      Or you could actually shop around or go to bookpool, where it is $28.50 they don't show up on all book stores.

      -- Sex Toys...

    2. Re:Amazon by Ignignot · · Score: 0, Flamebait

      Isn't it nice that you get a nice referrer bonus in that link? Nice.

      --
      I submitted this story last night, and it didn't get posted.
    3. Re:Amazon by Anonymous Coward · · Score: 0

      The review author did with bn.com as well

    4. Re:Amazon by Chrax · · Score: 5, Insightful

      Why not? It doesn't cost you a thing and so if you're going to be buying the book through Amazon, why not let him shave a little off the top. Are you really worried Amazon's losing money, or is this some dumb shit about him selling out? Who cares?

    5. Re:Amazon by Anonymous Coward · · Score: 0, Flamebait



      People at Slashdot bitch and moan about lawsuit happy bastards like SCO and the RIAA. But then happily use amazon.com (lawsuit happy bastards) and Apple (lawsuit happy bastards) computers. The correct term for this is hypocrisy.

      Fuck SCO. Fuck the RIAA. Fuck amazon.com. And most of all fuck Apple.

    6. Re:Amazon by Anonymous Coward · · Score: 0

      What about microsoft?

    7. Re:Amazon by Chrax · · Score: 4, Insightful

      Because Apple doesn't make damn good computers and amazon doesn't provide a service that allows people from anywhere to get pretty much any book. Good call. We, in general, don't like Sco because Sco is trying to make money by exploiting Linux (and doesn't really do much else), which is one of the greatest triumphs of free software/open source. We don't like the RIAA because they (at least attempt to) infringe upon fair use. It's not because they're sue-happy that they've caught the ire of many slashdotters. If that were the only criterion half of the United States alone would be the subject of slashdot rage. I don't know of Apple or amazon.com trying to keep me from doing something I want or pay for something that should be free, so I'm not all that fussed.

    8. Re:Amazon by Anonymous Coward · · Score: 0

      "Informative" I can see, "Overrated" I can see, but could someone explain how his post is rated "Redundant" when I don't see any other posts with the same information?

      Also, how's he getting a referrer bonus? I've never even heard of that, though I'll admit I don't shop Amazon often.

    9. Re:Amazon by Chrax · · Score: 1

      If you sign up as an Amazon affiliate, you can make money off any purchases people make if they get there using your refer link.

    10. Re:Amazon by pclminion · · Score: 1, Offtopic
      Jesus, what's the big deal with a guy making a buck? It's on topic, and it doesn't cost you anything.

      If he really wanted to be an ass, he could have hidden it behind a meta redirect. But he didn't. If you want to be all morally hoity-toity about it, that's your prerogative.

      Oh and by the way, I can smell your patchouli.

    11. Re:Amazon by Anonymous Coward · · Score: 0

      Okay, can you please explain again how it was redundant?

    12. Re:Amazon by vep · · Score: 1

      even cheaper at overstock and walmart via shopping.com

    13. Re:Amazon by Night+Goat · · Score: 1

      Put your sig in the sig box rather than in the body of your message. I shut those off for a reason.

    14. Re:Amazon by Anonymous Coward · · Score: 1, Insightful

      don't know of Apple or amazon.com trying to keep me from doing something I want or pay for something that should be free

      Try starting a small company that makes Apple clone hardware and see if Apple keeps you from doing something that you want.

    15. Re:Amazon by Anonymous Coward · · Score: 1, Insightful

      I don't know of Apple or amazon.com trying to keep me from doing something I want or pay for something that should be free, so I'm not all that fussed.

      Unless of course you want to use something like an affiliate program or 1-click ordering, which Amazon has patented.

      Amazon is still on my shitlist, but the great thing about the internet is you can "shop" at amazon and then click-click, buy your book somewhere else, with a clear conscience.

    16. Re:Amazon by aussie_a · · Score: 1

      If someone doesn't like a post they give it negative mod points, it doesn't matter how they mod it, as long as it's modded in a negative manner. Troll, Off-topic and Redundant are all used in this manner.

      Welcome to slashdot, you must be new here.

    17. Re:Amazon by Pandora's+Vox · · Score: 1

      NightGoat has solved a mystery for me... I emailed you guys (secondnirvana) a while ago about changing your "go away youngins" link to scarleteen. and you did! yay! I just happened upon the email I got back from you a few days ago and was wondering where i'd seen it. I guess it was on here :-)

      -Leigh

    18. Re:Amazon by Anonymous Coward · · Score: 0

      Why give the money to him though? If you really want to give money to someone, you might as go with a charity. It's also fucking annoying that this shit crops up on every single book review on Slashdot.

    19. Re:Amazon by yerfatma · · Score: 1
      And most of all fuck Apple.

      And all along I that was a worm poking out of it. The good news is it must still be edible.

    20. Re:Amazon by yerfatma · · Score: 1
      Try starting a small company that makes Apple clone hardware

      Well, you'd have to want to do that first. If you're looking for a customer base of hippies who are tight with a buck, why not build sailboats?

  2. Twisted Framework by BridgeBum · · Score: 4, Interesting

    Another good Python network resource: Twisted Matrix, a networking framework for Python.

    For those interested in starting in network programming in Python, I'd recommend checking it out.

    --
    My UID is the product of 2 primes.
    1. Re:Twisted Framework by otisg · · Score: 1

      I'm familiar with the Twisted Framework (TF), and was about to ask: does this book cover TF? TF is quite nice, but if I remember correctly, it's quite a bit piece of software, and has a steep learning curve. Does this book go over TF or just 'raw' network programming with Py?

      --
      Simpy
    2. Re:Twisted Framework by Phoukka · · Score: 5, Informative

      The book makes extensive use of Twisted in covering IMAP programming, and also in its exploration of how to design a server, specifically the asynchronous, call-back approach. It does not cover the entirety of Twisted, that would be a book all to itself.

      The bonus to Mr. Goerzen's use of Twisted in IMAP is that I came away with a much better understanding of how to use Twisted generally -- I grokked Deferreds for the first time. And I'd read all (ALL) the Twisted documentation I could get my hands on prior to that. That probably gave me the proper background, but the book really kicked in to place those final pieces necessary to get what was going on in Twisted.

      The book doesn't just cover "raw" network programming, but covers multiple domain-specific areas and points you to the best libraries and modules to use for the area.

      Good stuff, I highly recommend the book.

    3. Re:Twisted Framework by loginx · · Score: 1

      Whoever makes an actual book about twisted (a good one), let me know and I'll buy it.

      I've been hoping for someone to do this for a long time... Not very likely to happen though...

      The documentation is huge and pretty good but it just doesn't cut it for me...

  3. Typos by 2.7182 · · Score: 5, Informative

    I liked this book a lot, but there are an awful lot of annoying typos. Also my binding broke after a week.

    1. Re:Typos by Phoukka · · Score: 2, Informative

      There are a fair number of typos, mainly in the text from what I saw. All the code looks good (though I haven't tested it all). It seems to me that John Goerzen made sure the code all worked, and wrote the text around it, maybe before it. Unfortunately, it looks like it was rushed to meet a deadline at some point, and the text did not get reviewed and edited as thoroughly as it might have needed.

      On the other hand, the content is excellent, truly a good book. And so far, my binding hasn't broken, FWIW. But it was stiff, and doesn't want to lay flat on its own.

    2. Re:Typos by legirons · · Score: 3, Interesting

      "Also my binding broke after a week"

      As practicalities go, the one thing I really liked about the last APress book I got ('Dive into Python') was that when I wanted to refer to it at work, I didn't have to carry the book in, I just read the section I wanted on their website.

      It was one of those "never going to buy another book without this facility" moments... how could we have missed something so useful for so long?

      So back on topic, this book only has one chapter available for download, and it's in PDF rather than anything useful, so I guess it's not general policy to make all APress books downloadable.

      I did find it amusing how Visual Basic, C#, and .NET each get their own top-level section at the APress website, while PHP, Perl and Python are down in the "Open-Source" section next to books describing products (Apache, Linux, Plone, MySQL, etc.)

    3. Re:Typos by Anonymous Coward · · Score: 0

      "Also my binding broke after a week"

      As practicalities go, the one thing I really liked about the last APress book I got ('Dive into Python') was that when I wanted to refer to it at work, I didn't have to carry the book in, I just read the section I wanted

      Isn`t that just what a broken binding allows???

      on their website.

      Oh.. right...(Insert joke about a bind breaking in a IP networking book)

  4. Look, I program in Perl by The+Ape+With+No+Name · · Score: 1, Interesting

    And I see no need to switch to Python. My question is: How easy is it to wrap your code in a library/module and call it your own so you can call it your way? When I tried Python, my first impression was that this was a really readable and relatively easy language to program in, but it just wasn't a Swiss-Army chain saw. You were doing things over and reinventing the wheel all the time. This might have been just me. I admit to being a bigot and a classic pig-headed perl person, but with the nightmare that is Perl6 on the horizon, I need to start considering alternatives.

    --
    Comparing it to Windows will be a moot point, since El Dorado is going to have a 40% larger code base than XP.
    1. Re:Look, I program in Perl by kevin_conaway · · Score: 4, Interesting

      I learned perl before I learned python and I found that the OOP constructs in python were better than perl. In perl they just feel bolted on while in python, they are built in from the ground up. Other than that, not much difference in my opinion

    2. Re:Look, I program in Perl by Anonymous Coward · · Score: 0

      Also I really like how functions are first class objects (meaning you can pass them to/return them from functions)

    3. Re:Look, I program in Perl by ultrabot · · Score: 4, Interesting

      Also I really like how functions are first class objects (meaning you can pass them to/return them from functions)

      And classes too. What's more, a class is just a callable object that is called exactly like a function - "C()" - and it returns an instance of that class. If a function wants a class for instantiation, you can just pass a factory function that returns some instance of any class.

      --
      Save your wrists today - switch to Dvorak
    4. Re:Look, I program in Perl by Quixotic137 · · Score: 4, Informative

      Put your code in a file called MyModule.py. Then you can use it just like modules in the standard library:

      import MyModule
      MyModule.SomeFunction()

      Or:

      from MyModule import *
      SomeFunction()

    5. Re:Look, I program in Perl by pavon · · Score: 1

      Do you want to call modules you wrote from a python program? Or do you want to call python modules from perl. For the latter look no farther than cpan

      For the former, first check out the python package index , which is the equivelent of CPAN to see if someone else has created a relevant package. If not, creating a python module from C code from python is easy . As far as calling perl modules from python, that is one of the things Parrot is intended to do, so your savior will come with the apoclypse.

    6. Re:Look, I program in Perl by pnatural · · Score: 4, Interesting

      Also I really like how functions are first class objects (meaning you can pass them to/return them from functions)

      And classes too.


      Yes, absolutely. First-class functions and types is one of the most important hallmarks of a good, usable language. Not being able to pass around classes or functions would severely limit how most of my solution sets are defined. Personally, I won't consider languages that don't offer this.

    7. Re:Look, I program in Perl by nosferatu-man · · Score: 1

      Which you can do in Perl, too, although the syntax is typically gross.

      --
      To spur "enterprise Linux," Big Bang, the distributed two-phase commit.
    8. Re:Look, I program in Perl by randall_burns · · Score: 2, Insightful

      Python isn't a Swiss Army Chain saw-more like a table saw. Both Python and Perl have their place. I've used Perl happily when doing my own projects-but I've found that Python is _much_ easier to adapt newbies to using-and much easier for process oriented managers to deal with who otherwise might consider Java. I have personally seen older Cobol programmer who were utterly intimidated by VB,Java and other newer languages look and Python and relate easily to Python.

    9. Re:Look, I program in Perl by Anonymous Coward · · Score: 0

      > For the former, first check out the python package index , which is the equivelent of CPAN to see if someone else has created a relevant package.

      Until someone writes a PyPI client that can search, download, build, and install PyPI packages from any of a number of mirrors, it's not even close to CPAN.

      Yes, this does make a difference.

    10. Re:Look, I program in Perl by killjoe · · Score: 1

      One word for ya. RUBY.

      --
      evil is as evil does
    11. Re:Look, I program in Perl by killjoe · · Score: 2, Insightful

      Regardless of the merits of the languages I think you'll severely miss CPAN if you switch to python. CPAN is the best thing about perl and python has nothing really like it. There are a couple of so called repositories but they don't hold a candle to CPAN.

      --
      evil is as evil does
    12. Re:Look, I program in Perl by loginx · · Score: 1

      You can also embed perl and use pretty much any perl module from python through PyPerl...
      http://www.python.org/moin/PyPerl

    13. Re:Look, I program in Perl by Anonymous Coward · · Score: 0
      I am a firm believer in using the right tool for the job. I have written a lot of code in Python, such as OfflineIMAP and PyGopherd. I also use OCaml (and have a utility library for it) and Haskell (and have a utility library for it too).

      For experienced programmers, learning a new language is not hard, especially if it is similar to what you already know. Python is similar to what you already know.

      Any given problem could likely be solved in almost any given modern language. I could write an IMAP client in C, a Web server in Java, or a database client in C++.

      In Python, you can write correct solutions to many network-related problems with astonishingly little code. And by correct, I mean with error detection everywhere (and handling where appropriate), safe handling of strings (not an issue in Python usually, but a constant problem in C), no deadlock conditions, etc. And what's more, those solutions are usually readable. There are some examples in the book of that. There's a simple FTP mirroring example in the book. 75 lines of code (excluding blank lines).

      Now, I could have written it in C, Perl, Haskell, OCaml, Java, Lisp, Pascal, whatever. That's absolutely true. Most of those would not have let me do it in 75 lines of readable code using solely a component that comes out of the box with the language.

      Sometimes, the time it takes you to learn a new language and develop a correct, effective solution in that language is less than the time it takes you to develop an incorrect solution in another. Sometimes not, and it's better to stick to the language you know. My point is that you should not always assume this is best.

      How about another example. A little keyboard interaction program. Compare:

      Python:

      from sys import stdin
      print "Who are you?"
      name = stdin.readline().strip()
      print "I'm glad to meet you, %s." % name

      Haskell:

      main = interact ((++) "Who are you?\n" .
      (++) "I'm glad to meet you, " .
      ((++) `flip` ".\n") . head . lines )

      Java:

      import java.io.*;

      class Hello {
      public static void main (String[] args) throws IOException {
      BufferedReader ki = new BufferedReader(new
      InputStreamReader(System.in));

      System.out.println("Who are you?");
      String name = ki.readLine();
      System.out.println("I'm glad to meet you, " + name + ".");
      }
      }

      Which do you think makes it easiest to interact with the user? I'd have to give the award to Python or Haskell. The Haskell example is a very different one from what you may be used to (hint: ++ is the concatenation operator), as it relies on the lazy and functional nature of the language, but it nonetheless is a concept that scales to incredibly powerful things.

      Don't limit yourself by what language you prefer. Prefer a language by what problem you must solve.

      (Sorry, it looks like /. stripped the indentation from these examples)

    14. Re:Look, I program in Perl by Anonymous Coward · · Score: 0

      Perl:
      print "Who are you? ";
      $name = ;
      chomp $name;
      print "I'm glad to meet you $name.\n";

      Yeah, just so terribly hard to read isn't it? *snicker* And the $ token on the scalar variable is so hard to understand, like even BASIC used it it so hard. *lol* No I'm not laughing at you, but the guy a few threads ago who said that python is better becaue it makes you memorize less tokens. I guess it really sux if a programmer has to learn a dozen symbols, heh must suck to learn C and have to understand the concept of pointers, linked lists, stack, free/malloc, etc. That stuff is so much easier than a few tokens. ;-)
      Well it's funny to see these language wars. :-) I use Perl, C, and sometimes ASM, and even mix & match with inline calls. With those languages I get done everything I need to do just fine. The academic languages are interesting but they don't pay my bills.

    15. Re:Look, I program in Perl by Anonymous Coward · · Score: 0
      Just for reference -- I consider this sick and wrong. (Disclaimer: I program in both Python and Perl.)

      The concept of mixing the two languages in this way is an excellent hack, but I'd have to shoot anyone who did this in a real program.

    16. Re:Look, I program in Perl by loginx · · Score: 1

      I tend to agree but go look at the ASPN python cookbooks, there is a neat implementation of Perl's DBI module from python.

      I can definitely see a real use for this, as there aren't very many python packages around that do what DBI does. (at least not that I could find back when I was looking for them. I suspect this has not changed).

    17. Re:Look, I program in Perl by Kirruth · · Score: 1
      I think it's definitely a question of "horses for courses"

      Haskell is superb for mathematical problems, partly because the syntax is very mathematical, partly because the compiler implementation is well optimised for that kind of problem. (I often wonder why it doesn't get more use for stuff like encryption). Completely Open Source, of course.

      Python is wondrous for network-related stuff - its a real strength of the language - and also seems to get alot of use as a language for installations and mods.

      Perl is the regular expression king, no question, and its also possible to write very economical (fast to type, fast to run) code. The Bash-vim-Perl combination is still the most God-like way to program.

      There are so many great free languages and libraries out there, its a good time to be a geek.

      --
      "Well, put a stake in my heart and drag me into sunlight."
    18. Re:Look, I program in Perl by juhaz · · Score: 2, Interesting
      from sys import stdin
      print "Who are you?"
      name = stdin.readline().strip()
      print "I'm glad to meet you, %s." % name


      Overly verbose and complicated, you can write this in two lines and save an import as well as the need to know stdin is a file object to boot. And string formatter operator is not instantly clear, especially to a person who hasn't used printf(), not everyone has C background.

      How about
      name = raw_input("Who are you? ")
      print "I'm glad to meet you, " + name
    19. Re:Look, I program in Perl by Anonymous Coward · · Score: 0

      >print "Who are you? ";

      Ok, easy.

      >$name = ;

      Not so easy, wtf does this do?

      >chomp $name;

      What the hell is chomp and how does it relate to reading input? Doesn't make any sense, stupid inside jokes about "eating" DO NOT belong to core language.

      >print "I'm glad to meet you $name.\n";

      Ok, easy.

      Yeah, just so terribly hard to read isn't it?

      It is. Two out of four lines being incomprehensible in a frickin' hello world app doesn't look too good to me.

      And the $ token on the scalar variable is so hard to understand

      And if it was just $ token, no, not that hard to understand, just pain to write, but it's not. There's shitload of tokens.

    20. Re:Look, I program in Perl by juhaz · · Score: 1

      My question is: How easy is it to wrap your code in a library/module and call it your own so you can call it your way?

      For python code: insanely easy, modules and packages are just files and directories, and your own libraries snap into the place just like they were part of the stdlib.

      For C/C++: still rather easy, even if you do it manually, with pyrex or swig, it's even better. The best part is, you call C extension just like you a python module, there's no difference in whatsoever, programmer using the library doesn't even need to know it's C.

      Perl modules? Dunno, looks like it's possible from the other comments, but doesn't integrate nearly as nicely as C and python libraries.

    21. Re:Look, I program in Perl by ZorroXXX · · Score: 1
      >$name = ;
      Not so easy, wtf does this do?

      A couple of bracets are missing (due to slashdot html filtering). The code should read

      $name = <>;
      In perl
      <FILE_HANDLE>
      means reading from that file and without any specified filehandle it (usually) means stdin.

      >chomp $name;
      What the hell is chomp and how does it relate to reading input? Doesn't make any sense, stupid inside jokes about "eating" DO NOT belong to core language.

      chomp is for stripping of the "\n" at the end of the line.

      --
      When you are sure of something, you probably are wrong (search for "Unskilled and Unaware of It").
  5. As the author says... by lukewarmfusion · · Score: 4, Insightful

    "All this information is out there to find for free, but having it all collected and summarized is worth every penny."

    Is it? If you are, as the author says, someone familiar with Python but you have no clue about network concepts or programming, perhaps this book isn't for you. The first 100 pages or so are all intro to networking; after that, you have specific Python networking programming topics. Perhaps you'd be better suited with a networking book and then this book (sans the first 100 pages).

    I've read a few books on programming languages and when they decide that the reader needs an intro to something, they usually provide pretty poor coverage of that topic. You end up being lost after you get done with the intro section. I did this when I was learning some encryption programming... before I could start actually writing code that deals with encryption, I needed a solid base. Instead of trying to teach me all I needed to know, the reference I was using pointed me at the industry's best encryption and security books and authors (like Bruce Schneier).

    Disclaimer: Not having read this particular book, maybe this one is different. I don't know.

    1. Re:As the author says... by ultrabot · · Score: 1

      I did this when I was learning some encryption programming... before I could start actually writing code that deals with encryption, I needed a solid base.

      If you are doing your own encryption, it's going to be easily crackable. Encryption is definitely something that needs to be done in a peer-reviewed library.

      What's wrong with, say, SSL?

      --
      Save your wrists today - switch to Dvorak
    2. Re:As the author says... by Anonymous Coward · · Score: 3, Insightful

      I totally have to disagree with you. I hate when I spend good money on a book about a subject and then there is a bunch of extra crap thrown in there I feel ripped off. For example: just about half of all the security books I own waste a whole chapter on TCP/IP going over the fucking OSI model and crap. True you should understand TCP/IP if you want to understand security but one chapter in the front of the book is not going to teach you all you need to know about TCP/IP. You'd be better off just buying a seperate book on TCP/IP and the publisher would be better off yanking those chapters from the book. But they keep it in there as padding anyways so that the book is bigger and they can jack up the price.

      That is why all the older Oreilly books are so good. No padding. No bullshit. The books were about what the cover said they were about, no less and no more. All meat.

    3. Re:As the author says... by Phoukka · · Score: 4, Insightful

      Okay, I have read the book, and the review author is correct in his statement. No, the book will not teach you the OSI model, nor will it teach you general networking theory to an expert level. However, I came to the book with a general knowledge of Python and a poor-to-middlin' understanding of network programming in particular. I've built web apps using pre-existing frameworks, for example, but I've never written code to work with sockets.

      Having read the book, I understand socket programming, general network programming, and could probably design and implement my own application protocol -- badly, of course, but still... Could I have done this prior to reading this book? No. Did this book make it easy to pick up the necessary background, as well as make it easy to pick up the specifics of network programming in Python? Yes.

      This is a great book, and is a must-have for Python programmers.

    4. Re:As the author says... by lukewarmfusion · · Score: 1

      To clarify, I was referring more to the implementation of existing encryption tools and algorithms. I was programming basic stuff for a long time before I ever needed to think about encrypting data for transmission (say with SSL or PGP) or storage (including hashing). I'm no expert (I know enough not to try creating my own algorithm), but without the fundamentals it's really easy to make mistakes. Costly mistakes.

  6. Python makes Windows fun by mslinux · · Score: 3, Interesting

    I use Python to administer computers... lots and lots of computers. It runs on Macs, Windows, Linux and all variants of Unix. It's one of the most portable languages around.

    I used to be a huge Linux buff (and still am when it comes to servers), but intelligent tools like Python make using Windows XP Home a much more fruitful and fun experience as I can actually get stuff done programmatically. Go Python developers and keep up the good work!!!

    1. Re:Python makes Windows fun by archeopterix · · Score: 1
      ... but intelligent tools like Python make using Windows XP Home a much more fruitful and fun experience as I can actually get stuff done programmatically.
      *cringe* This language needs to die. Now. :-)
  7. Python Web Programming by Anonymous Coward · · Score: 2, Informative
    I found Python Web Programming a few years back covered almost all of what the review mentioned.

    It also had a brief Python tutorial in it, but I kind of skipped over that, so I can't vouch for that part. The rest of the book will definitely teach you a bit about network programming, web/database programming, and things of that nature. For most of the /. programmers it might be pretty old hat since they were doing this stuff in the womb, but for unexperience programmers such as myself, I found it helpful.

    1. Re:Python Web Programming by Anonymous Coward · · Score: 0

      That book is heavily windows based.

  8. Civ IV moddable with python by ultrabot · · Score: 3, Interesting

    Incidentally, Civilization IV is going to be moddable with Python

    --
    Save your wrists today - switch to Dvorak
    1. Re:Civ IV moddable with python by Anonymous Coward · · Score: 0

      Please tell me the game will be less pedantic and boring than Civ 3.

      As far as I'm concerned, Civ 2 was the paragon of the Civ universe, so far :P

    2. Re:Civ IV moddable with python by Anonymous Coward · · Score: 0

      OMG I nearly failed out of college on Civ, had a horrrible time at my first post-grad job due to Civ II, and finally gained a measure of non-compulsive behavior with Civ III (when the CD quit functioning). Now there is a threat of another version. Waaaaaaaaaah!

    3. Re:Civ IV moddable with python by nzhavok · · Score: 1

      wow, thanks for the info.

      A bunch of friends and I were talking about civ 3 the other day, and how the biggest feature it lacks is some player useable scripting engine. I hope that it will be flexible and allow things such as iterating through all cities and setting production to cavalry where net shields are greater than 15 per turn, except if the city has no barracks, in which case set production to that. It's a pain to do by hand.

      --

      He who defends everything, defends nothing. -- Fredrick The Great
    4. Re:Civ IV moddable with python by cortana · · Score: 1

      Whatever you do, don't tell these two about Freeciv. Oops.

  9. Google groups psoting by Mstrgeek · · Score: 1
    this a post that was done based on the book hope you find it to be a help the psot was done by John Goerzen (jgoerzen@complete.org)

    http://groups.google.com/ groups?q=Foundations+of+Python+Network+Programming &hl=en&lr=&selm=mailman.3337.1095202643.5135.pytho n-announce-list%40python.org&rnum=1

    --
    Chris Williams clw7500nc@gmail.com
  10. There's more than one way to do it by Anonymous Coward · · Score: 0

    ...and one of those ways is to use Python. No biggie.

  11. How many Foundations? by PCM2 · · Score: 4, Funny
    Foundations assumes you already know Python, but nothing about network programming.
    Ah, but what of the Mule? Doesn't the presence of an advanced mutant of his scale defeat this whole premise?
    --
    Breakfast served all day!
    1. Re:How many Foundations? by aliens · · Score: 1

      Nice reference. /golf clap

      --
      -- taking over the world, we are.
    2. Re:How many Foundations? by Sheepdot · · Score: 1

      I don't know about "network programming" but Seldon and crew sure did a lot of "networking" in the "Foundations" series.

    3. Re:How many Foundations? by PCM2 · · Score: 1

      Thanks ... thank you ... and you know, it truly brings a tear to my eye when I realize that I can say that on this day, in this hour, I am truly ... a nerd.

      --
      Breakfast served all day!
  12. For a minute there... by Dave21212 · · Score: 1, Funny


    For a minute there I really did think the title "Foundations of Python Network Programming" indicated that a new Python Network was being created for television and that they were laying the foundations and discussing what the programming schedule would be.

    Seriously, no joke. And by the way, a Python Network would be beat the Game Show Network hands down !!!

    --
    "Whoever would overthrow the liberty of a nation must begin by subduing the freeness of speech."--Benjamin Franklin
  13. Have you considered Ruby? by Anonymous Coward · · Score: 0

    Beats the shit out of Python IMHO. It's OO done right, very clean, very dynamic. Easy to extend using C, so you don't have to reinvent the wheel. Has a very friendly and helpful user base - ruby-talk@ruby-lang.org
    Look it up.

    1. Re:Have you considered Ruby? by Anonymous Coward · · Score: 0

      Ruby might be good, but no one here in the States or in Europe uses it. Until Ruby broadens its scope outside of Asia, it won't have a chance against Python or Perl.

    2. Re:Have you considered Ruby? by Anonymous Coward · · Score: 0

      *looks out the window*

      Uhm, I'm in North Carolina, I'm pretty sure, and I use it for my day-to-day work. So do a lot of people.

      You can use Ruby right now, today, to solve your problems faster and more elegantly. Don't worry about how many of your Java buddies are using it. They will be using it soon.

  14. Look: Programming in Perl is Simply Irresponsible! by SimHacker · · Score: 1, Insightful
    Programming in Perl is terribly irresponsible and foolishly self indulgent. It's like maturbating in public and not cleaning up after yourself.

    If you choose to program in Perl, the poor suckers who are going to have to read, maintain, clean up and modify the code you wrote will hate your guts.

    Programming languages should be designed primarily for PEOPLE to read, understand, write and maintain reliably, and only incidentally for computers to interpret and execute.

    Perl goes against every rule in the book about readability, simplicity, learnability, maintainability, integrity, responsibility to the community and style. And for no good reason!

    The naively celebrated fact that Perl always has 2 dozen special case syntaxes, idioms, implicit rules and perverted styles to write the same thing, adds absolutely no power to the language whatsoever, and just makes it harder to read, write and maintain.

    Even if you're just writing "throw away" Perl code, not working on anything important enough to reuse or share with other people, you're still crippling yourself with lazy bad habits that will doom you when you get a real job or start working on a project worth sharing with other people.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  15. Every Perl programmer should switch to Python. by pclminion · · Score: 4, Insightful
    And vice versa: Every Python programmer should switch to Perl.

    At least, for a month or so.

    Knowing multiple languages increases your value as a programmer quadratically. I like to think that languages follow a square law. By doubling the number of languages you know, you quadruple your total skill and marketability as a programmer.

    I've done significant stuff in both languages and there are definitely tasks where Python is better -- for example, command-and-control, super-high-level types of apps, which coordinate large systems of smaller programs. And Perl is vastly superior in other situations, such as processing enormous wads of data and formatting output. I've even written hybrid programs where Python and Perl code intertwine.

    Step outside your box. You don't have to love the language you're learning, but consider it an investment in yourself. Saving money sucks too, but it's still a good idea.

    1. Re:Every Perl programmer should switch to Python. by snakecoder · · Score: 2, Informative

      I am a python bigot but one thing Perl taught me was how to quickly take advantage of regular expressions (looking at other peoples code).

      Now I use Pythons re() module which takes a little getting used to. While I'm at it, for those of you that write complex or deep regular expressions where re() craps out, there is a much more stable legacy module called pre() that seems to be undocumented. It works exactly like re(). The only difference, it trades speed for stability.

      --
      -Nuke the moon
    2. Re:Every Perl programmer should switch to Python. by the+quick+brown+fox · · Score: 2, Insightful
      I agree with you, but I don't think you go far enough. Going from Python to Perl isn't stepping very far out of your box. Why not try Lisp, Haskell, Erlang, Scala, Smalltalk, or ...?

      Different syntax and different libraries will open your mind a little. But when a language encourages (or forces) you to think differently, that's where your "square law" starts to kick in.

    3. Re:Every Perl programmer should switch to Python. by omaha · · Score: 1

      My experience with Python and the community is that most people that use Python already know a number of languages.

      It doesn't take much googling to figure out a growing number of very experienced programmers are "discovering" python and the most common comment is something similiar to "...fun to program again..."

      Python is a main stay at my work place. A language that doesn't get in your way, you can just solve problems and create solutions.

      But, perl isn't going away. It's simply magic for one liners.

    4. Re:Every Perl programmer should switch to Python. by killjoe · · Score: 1

      Lisp and Smalltalk are and have been the language pyton, java, C#, ruby, and perl are trying to be.

      --
      evil is as evil does
  16. Re:Look: Programming in Perl is Simply Irresponsib by Camel+Pilot · · Score: 1

    Perl goes against every rule in the book about readability, simplicity, learnability, maintainability, integrity, responsibility to the community and style. And for no good reason!

    O.K. Why don't you start with listing a single specific?

  17. Have you tried Ruby? by Colonel+Panic · · Score: 3, Insightful

    I really think that if you're coming from Perl you'll prefer
    Ruby to Python. No indentation hassles with Ruby, for example. You'll also like the way Ruby does OO compared to Perl OO. More Rubilicious links...

    Also, The Pragmatic Programmers have released a new edition of Programming Ruby that's a great intro and reference to the language - go buy it from their website.

    Ruby: Because I can't wait around for Perl 6 to get finished

    1. Re:Have you tried Ruby? by ciw42 · · Score: 5, Informative

      Although I've used seeming every language under the sun at some point during the past 20+ years, my language of choice for most projects these days is Python.

      As a background to my choice, here's what I use it for:

      I tend to write primarily for the Win32 platform and most of my applications have GUI front-ends they speak to MySQL databases, and often also control third party applications via COM. Aside from the COM stuff (the apps I'm controlling are only available for Win32 anyway) my software is fully cross-platform which is desireable. I love and use GNU/Linux extensively, and am starting to see an interest from the SME market which is encouraging.

      I've used Python a lot and Perl a fair bit, plus I've looked at and thoroughly expected to fall in love with Ruby and Lua. I didn't.

      I've realised that all four languages are so similar in many respects, that it's very difficult to convince a person using one to convert to another unless they have a very specific need. So it's just not worth trying.

      If the language you are using does the job for you, then stick with it. Once you know the work-arounds for its deficiencies (and they all have them) then there is even less reason to change.

      Trying to be objective, here's how I find each of the languages:

      Python - Extremely easy to pick up, which is actually good for experienced programmers as well, but at the same time very flexible and powerful. Very readable and easily maintainable code. Good range of libraries (but nowhere near as many as Perl) which all stick closely to a well established "pythonic" way of doing things. You don't have to choose from a dozen different libraries that all claim to do the same job. The interactive shell is also remarkably useful for experimentation and debugging. Most good programmers indent their code anyway, and I don't know anyone that found the forced indentation a problem unless they were deliberately being arguamentative. The concept of packages is very simple and neat - you don't need to do anything special to allow importing of your code. Object orientation is very flexible, straight-forward and powerful. There are a large number of precompiled libraries with installers for Win32 platforms - don't ever underestimate how important this is in when using scripting languages in the current commercial environment. Extensive and uniform use of dot notation. Good range of freely available cross-platform IDEs. Like most Python bindings, those to GUI libraries are generally much easier to work with than the original C libraries.

      Perl - Very powerful but extensive use of special characters rather than keywords can tend to result in code which needs reading several times to fully comprehend. Having built-in regular expressions is both useful and powerful, but only adds to the problem of making code less readable. Th eobject orientated aspects of the language are very much bolted on, and far from elegant. Functionaly they're quite capable, but certainly not pretty. It's very easy to code in your own style with several ways of doing the same thing, not necessarily a bad thing, but it does means there is more to learn of the core language if you want to be confident about being able to maintain code written by others. You do feel that you have flexibility in your choice of coding style which is always nice. Immense number of additional libraries, available from one source - the wonderful CPAN - but there is also a good deal of duplication, and you need to spend time evaluating the options to find one that has the features you need and works the way you'd like. Packages have to be written or at least bundled up as such. That said, it's available by default on *nix systems, it's also very closely tied into the operating system and shell which makes OS related stuff in Perl a breeze. Win32 support is available, but Perl is only truly at home in a *nix environment. The bindings to most cross platform GUIs are aften more complicated and difficult to use than the C equivalents.

      Ruby -

    2. Re:Have you tried Ruby? by trewornan · · Score: 1
      No indentation hassles with Ruby, for example

      This is always brought up - oh no, Python enforces indentation. This is not a hassle - five minutes using Python and you won't even notice!

    3. Re:Have you tried Ruby? by CatGrep · · Score: 1

      The availability of additional packages is currently rather limited.

      The new second edition Programming Ruby by Dave Thomas & co. has an excellent section on built-in classes and modules that starts at page 427 and goes to page 777 - and even it is not exhaustive. I've done Ruby programming for pay and I've not found that Ruby was lacking any functionality that I've needed. Sure, Perl's CPAN is bigger than Ruby's RAA, but there's quite a bit of redundancy in the CPAN as well. I suspect that we're gaining rapidly on Python's repository as well.

      I really liked the idea of everything being an object until I realised that beyond what Python already offered, I had no need for this level of object orientated-ness.

      Different strokes for different folks... I very much appreciate Ruby's Smalltalk level of OOness.

      What it really boiled down to was that I couldn't find a single good reason to make me adopt Ruby

      How about Ruby's blocks? Or the fact that Ruby's lambdas (closures) allow you to do a lot more than Python's do.

      ...but I doubt it's evey [sic] going to arise.

      Two links:
      Rails and Instiki

      Both are generating quite a bit of buzz even outside of the Ruby community.

    4. Re:Have you tried Ruby? by killjoe · · Score: 1

      "Good range of libraries (but nowhere near as many as Perl) which all stick closely to a well established "pythonic" way of doing things."

      Unlike perl they are scattered all over the web and you'll have to google for the module you think you need. There is no equivalent of perl -MCPAN so installation of the modules can be a pain if there there are dependencies.

      "You don't have to choose from a dozen different libraries that all claim to do the same job."

      This is flat out false. There are lots of SOAP libraries and I still havent found one that handles complex objects. There are multiple database libraries, there are multiple network libraries. This all goes back to point 1. Because there is not a master repository people keep rewriting new modules to do the same things.

      --
      evil is as evil does
    5. Re:Have you tried Ruby? by killjoe · · Score: 1

      If the ruby folks can make something like jboss but without the insanity that's J2EE that would be amazing. The python people have zope at least which is nice but I would say equally as insane as J2EE.

      A nice clean container for publishing objects and frameworks for logging, testing, cron, and remote objects.

      --
      evil is as evil does
    6. Re:Have you tried Ruby? by ciw42 · · Score: 1

      One of my earlier points was that there has to be a good reason to move from one langauge to another, and for most people there is nothing lacking in the langauge they are using, so a change makes very little sense. Blocks and lambdas may well be a killer feature of the Ruby language for you, but I've coded in plenty of different languages over a period of 20+ years, using most of them in a commercial environment, and haven't needed or ever felt the desire to use them. So for me they're not a reason to change. I doubt I'd actually use them if they were implemented identically in Python. I'm not slagging off Ruby, it's a more modern langauge than either Python or Perl and for someone new to scripting languages I'd certainly suggest they take a look at it, but for me, and I suspect many others using one of the other languages, there is just no compelling reason to use it over any of the others, in fact there are things which are less straight-forward, but all languages have their benefits and deficiencies. There are great projects and libraries popping up all over the place. With processing power constantly increasing and flexbility and speed of development being major factors these days, it's a boom-time for the scripting languages and an exciting time to be using them. There are really very few situations where I'd consider using anything else. As always, it really is a case of what works for you, and I'd certainly never suggest to someone who's happy with their current language of choice that they change unless they wanted/needed a specific feature or library. I've no interest in starting a Python vs Perl/Ruby/Lua debate, it's been done to death and very quickly descends into petty childishness on both sides. Let's just be glad we've all found languages which serve our purposes well, and raise a glass quietly amongst the din in the pub this evening to acknowledge the fact.

    7. Re:Have you tried Ruby? by ciw42 · · Score: 1

      I specifically mentioned that Python had no equivalent to CPAN, and that this was a negative. Whilst the libraries themselves are scattered over the net, python.org has a package index which acts as a kind of simpler, but still useful version. I've coded in Perl commercially, and know plenty of Perl programmers, many of which treat Perl a religion. There's certainly nothing wrong with that, but they all say the same when it comes to finding a library to do a specific job - whilst they are easy to find, there are often too many choices using often entirely different approaches, so it takes time to evaluate and decide upon the most appropriate one for you. Often the differences can be in style rather than functionality, and things being done in a fairly standard "Pythonic" is a big plus for Python programmers. Yes, there may be a couple of different options for specific libraries in Python, but you'll usually find that the interfacing and approach is very similar, they just have different goals. I'm not interested in starting a Python vs Perl (or Ruby or Lua) flame-war. It's pointless, often tends to deteriorate into childishness and petty bitching (from both sides) and is therefore a waste of everybody's time. One of my earlier points was that, due to the similarities in pretty much all modern scripting languages, trying to convince someone to move from one to another once they've started using it is difficult and often pointless. All of the languages mentioned are useful and highly capable, but when I started looking for a scripting language to move pretty much all of my development over to, I was in the great position of having a month to evaluate and decide but approached the task with few preconceptions, except a suspicion that Perl would be my choice. The forums were of no help whatsoever, the threads would start off sensible and informative but without exception, quickly deteriorate into petty flame-wars. Not very useful. I have absolutely no interest in sticking with one language where there are genuine gains to be had from switching to another. With this in mind, as recently as a month ago, I decided to write three versions of a small commercial project (using MySQL, SQLite, GTK+, COM, serial and parallel port access) in Python, Perl and Ruby. There was no GTK+ library for Lua and as I'd used it for the other three using wxWindows wouldn't have given a good comparison. After this I still decided that for what I do, Python is the most productive and straight-forward option by a long way. But that's just me. For day to day stuff, I'll continue to use Python. It works very well for me. In a few weeks time I'll be writing a set of administration scripts for a GNU/Linux system, and I'll be using Perl for these. It's the best choice for this kind of work. As I've mentioned, Lua is a superb choice for embedded scripting, and quite a bit easier to implement than Python in these cases, but so far I've not needed to do this. When I do, I have no doubt I'll be using Lua. I know Ruby has some nice concepts, and it may be that there are more libraries available than I was able to find the last time I needed any, but I simply can't find a good reason to use it for any of the above, and so I don't. It's certainly not that I don't like or appreciate it, I just haven't come across a situation where it would do a specific job better than one of the above. And before anyone suggests that I could use Ruby to cover all of the above scenarios, I could also use Python for the same, but I truly believe it's horses-for-courses. If a system such as GNU/Linux already comes with Perl it makes sense to use that if the code is only ever to be run on GNU/Linux, and Lua was designed from the outset with embedding in mind, so not surprisingly it's very good in this area. When it comes to being useful for cross-platform development of client-side applications which is my bread-and-butter stuff, then Python has proven time and time again to be a better, more productive option for me. Having an interactive mode and basic IDE (IDLE) built in also mades it useful for quick scripts. Each to his/her own, and long may we have the choice of several good scripting languages.

    8. Re:Have you tried Ruby? by ciw42 · · Score: 1

      The above post was all nicely formatted into paragraphs when I typed it. Look at it now. Not sure how that happened, but hopefully you can read it.

    9. Re:Have you tried Ruby? by Big+Sean+O · · Score: 1

      Sorry, it's not _not_ a hassle. It's just not a big one.

      Indentation sometimes gets screwed up when you move a chunk of text around. Sometimes you 'fail to proceed' when you run tests and it's because of a screwed up indentation. It's easy enough to diagnose and pretty easy to fix, but it is a hassle.

      Also, if you have a crappy text editor (or if you have crap skillz) you can get in trouble when you have to indent a chunk of text. Not a big hassle, just a little one.

      Despite these two exception, python's meaningful whitespace has a lot of benefits. The most obvious: it makes code chunky. You don't have to check braces or check to see the previous author formatted correctly. It might be more rigorous to write, but it's easier to read (which may be the only reason some people prefer python to perl).

      --
      My father is a blogger.
  18. SWIG rocks for plugging into C/C++/Libraries. by SimHacker · · Score: 5, Informative
    SWIG is an excellent open source tool for plugging C++ and C code and libraries into Python and other programming languages.

    I can't say enough good things about SWIG. It's an amazing piece of work that has saved me years of menial labor and enabled me to integrate all kinds of compex code into Python, from hairy C++ templates to third party Win32 libraries for which there is no source code. It works extremely well with Python, and many other languages too.

    Here is the blurb from the web site www.swig.org:

    SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is primarily used with common scripting languages such as Perl, Python, Tcl/Tk and Ruby, however the list of supported languages also includes non-scripting languages such as C#, Common Lisp (Allegro CL), Java, Modula-3 and OCAML. Also several interpreted and compiled Scheme implementations (Chicken, Guile, MzScheme) are supported. SWIG is most commonly used to create high-level interpreted or compiled programming environments, user interfaces, and as a tool for testing and prototyping C/C++ software. SWIG can also export its parse tree in the form of XML and Lisp s-expressions. SWIG may be freely used, distributed, and modified for commercial and non-commercial use.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
    1. Re:SWIG rocks for plugging into C/C++/Libraries. by smittyoneeach · · Score: 1
      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    2. Re:SWIG rocks for plugging into C/C++/Libraries. by Anonymous Coward · · Score: 0

      Note that if you're a Ruby programmer, you don't need to waste your time with a SWIG step, just load the DLL directly into Ruby at run-time:

      http://ttsky.net/ruby/ruby-dl.html

      This is part of the standard Ruby distro, download it and try it out today!

  19. Re:That's like eating just one potato chip! by sisukapalli1 · · Score: 1

    Hey everybody: What's wrong with Perl?
    Nothing. Unless you want to write like you do C/C++ or shell scripting in Perl(that is what may people do).

    If you follow the style guide and conventions, you will be able to write concise, elegant code in Perl. Hmmm... It's like English. You can write poetry or you can spew out illiterate gibberish. One has to invest some time in studying Perl. It grows on you.

    S

  20. Re:Look: Programming in Perl is Simply Irresponsib by DAldredge · · Score: 1

    Have you ever written a single line of code?

  21. Re:Look: Programming in Perl is Simply Irresponsib by Anonymous Coward · · Score: 1, Funny

    It's like maturbating in public and not cleaning up after yourself.

    Yes! whenever I masturbate in public I always wipe it up afterwards! The cashier at the supermarket really appreciated that!

  22. Re:That's like eating just one potato chip! by Camel+Pilot · · Score: 1

    I thought so....

  23. OT - sig by Boronx · · Score: 1

    How would you play roguelikes with a Dvorak layout on a laptop, since movement keys are based on Qwerty?

    1. Re:OT - sig by kubrick · · Score: 1

      Can't you remap the keys in most roguelike games?

      --
      deus does not exist but if he does
    2. Re:OT - sig by Boronx · · Score: 1

      I'm thinking of Nethack with the number-pad turned off, and Angband with the "Rogue Keyset" option turned on, and Linlay's Dungeon Crawl. Maybe there is a way to remap in these games, but I've never run across it.

    3. Re:OT - sig by kubrick · · Score: 1

      If they're all open source (which I think they are), you might have to get your hands dirty, but it's probably doable. You could probably find others to help, as the crossover between programmers and users of alternate keysets is probably higher than the average.

      I never really got into 'hjkl' as navigation keys, as even when playing the ports on my Amiga 500 I had a numberpad to use instead :) (Those keys were used in the early Unix editors for left-up-down-right, weren't they, thus the adoption by the games?)

      --
      deus does not exist but if he does
    4. Re:OT - sig by Boronx · · Score: 1

      I know that VI uses those keys, and I believe Emacs does too. A source patch is a good idea. Then I could become part of the mysterious devteam!

  24. Re:Easiest review to skip by Boronx · · Score: 5, Insightful

    I don't use Python for much, but one of the primary reasons when I do is that a small, hacked together, uncommented python script is way easier to read months or years later than a similar Perl script or C source.

  25. Re:Easiest review to skip by Doc+Ruby · · Score: 1

    I've written so many prototypes for other, usually less experienced, programmers to implement for release. I've learned always to write the comments first. Then I fill in working code. That discipline has also made me a better, more focused coder. Especially when I prototype in Perl, programming's encrypted Swiss Army Chainsaw ;).

    --

    --
    make install -not war

  26. Re:Look: Programming in Perl is Simply Irresponsib by Anonymous Coward · · Score: 0

    Here's a good example, other than being used as mathametical operators, what are all uses of the following symbols in perl:

    !@#$%^&*()?{}[]

    Each of these symbols and combinations of these symbols have a special meaning in perl, which one can only know by either: memorizing, or looking them up. The beauty of python is that you don't have to memorize nearly as many special symbols to work with variables. I could give some specific examples, but I don't want to spend the time right now to read through perl documentation.

  27. Encryption Programming and Canned Libraries by billstewart · · Score: 2, Insightful

    The first thing you get from a "solid base" of encryption knowledge is the concept that doing your own encryption algorithms except as an exercise is a really bad idea.... But that doesn't mean that you can write application programs that use standard libraries like OpenSSL without a solid understanding of what the encryption technology's doing - you really do want to be more than a script kiddie in this field.

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
  28. The Agony of SOAP/WSDL by Anonymous Coward · · Score: 2, Interesting
    For anybody who has had to deal with this wretched monstrosity, python is a blessing thanks to the SOAPpy package.

    The usual way involves a pageful of obscure code, and having to use obtuse WSDL descriptor files and code generators to give you classes.

    But, hey, python can generate classes and methods on the fly. So getting the temperature at zip code 90210 becomes a one-liner after some standard imports:

    SOAPpy.WSDL.Proxy('http://www.xmethods.org/sd/2001 /TemperatureService.wsdl').getTemp('90210')
    I'm not kidding; that line currently returns the floating point number 68.0.

    Note: you'll need to remove the extra space in the URL that the slashdot antilameness crud inserts. The full example is found in simpleWSDL.py in that package.

  29. Re:Easiest review to skip by Doc+Ruby · · Score: 1

    Nerd animosity towards documention runs deep. Mods didn't like my snarky review of the glowing review, but how is it a "Troll"? As usual, no replies disputing the logic or evidence. Another chance to comment missed by people who'd rather communicate with a machine than use it to communicate with another person.

    --

    --
    make install -not war

  30. Re:Easiest review to skip by Anonymous Coward · · Score: 0

    I just glanced at your journal after being astonished by your arrogance and (likely unjustified) sense of elitism.

    Conclusion: Tool.

  31. If you're a "$LANGUAGE Programmer"... by don.g · · Score: 3, Insightful

    If you consider yourself to be a $LANGUAGE programmer, then there's something wrong.

    As the parent post says, knowing multiple languages is good. One of my pet annoyances is hearing people describe themselves as a programmer for a specific language -- there are many more out there, and to say you only do one speaks volumes about the lack of breadth of experience you posess.

    And don't just stick with imperative object-oriented languages. Try a few declarative languages, like Haskell (functional) or Prolog (logic). Yes, getting your head around them is hard. But you'll be glad you did.

    Disclaimer: I'm a student doing an MSc in Computer Science, and by lines of code, most of what I wrote in the last twelve months was Perl, and was completely unrelated to my thesis :-)

    --
    Pretend that something especially witty is here. Thanks.
    1. Re:If you're a "$LANGUAGE Programmer"... by Anonymous Coward · · Score: 2, Interesting

      Try a few declarative languages, like Haskell (functional) or Prolog (logic).

      You're a little bit off there. Haskell is not declarative. It's just functional, as you said. Prolog is declarative though.

      If you want to try a nice variety of languages here's what I suggest:

      C - 'nuf said.

      Java or C# - Good application programming languages. Similar enough for learning purposes that it doesn't matter which you use. If you want to get into the inner workings, both are very interesting systems to learn about.

      Perl or Python - They're not too similar as languages, but their purposes are similar. If you want to do scripting, these are good choices.

      Haskell - Purely functional language. As expected from a purely functional language, things like I/O are difficult in Haskell. Still, an excellent way of learning a whole new way to think about programming.

      Prolog - Nice declarative language. Thinking in first-order logic is another thing you don't do with common languages. Better get used to it though, since between the semantic web, Spotlight, WinFS, and other metadata, programs are going to have a lot of logical reasoning to do.

      Assembly - Sure, you can survive without this these days, but knowing what's going on at the very lowest level gives you a new perspective on programs. It can also help when things go really really wrong with your program and you're not sure you can even trust the VM any more. Save your sanity. Don't look at x86. I suggest MIPS.

      awk and sed - Yes, the classics. It doesn't hurt to look at all the common unix tools, but these are the big boys of string processing. You'll need to learn the basic of regexes at some point, and if you don't use Perl, this would be the place to do it.

      Optional:

      C++ - It's not dead yet. Personally I don't know C++, but most apps out there are still using it, so it's inevitable that I, and you, will see it some day. If you know C and Java/C#, you should be able to read C++ at least.

      Smalltalk - It never hurts to study the classics. Also, the distinct lack of ancestry from C that Java and C# have can make it easier to figure out how that whole object-oriented thing is really supposed to work.

      BASIC or Cobol - You study Smalltalk to understand how good things could be. You study these to understand how bad they could be.

      Lisp - Possibly as an alternative to Haskell. Another classic, and a little more practical than Haskell. I think Haskell is still a better teacher of functional programming, but take your pick.

      Fortran - Do you do numerical methods? Then be sure to try Fortran. Just as C is close to the machine, Fortran is close to the math. I can't guarantee you'll like it, but it's worth a look.

      Ruby - I think of this language as just plain fun. It has so much syntactic sugar you could bake it into a cake. Be warned, you may end up liking it even more than Perl or Python.

      XUL, XAML, or X Forms - I can already hear people saying "What the heck?" This is just my own personal opinion, but declarative UIs are the way to go. How many people would seriously still write them procedurally anyways? Interface Builder, Visual Studio, HTML...people already "build" UIs anyways. I think there's benefits in a rich UI language that's both human and machine readable, hence, I suggest one of these...

      XSL - awk gone XML with a few imperative features. Unless you think you will never ever touch XML, learn this. Especially learn this if you think XML is a silly idea. I would generally agree, except some great tools have been created because of it.

  32. Re:Easiest review to skip by Doc+Ruby · · Score: 1

    Anonymous puny Coward, you found the geek definition of Troll in my journal, that obviously doesn't support that charge, and you just misspell it to try to insult me? I don't know about your "elitist" charge, but I am smart, and you are not. Keep your obnoxious gibbering to yourself, Anonymous fool Coward.

    --

    --
    make install -not war

  33. re: Downloadable Dive Into Python by llimllib · · Score: 1

    Mark Pilgrim pretty much got a special exception from apress to allow his book to be downloaded, IIRC.

  34. Re: Downloadable Dive Into Python by Filip+Maurits · · Score: 1

    90% of the book was written and freely available on his site before APress contracted him... ;-)

  35. Re:A better article... by chawly · · Score: 1

    Please accept my award for the stupidest gag of the week. It has been one of these weeks - so I've had to content with a lot of stupidy - but you win the award with a considerable margin. The moderators should, in my humble oppinion, remove your post. Have you considered doing away with yourself? It would be a kindness which you could offer the world. Have a really good day

    --
    How many beans make five, anyhow ? ... Charles Walmsley
  36. Python == good by mcrbids · · Score: 2, Interesting
    I spent some time learning a bit of Python, only to abandon it. Not because of Python, but because I had too much inertia going in various PHP projects that pulled me back.

    Python caused me to change my layout for code, almost instantly eliminating a big problem with c-like code: the missing brace.

    Most code is structured like this:
    Function fubar {
    statement a;
    do (b);
    if (c()) {
    performfunction(x);
    }
    }
    In this small segment, notice that there are to sets of braces - and they don't line up at all. You have to mentally follow the code after "fubar" and see that after the condition "if (c())" in order to mentally track the state of the braces.

    Compare this to
    Function Fubar
    {
    statement a;
    do (b);
    if (c())
    {
    performfunction(x);
    }
    }

    (slashdot's ECODE filter sux0rs)

    If you could see it, you'd notice that the braces line up. The opening and closing braces for the condition "if (c()))" are indented one more than the braces for function Fubar() which are indented more than the line "Function fubar()" itself.

    Thus, you merely have to follow the indents to match the opening/closing braces. As a result of this change, I spend less than 5 minutes per week matching up braces without the need for an IDE to match them up for me.

    Python seems to be a good language (I like that you can compiles sections of a Python program in c to improve performance without rewriting the whole program) but it's concepts of layout certainly carry beyond Python itself!

    --
    I have no problem with your religion until you decide it's reason to deprive others of the truth.
    1. Re:Python == good by klmth · · Score: 1

      Or you could use K&R style:

      void function(args){
      if (<cond>) {
      <body>
      }
      }

      See how the closing brace for the if lines up with the if itself?

    2. Re:Python == good by zxv · · Score: 1

      Uh... You make it sound like python invented that style. It didn't. Most java coders i know put braces like that. Alot of c-coders too, or well at least the smart ones ;)

    3. Re:Python == good by otis+wildflower · · Score: 1

      Python caused me to change my layout for code, almost instantly eliminating a big problem with c-like code: the missing brace.

      %

  37. Another boring python module reference? by Anonymous Coward · · Score: 0

    Does the book cover custom network services? Writing forking/threaded/pooling servers? Correct error and signal handling, checking for duplicate instances, many platform specific issues, etc?

    Seems not.

  38. Python is a disappointment by Anonymous Coward · · Score: 0

    Sure, it does things. Next. How would it do them securely? Uhh yes. You can inherit ssl wrappers and such. Nicey. Take a closer look at them. They don't have strict enough certificate checking etc functions. Got to scrap Python for any _real_ valuable environments. Period.

  39. Re:Look: Programming in Perl is Simply Irresponsib by yerfatma · · Score: 1

    I was wondering about that line. Are you telling me the cops have been busting me for littering? Winter's coming on, so I'm going to be wearing socks anyway. Clean up will be easy.

  40. Re: Downloadable Dive Into Python by Anonymous Coward · · Score: 0

    "Mark Pilgrim pretty much got a special exception from apress to allow his book to be downloaded, IIRC."

    So: Mark Pilgrim, Phil Greenspun, Richard Stallman - any other authors to look for?

  41. Amazon.com Sales Rank: 37 by tungwaiyip · · Score: 1

    Last time I checked (2004-10-15 12:27 PST) it ranks 37 in amazon.com!!!

    So I went out to verify the sales rank for other books. They result looks quite sane.

    Java Network Programming, 2nd Edition (Java (O'Reilly)) by Elliotte Rusty Harold
    Amazon.com Sales Rank: 81,978

    Core PHP Programming, Third Edition by Leon Atkinson, Zeev Suraski
    Amazon.com Sales Rank: 38,910

    My Life by Bill Clinton
    Amazon.com Sales Rank: 129

    Is Amazon broken to rank this #37!

  42. What's Wrong with Perl by SimHacker · · Score: 1
    There is no excuse for Perl being so badly designed, nor for Perl programmers refusing to admit and trying to cover up its flaws.

    If you're a Perl programmer who doesn't know what Perl's weaknesses are yourself, and you have to ask me to spell them out for you, then you're an Incompetent Perl Programmer. You should have done that research yourself before deciding to use Perl. Shame on you! Put down the crack pipe and step away from the keyboard.

    Incompetent Perl programmers who can't see or admit the flaws in their language are like the illegitimate president George W Bush who is out of touch with the harsh reality of Iraq and the economy, and therefore incapable of solving the problems. Incompetent Perl Programmers and Illegitimate US Presidents need to face the reality before they're qualified to solve the problems.

    Aaron Weiss said: It's not a secret that Perl is structurally flexible, and the conventional wisdom is that Perl gives you "enough rope to hang yourself". Funny. But that's not the gripe -- go ahead, hang yourself if you want. That's freedom. The problem is that Perl also gives you enough rope to hang others."

    Eric Naggum said: It's not that perl programmers are idiots, it's that the language rewards idiotic behavior in a way that no other language or tool has ever done.

    Peter da Silva said: The syntax is awkward, overcomplex, has too many obscure special cases (there's to many obvious examples to list, I'll just mention one of the obscure ones: the way scalars and collections in for loops are treated), and the result is that you have to not just "know Perl" you have to be a Perl language lawyer just to avoid wandering into a dark alley and getting figuratively mugged by some cool feature.

    Nicholas Clark said: That indirect object syntax is worthy of hate. (I think)

    In the Switch documentation, Damian Conway said: BUGS: There are undoubtedly serious bugs lurking somewhere in code this funky :-) Bug reports and other feedback are most welcome. LIMITATIONS: Due to the heuristic nature of Switch.pm's source parsing, the presence of regexes specified with raw ?...? delimiters may cause mysterious errors. The workaround is to use m?...? instead. Due to the way source filters work in Perl, you can't use Switch inside an string eval.

    Matt McLeod said: But the moment you try to anything properly, try to modularize and, you know, do perverted things like *reusing code*, it becomes a pain in the arse. One exciting feature I came across recently is that under certain circumstances you can create what seems like a module which exports a bunch of names, but if you don't start the name with an upper-case character it only exports the first. And it won't *tell* you this is what is going on (even with -w and use strict), it just whines that it can't find &main::foo() when it's supposed to be getting &thing::foo(). Don't even get me started on the flatten-all-arguments-into- a-list-of-scalars bullshit. Or the lack of any decent support in the basic language for datastructures other than lists. I'm sorry, walking through an array of arrays of hashrefs is not a substitute for a record/struct datatype, and having to fight it's alleged OO model to use a third-party "class" do what would be a simple job in anything else is completely not acceptable to me.

    Lars Marius Garshol said: Casting of operands in comparisons: induced errors. Redefinition of some C keywords: walltrap. Overcomplexity 1: suffix condit

    --
    Take a look and feel free: http://www.PieMenu.com
    1. Re:What's Wrong with Perl by Camel+Pilot · · Score: 1

      Wow you need to wipe the spittle of your monitor :)

      You can find detractors to any and all languages or systems (just noticing the source of the comments above).

      I was not asking you to drink someone else's koolaid, but specifically list what you think is wrong with perl and see if it stands up to scrutiny. That is why your post was rated flamebait in the first degree.

      Incidently if you read some of the quotes above and then read the discussions a little further and try to understand what the orignal complaint was you find out that they are laughable. For example:

      "One exciting feature I came across recently is that under certain circumstances you can create what seems like a module which exports a bunch of names, but if you don't start the name with an upper-case character it only exports the first."

      The guy who wrote this is evidently complaining about case sensitive file systems.

      Or the fellow who said That indirect object syntax is worthy of hate. You read a little further and find out that his strongest argument is:

      >> my $x = new Something;
      >
      > There's nothing wrong with that syntax. It's entirely clear and
      > unambigous, it is easy to read, there are no potential bugs.

      I still hate it.

  43. Re:That's like eating just one potato chip! by SimHacker · · Score: 1
    "If you follow the style guide and conventions ... One has to invest some time in studying Perl. It grows on you."

    It's sad how many Perl programmers have invested so much prescious time learning their way around Perl's fractally complex syntactic surface area and nip picking legalistic style guides and conventions, that they're unwilling to consider learning other languages. Monolinguistic Perl programmers are afraid to learn other languages because they're under the mistaken belief that programming languages are necessarily complex and hard to learn. They're afraid to admit that they've wasted so much time learning Perl's nuances, when they could have used a better language and invested that time in solving problems instead of memorizing trivial syntactic details.

    If Perl was designed well in the first place, you would not need all those nit picking legalistic style guides and conventions to tell you which parts of the language never to use, which parts don't work together with each other, and how it breaks down under so many different situations.

    The concept of "DWIM" programming languages is doomed to failure. The Lisp community figured that out many years ago.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  44. Re:Look: Programming in Perl is Simply Irresponsib by SimHacker · · Score: 1
    Perl's object oriented facility is like the Cojoined Fetus Lady on South Park:

    Conjoined Fetus Lady

    Kyle is injured playing dodgeball and must go to see the school nurse. He's terrified because of the stories he's heard. When he sees the nurse, she looks fairly normal, except for the dead fetus sticking out the side of her head. Kyle's mother educates the boys on Nurse Gollum's affliction and then decides that everyone in South Park should be made aware of the condition. Meanwhile, the South Park Cows dodgeball team goes to the state, national and finally the international finals in China, thanks to the vicious balls thrown by Pip. Kenny dies when a Chinese thrown dodgeball sends him flying into the back wall.
    So why do you choose to use a language whose OO facility you admit is quite the abortion? Python and Ruby and other languages have 100% of the power of Perl, with well design OO facilities, without the cojoined fetus attached to the side of the head.

    It just astounds me that people cling to such an abortion of a language, while rejecting Python for such a shallow reason as white space indentation. Most people who complain about that problem haven't actually tried programming in Python, and they come back later and say that it doesn't bother them at all once they get used to it. If your real complaint is just that you don't like being forced to indent your code, then you should go get a job at McDonalds instead of programming.

    The reason COBOL and FORTRAN "should have been thrown out" has nothing to do with "white space parser tokens". The problem is that there are enormous amounts of legacy code written in COBOL and FORTRAN, which is extremely expensive and difficult to maintain or upgrade, because its behavior is impossible to untangle thanks to the language's lack of modularity and support for programming in the large. And that's exactly the same problem that Perl has, and the reason that Perl should be thrown out, but never will be.

    People are finally beginning to wake up to the problems of Perl. Perl is like DDT and Asbestos: It's been used for far too long without considering its long term side-effects, and now it's everywhere polluting the environment. DDT was the ultimate "DWIM" pesticide, as Perl is the ultimate "DWIM" language. Just as the Asbestos Abatement Industry removes hazardous material from buildings, and the Cobol Abatement Industry removed Y2K bugs from code, the Perl Abatement Industry rewrites the code of failed dot-com companies whose intellectual property has been bought up by bigger dot-com companies. Not nice work, but it pays well because it's working with hazardous materials.

    Python is no less expressive or powerful, and no more complicated or harder to learn, because of white space indentation. It was a well thought out trade-off, whose upside vastly outweighs its downside. White space indentation makes code easy to read, and it forces sloppy people to clean up their act, which is a good thing.

    If you accept Perl's abortion of an OO system, then why do you reject Python's white space indentation? Learning another language would give you a better sense of perspective.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  45. sure, piece of cake by llimllib · · Score: 1

    Shakespeare, Tolstoy, Dostoyevsky, Plato, and lots of others are available copyright-free at the Gutenberg Project.

  46. Why Python by ChiefPropellerHead · · Score: 1

    I fail to understand why anyone would want to use a language that uses whitespace or tabs to deliniate program structure. This seems a sure way to get in real trouble. Any corruption of the source could really screw up the source so bad that it couldnot be recovered!

  47. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  48. Re:Look: Programming in Perl is Simply Irresponsib by SimHacker · · Score: 1
    Of course, I've written many lines of code. I learned Perl in the 80's, thought it was disgusting then, and still think it's disgusting now.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  49. Perl is like DDT, Asbestos and Lead. by SimHacker · · Score: 1
    I'm just asking you to be aware of the problems and limitations of the langauges you choose to use, and don't sweep them under the rug or pretend they don't exist. like Bush justifying the invasion of Iraq.

    If you didn't already know those points I raised about Perl and the fundamental problems of "DWIM" programming languages, then you're simply not a competent programmer. The information is out there, go look it up and learn it yourself.

    My point is that there are a lot of incompetent Perl programmers out there who are oblivious to the fact that they should be using much better languages, and not polluting their minds and the environment.

    I'm against using Perl for the same reasons I'm against using DDT, Asbestos and Lead. They may have seemed like convenient, expedient shortcuts at the time, but you absolutely must consider their debilitating long term effects.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com