Slashdot Mirror


Beginning Python: From Novice to Professional

nazarijo writes "Python seems to be devouring everything these days, with more and more people using it for serious projects. It's quickly supplanting Perl in some circles, and with good reason. It's a powerful, richly featured language with boatloads of extensions. And, unlike Perl, it's very easy to do complicated things in simple, legible code. Python books are still only a small part of the shelf at your local bookstore when you compare it to the popularity of Perl, but which ones are the gems and which ones are fluff? Having looked at a lot of Python books in the past couple of years, I think that Beginning Python: From Novice to Professional is the one that I'll most recommend to people." Read on for the rest of Jose's review. Beginning Python: From Novice to Professional author Magnus Lie Hetland pages 604 publisher Apress rating 8/10 reviewer Jose Nazario ISBN 159059519X summary Tour the Python language, from basics to advanced modules

Beginning Python is loosely grouped into three main sections. The first deals with Python fundamentals, all the goodies that are inherent to the language and the modules that it ships with. It's surprising to see how rich the language is out of the box, especially when compared to some other scripting languages. The second section would be the chapters covering popular extensions for a variety of services. These include network and web programming, SQL objects, and even GUI programming. And finally the third section is a set of 10 projects in Python, which bring everything together in a concise fashion.

I like this book a lot because it is very clear in its delivery, both the prose and the code examples used, and is consistently Pythonic. The Python language lends itself to a powerful programming style and, unlike Perl, many Python developers I know don't bother with a dozen ways to perform a simple action, they get it done and move on. What you wind up with is clear code that's easily understood by someone new to the language.

Unlike what the title would suggest, Beginning Python isn't only for the first few weeks with the language. The book is large and in depth, and the coverage of material is fantastic in many ways. You get a quick tour of the basics and then you move on to an overview of the language and then its common features. The inclusion of the 10 projects is another benefit to the intermediate user. She can refer back to this book for additional information and pointers from time to time, it wont sit still on her shelf.

That said, there are a few things in the book that I tend to disagree with. For example, the author dissuades you from using destructors in your code, but in my experience they're far more reliable, and a better place to do some cleanup, than he states. A few chapters are also a bit skimpy when they didn't need to be. For example, Chapter 18, which covers packagers like the distutils component from Python, needed to be fleshed out a lot more. This is a powerful feature in Python and sound docs on it should just be there. There's no reason to hold back on something so vital. The section on profiling in Chapter 16 is also a bit thin around the middle when it needn't be. While this seems like a minor point, having a reference to speeding up code (and measuring the improvements) is always nice. And finally, Chapter 17, which covers extending Python, is simply too short for its own good. A more in depth example would have been appreciated.

I have begun recommending this book to people I know that are smart and program in other languages, but aren't very familiar with Python. Many beginners books only take a person so far before they become a useless item on the shelf. This means that he $30 or more that was spent is now gone, so I've grown to be observant of how long I expect a book to be useful. I anticipate the useful shelf life of Beginning Python will be longer than average for most general purpose programming books for a single language. What's more is that it's not a dry reference book. Couple this to a Python cookbook for recipes and you have a two volume "mastering Python" series.

If you've been curious to learn Python and haven't yet found the book that speaks to you clearly, this may be the one. I'm pleased with the quality of the writing, the examples, and the quick pace of the book. While it's nearly 30 chapters in length, most of them are short and focused, making them easily digestible and highly useful. Overall probably the best Python books I've had the good fortune of reading."

You can purchase Beginning Python: From Novice to Professional from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

436 comments

  1. free python tutorial from book author by chriss · · Score: 5, Informative

    Not only is this a good book, it is also one of only few that cover Python 2.4. The author Magnus Lie Hetland has a free python tutorial ("minimal crash course) (Instant python) on his homepage. He was also involved (as author, editor etc.) in several other book projects:

    So we can assume he has a clue what he is writing about.

    His homepage uses PHP, btw.

    Chriss

    --
    memomo.net - brush up your German, French, Spanish or Italian - online and free

    1. Re:free python tutorial from book author by dmeranda · · Score: 3, Informative

      Python Cookbook, Edition 2 also covers version 2.4. And it is also a very useful book, even for those who know Python quite well...you can always learn a few new tricks.

      http://www.oreilly.com/catalog/pythoncook2/

    2. Re:free python tutorial from book author by Anonymous Coward · · Score: 0

      THere is a lot of books for python. Can I have some online links which can give me a basic to advanced programing in python.

      I want to convert my dating site http://www.bepenfriends.com/ to python and mysql to save cost. I can code it and i want to learn python too

  2. being python by joe+155 · · Score: 2, Funny

    we are the knights who say Ni!
    Oh, sorry, wrong python

    --
    *''I can't believe it's not a hyperlink.''
    1. Re:being python by masklinn · · Score: 2, Informative

      Not by far much, and Monthy Python based jokes are higly valued in Python the community and appreciated in python code/comments.

      --
      "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
    2. Re:being python by kfg · · Score: 0, Offtopic

      Who wants a Python Full Monty anyway?

      KFG

    3. Re:being python by Anonymous Coward · · Score: 0

      Eric_Idle++

    4. Re:being python by wmelnick · · Score: 1

      Sounds like a lot of spam to me.

    5. Re:being python by Zencyde · · Score: 2, Informative

      One of the programs associated with Python is called Idle (used for typing code and then running without any compiling, good for quick tests), this name comes from Eric Idle, who was on the cast of Monty Python.

      --
      What day is it? Could you please tell me?
    6. Re:being python by 19thNervousBreakdown · · Score: 2, Funny

      I knew there was a reason I didn't like Python.

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    7. Re:being python by masklinn · · Score: 1

      Hah, pythonistas don't want you if you don't appreciate the monty pythons anyway

      --
      "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
    8. Re:being python by Ksevio · · Score: 2, Informative

      The language was actually named that because of Monty Python so that's not far off: http://python.org/doc/faq/general.html#why-is-it-c alled-python

  3. Damn perl bashing by Anonymous Coward · · Score: 0, Informative

    Perl is as legible as the author makes it.

    By the way, you have fun with that whitespace requirement.

    1. Re:Damn perl bashing by Metasquares · · Score: 4, Informative

      It is a bit harder to be legible in Perl than in other languages, to be fair, especially if you use regexps (but then, they're not all that legible anyway to begin with). Still, you get used to it after a while and it becomes as easy to read Perl as any other language.

    2. Re:Damn perl bashing by pileated · · Score: 3, Insightful

      I don't think that it's harder at all to be legible in perl. It's just that unfortunately perl culture encourages illegibility. A great book that doesn't is Damian Conway's recent Perl: Best Practices. What a breath of fresh air to see someone say that perl ought to be legible. Sad to say I think that the things that brought perl to it's early prominence are also the things that have hurt it in the long run: the ability to do something complicated extremely quickly. Unfortunately this seems to have encouraged "clever" programmers, who use every clever perl trick in the book. All that cleverness has become part of perl culture.

      Oddly enough I'm reading a book on Applescript right now (not because I really want to but because I need to write some fairly complicated scripts in it.) The book reminds me of perl in it's early days when it says how easy it is to do something or how Applescript magically does something for you, like understand whether you're in a string or math context. This seems good to beginners. But it the long run I think if lends itself to muddled code. There's just a little too much congratulations to each language for it's cleverness (and perl definitely is clever).

      As far as Python goes god knows I tried to read either Programming or Learning Python but I just gave up. It just didn't hold my interest at all. Give me Java, or legible Perl any day!

    3. Re:Damn perl bashing by mollymoo · · Score: 1
      Perl is as legible as the author makes it.

      And we all have to work with bad programmers some time or other. Of course none of us are bad programmers, it's always the other guy.

      By the way, you have fun with that whitespace requirement.

      Oh, I do. The idea freaked me out a bit at first, till I realised that my code and any other legible code I've ever seen was formatted like that anyway. Now I tend to look at all those {}s in other languages as ugly, redundant and little more than an opportunity for poor code layout to cause confusion. Humans look to indentation to define blocks of code when reading it, why shouldn't the language too?

      --
      Chernobyl 'not a wildlife haven' - BBC News
    4. Re:Damn perl bashing by Anonymous Coward · · Score: 0

      So in what way are regexps more legible in languages other than Perl?

      Ever written a syntax parser? With Perl I can do it in a couple of pages. In some other language, apparently people don't bother, because they all tell me I need to use XML.

      Sad that Python can only feel like a real programming language (TM) if it kills Perl.

      And, no, Python cannot replace Perl. Evar. Too much stuff is already written in Perl and works perfectly.

      Why not aim for Bash? Now *there* is a painful, illegible, finicky language. Oh it's the most universal programming language other than C? What a pity. Bash is what made me learn Perl, and Perl is a perfect replacement for Bash, I can tell you. But, it's never going to kill Bash, and I can live with that.

      Python people, learn to live with the fact that the world isn't going to switch to Python. If you can't learn syntax, then Python is all you will ever know, and it will limit you. If you can learn syntax, you will eventually see the beauty of Perl. (Hint Hint - try a syntax-highlighting programmers editor, and try applying the same whitespace obsession that you apply to Python, and magically you may find meaning within the cryptic heiroglyphs. Oh, and a try reading a book ....

      Leonard Cohen's Aunt

    5. Re:Damn perl bashing by Travis_Tennies · · Score: 1

      Great comments. And you explained perfectly why Perl should NOT be used in a business application. It's just a waste of time trying to modify/upgrade large amounts of Perl code. (Could take 20 to 200 hours, sir.) This is one big reason Python is taking over. ;) Sounds like an excelent book, BTW. I'll add it to my collection.

  4. Civilization IV is Python and XML by TheDoctorWho · · Score: 0, Interesting

    'mazing ain't it?

    1. Re:Civilization IV is Python and XML by AuMatar · · Score: 2, Informative

      No it isn't. The AI scripts are. THe engine is C++.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    2. Re:Civilization IV is Python and XML by Zathrus · · Score: 4, Informative

      No it isn't. The engine and the AI are written in C++. All of the game scripts (map generation for example) and interface is in python, all the game data is in XML, and it's highly modable.

      The AI can be reprogrammed in C++ using their API. See Question 6. I'm not positive that it's been released yet though.

  5. Totally fresh in programming by Nichotin · · Score: 4, Interesting

    I hope this is not modded off topic. Here goes:

    I am probably not the smartest person in the world, and I have no programming experience what so ever. What I am looking for, is some easy language to either script or program. Would python provide a good starting environment? Have any of you been at my level, then learned python?
    I have tried to do as much research as possible myself, but it seems that everyone I ask just woke up one morning, and found themselves to be able to program three or more languages (in other words, they do not remember how they started out). I have also tried to learn several languages by reading some O'Reilly books and similar, but I have been put off by the seemingly academic english that is used (my native language is norwegian, by the way).

    If anyone have any recommendation, as tho where to start, I would be more than happy.

    1. Re:Totally fresh in programming by LionKimbro · · Score: 2, Insightful

      I have tried to do as much research as possible myself, but it seems that everyone I ask just woke up one morning, and found themselves to be able to program three or more languages (in other words, they do not remember how they started out).

      Ha!

      Insightful.

      Yes, yes, true.

      I skilled up when young, by typing in programs from the back of Family Computing.

      I don't know what to tell "kids these days."

      Entering computer programs, by hand, worked well for me.

    2. Re:Totally fresh in programming by Colonel+Panic · · Score: 4, Informative

      I would check out How To Program by Chris Pine. It's very much for people who have no programming experience.

      Also, for a very different, novel and fun approach you should check out Why's Poignant Guide to Ruby . Did I mention it was fun? It's also a great intro for someone who has never programmed before.

    3. Re:Totally fresh in programming by Just+Some+Guy · · Score: 5, Informative
      What I am looking for, is some easy language to either script or program. Would python provide a good starting environment?

      Absolutely! I think it's one of (if not the) best languages for new programmers. My main reasons are:

      • It has a very simple syntax.
      • The core language is relatively tiny - there aren't many keywords that you have to learn just to get started.
      • It is strongly, dynamically typed, which means that you can spend more effort on telling your program what to do rather than the nitpicky details of how to do it.

      Opinions will vary, of course, but I think that Python is an excellent choice to start with.

      Have any of you been at my level, then learned python?

      Nope. When I was at your level, I had to learn a lot of really awful languages because the average person didn't have access to the nice ones. I would have loved having something so easy to learn and powerfully expressive at the same time.

      --
      Dewey, what part of this looks like authorities should be involved?
    4. Re:Totally fresh in programming by JTorres176 · · Score: 2, Informative

      Python was the very first language I used to learn to program. I had multiple people telling me to start with python, so I perused over to their site, picked up a few online tutorials to go through, and started building a library of python books.

      It helps because I can write one program for Linux, it works on my Windows PC with minor mods, and even works on my wife's Palm with similiar minor mods.

      Python is a platform independant object-oriented programming language. It's great to learn, and it's great to start your learning with.

      --
      Evil Walrus >83=
    5. Re:Totally fresh in programming by Rei · · Score: 4, Informative

      Actually, yes, I would definitely recommend it. I started programming before Python (actually started in Basic because it was the only thing I had in 7th grade, then ran as quickly as I could away from it to a real language). However, python is a very easy language to learn and you don't need to deal with any advanced concepts to "make things work".

        * You don't have to declare variables
        * Code blocks are simply based on how you indent, making it always very legible
        * You can easily see what functions are available in a package using dir(), and you can get brief help information on a function by print function.__doc__, from within any python shell.
        * Very simple to do things that might take a long time to in lower-level languages - reading contents of files, splitting strings, performing regular expression matches, etc.
        * Performance is tolerable for most applications - just don't try to write Quake or physics calculation software in it.

      --
      The *special* hell.
    6. Re:Totally fresh in programming by DaveInAZ · · Score: 1

      I'm not familiar with Python (which is why I was reading this) but, if you have to modify it, even a little, every time you port it to a new operating system, you can hardly call it "platform independent". The very definition of platform independence is that you don't have to modify the app.

    7. Re:Totally fresh in programming by engagebot · · Score: 3, Insightful

      Also interesting to note that many universities start students programming in C. The reason they do is because they want computer science students to get a good understand alot of what's going on in the background, not just learning a specific language.

      The kicker: If you understand the principles behind it, you can easily learn any language.

      You probably want to skip alot of the theory behind data structures and whatnot at the beginning though.

      --
      Han shot first.
    8. Re:Totally fresh in programming by gabe824 · · Score: 4, Informative

      My first language was C, learned in a first year university introductory programming course, but when friends have asked me about learning programming I have recommended they start with python and the book How to Think Like a Computer Scientist: Learning with Python http://www.ibiblio.org/obp/thinkCSpy/. Its available free online. This is a good introductory book with no expectation of prior experience that teaches the ideas behind programming, not just the syntax of the language.

    9. Re:Totally fresh in programming by Just+Some+Guy · · Score: 3, Insightful
      if you have to modify it, even a little, every time you port it to a new operating system, you can hardly call it "platform independent".

      Out of curiosity, what other language qualifies as platform independent by your definition? Answer: there isn't one. In the context of what we currently have, today, in 2006, Python is just about as platform independent as anything else.

      --
      Dewey, what part of this looks like authorities should be involved?
    10. Re:Totally fresh in programming by T.i.m · · Score: 2, Interesting

      Two years or so ago I made a CS master thesis where I tried to find / create the perfect language and IDE for learning to program. I did a pretty thoroug study of what is available and what is desired in such an environment. And i came to the conclusion that Python is very close to a perfect place to start learning programming.

      I starred to make som tweas in the environment and the language but "Unfortunatley" I got a job right after I finished so I didn't have time to finish the projec. In case someone is interested, more information and a manhandle beta can be found at:

      http://www.gahnstrom.se/tim/pystarter/

      Tim

      --
      Question authorities
    11. Re:Totally fresh in programming by CoderBob · · Score: 2, Informative
      Like some have mentioned, Python is a great place to start learning. It's platform indpendent (point #1), object-oriented (point #2), and not VB or Java (points 3, 4, 5, 6, and 7.)

      My hatred of Java and VB aside, however, I would add this: Once you get a good grasp of how to program in Python, it would be time to cut your teeth on a lower-level language. C or C++ would work here. It's going to be a little rough, as you get used to the different requirements, but you'll learn a lot more about Comp Sci.

      Also, and this could possibly go before you learned C or C++, you may wish to take a look at design patterns once you get the basics down. Addison Wesley has an excellent book on patterns here (No, there is no referer BS in the link) which I encourage you to look at.

    12. Re:Totally fresh in programming by Budenny · · Score: 1

      Revolution.

    13. Re:Totally fresh in programming by Cro+Magnon · · Score: 1

      It also depends on the specific program. I have a small Perl program that runs as is on Linux, OSX, and XP. It's portable. But I also remember having to tweak another Perl program between Linux and FreeBSD. A very small tweak, but still a tweak.

      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
    14. Re:Totally fresh in programming by Anonymous Coward · · Score: 1, Insightful

      My recommendation is pick up a beginners PHP* book. Start writing code it in as soon as you pick it up. Just as you read, write code. Once you've finished with that book, make 1 or 2 medium projects for yourself and try coding them until you feel fairly familiar with the language. Once you do that, pick up an intermediate or advanced php book and read that. Then go back to your code for the projects you did for yourself and rewrite it or write on top of it. You'll soon see how not only to write PHP, but also how to write rewritable code as well as maintable code. Rinse and repeat.

      * You can replace PHP with any other language. Although I recommend PHP just because it's a fairly simple and widely used language.

    15. Re:Totally fresh in programming by bcrowell · · Score: 2, Insightful
      And i came to the conclusion that Python is very close to a perfect place to start learning programming.
      I've used python as a language to teach people programming (in the context of a physics course, to do numerical simulations). It was OK, but the significance of whitespace was a major barrier for them to overcome. If I was doing it over again today, I'd probably use Lua, which has a very standard C-like syntax. Another consideration is that it might be good to use a language that's small enough to run in a web browser.

      Python's strengths, AFAICT, are its pure object-oriented design and the large set of libraries available for it. IMO, neither of these are particularly important for teaching beginners to program.

    16. Re:Totally fresh in programming by RealProgrammer · · Score: 1
      I am probably not the smartest person in the world...

      First lesson: yes, you are. If you want to be a programmer, that's how you will start. You're the smartest, but you just don't know everything.

      What platform are you using? It makes a difference.

      I learned to progam (well, if you call it that) using BASIC on a TRS-80 Model II (with the 16K expansion, thank you very much!). The cassette tape storage would lose half my saves, so my devotion to backups was burned in.

      Just pick a language you can use on your own computer that has a "hello, world" program. That's what we call a simple program that just prints "Hello, world!" to your screen. Read the manual. Alter the program a little. Find other programs, and alter them a little. Eventually you'll get it.

      You might try Javascript. There's not much barrier to entry, and you can run it anywhere you have a browser.

      I found Python confusing at first, so I wouldn't recommend it to a raw beginner. Maybe for the second or third language.

      If the syntax (all the little braces and symbols and how they go together) is confusing, you might try BASIC on a TRS-80 Model II :-).

      --
      sigs, as if you care.
    17. Re:Totally fresh in programming by Jason+Earl · · Score: 5, Informative

      For the most part Python software written on one platform will work just fine on any platform with Python installed. Python is completely portable in that manner, and official Python interpreters are available for a ridiculously wide array of platforms. However, if you don't take that portability into account when you start writing your software it is pretty easy to write bits that won't work when you move them to a platform with significant differences. For example, Python has APIs that deal intelligently with the various path separators, line endings, etc. that folks that write software for various platforms deal with every day. However, it's fairly easy to ignore these tools and do things like hardcode 'c:\MyDirectory\' into your application.

      It is also possible to write Python software that uses third party Python extensions written in C or C++ that haven't been ported everywhere. Of course, this is possible in every "platform independent" language that I have heard of. It's certainly possible to do this with Java (witness IBM's SWT).

    18. Re:Totally fresh in programming by DaveInAZ · · Score: 0, Flamebait

      Well, thank goodness you already know everything. Saves me the trouble of answering when you answer your own questions.

    19. Re:Totally fresh in programming by Syris · · Score: 1
      ...and even works on my wife's Palm with similiar minor mods.

      Python for the Palm? Last time I checked, the only package available was Pippy, a long unsupported port of Python 1.5 to the Palm OS. Is that what you're using?

      A cursory google search did not turn up anything more recent.

    20. Re:Totally fresh in programming by Nichotin · · Score: 1

      My platform is mostly OS X and Linux, but I do have Windows available as well. I would like to start with something that works on at least two of these.

    21. Re:Totally fresh in programming by Anonymous Coward · · Score: 0

      I find myself in a similar situation. I would like to learn a language and do a little programming. Not to start a holy war, but I looked at Free Pascal, and it looked interesting. However, Python seems to be the response I see when somebody asks about a good first language.

    22. Re:Totally fresh in programming by Bogtha · · Score: 1

      I am probably not the smartest person in the world, and I have no programming experience what so ever. What I am looking for, is some easy language to either script or program. Would python provide a good starting environment?

      Absolutely. It's been used quite a bit for teaching purposes already, check out the Education special interest group for more information.

      Have any of you been at my level, then learned python?

      You won't find many experienced programmers who started out with Python, simply because it's relatively new compared with languages like C and BASIC. Don't get me wrong, it's been around about fifteen years, so it's not some experimental system, but in relation to other languages, it's quite new.

      I have also tried to learn several languages by reading some O'Reilly books

      It really depends on the type of O'Reilly book you have. The 'Nutshell' books are aimed at programmers who want to pick up another language quickly, beginners should probably have one of the 'Learning' books.

      --
      Bogtha Bogtha Bogtha
    23. Re:Totally fresh in programming by DaveInAZ · · Score: 1
      Wow! A genuinely intelligent response! I'm speechless. Fortunately, I'm not type-less. Thanks for the clarification.

      Silly me. I was thinking that the point of using a platform independent language was to create platform independent apps. Where do I get such absurd ideas? I guess I was foolishly giving that other guy too much credit.

    24. Re:Totally fresh in programming by Budenny · · Score: 1

      Should add, not free, but it has the most helpful mailing list there is. www.runrev.com

    25. Re:Totally fresh in programming by LetterRip · · Score: 1

      [QUOTE]I am probably not the smartest person in the world, and I have no programming experience what so ever. What I am looking for, is some easy language to either script or program. Would python provide a good starting environment? Have any of you been at my level, then learned python?[/QUOTE]

      For Blender, Python is our embeded scripting language. We have had a number of artists who came from knowing nothing about programming to writing some useful tools and scripts. It is very easy for non programmers to pick up. Also for experienced programmers, it makes things easy to do 'the right way' ie using the intuitive and correct data structure.

      LetterRip

    26. Re:Totally fresh in programming by Kesch · · Score: 1

      just don't try to write Quake or physics calculation software in it.

      It's funny that you mention physics calculations because I'm working in a group doing that very thing. We use python for 3d reconstructions of images formed from background radiation. However, we are looking at writing the math heavy portions of code as C extensions to get better performance.

      The original Quake would also probably work in python, but I'm guessing you meant Quake IV.

      --
      If this signature is witty enough, maybe somebody will like me.
    27. Re:Totally fresh in programming by Klivian · · Score: 1

      the significance of whitespace was a major barrier for them to overcome.

      If they are new to programming that is an absolute non-issue. Don't talk about whitespaces at all, it's totally unnecessary, just tell them to follow the block indenting. AKA everything having the same left margin belongs to the same code block. Use how lots of books displays their table of contents, with chapters and subchapters differently indented as an example.

    28. Re:Totally fresh in programming by Peter+La+Casse · · Score: 1
      Silly me. I was thinking that the point of using a platform independent language was to create platform independent apps. Where do I get such absurd ideas?

      I agree, it is absurd to think that platform independence is the only reason why somebody would ever want to use a language that supports it. Such languages often have other desirable features as well.

    29. Re:Totally fresh in programming by MilenCent · · Score: 1

      I started learning it to implement a computer game idea and I find that it really is easy to learn, although it's been difficult to find books on it.

      One thing to look out for though that caught me: class methods, when you define them, must have "self" as their first argument. You never use it when actually calling the method, it's just an invisible parameter that must be there first when you define it. There seems to be some technical reason for it, but I don't know what it is.

      I bring this up because it caught me for a day or two not long ago. Just trying to pass along the accumulated wisdom.

    30. Re:Totally fresh in programming by Baricom · · Score: 2, Interesting

      I know many others are going to cringe at this, but I would suggest starting with PHP. It's not traditionally taught as a first language, but I think it has some positive qualities that might make it useful.

      First, PHP shares much of its syntax with other popular languages today. It looks a lot like C*, Perl, Java, and JavaScript. The control structures, many of the operators, and other parts of the language are all remarkably similar. In my opinion, this will reduce your learning curve as you tradition to other languages.

      Second, PHP is ubiquitous immediately applicable. You can find it installed on almost any web server, and in a variety of other places. It is designed around being used to create web pages, but it's also rich enough to use it as a general-purpose scripting language without much trouble. Additionally, the core functions take care of many details you may not want to deal with right away, but it gets out of your way if you want to dig deeper into how everything works.

      For what it's worth, my learning path as a programmer was GW-BASIC to QBasic to Visual Basic to Perl. I started in elementary school by typing in programs from old children's books. I picked up OOP concepts from Visual Basic. Today, I do most of my programming in PHP, but I have a passing familiarity with Perl and to a lesser extent, Python.

      I know a lot of languages, but none very well :)

      The ability to do basic (no pun intended) programming is incredibly liberating. Good luck!

    31. Re:Totally fresh in programming by DaveInAZ · · Score: 1
      I agree, it is absurd to think that platform independence is the only reason why somebody would ever want to use a language that supports it. Such languages often have other desirable features as well.

      ROFL! What a maroon.

    32. Re:Totally fresh in programming by wplinge · · Score: 1

      Brainfuck

    33. Re:Totally fresh in programming by po8 · · Score: 1

      "It is strongly, dynamically typed, which means that you can spend more effort on telling your program what to do rather than the nitpicky details of how to do it."

      I'm not sure what the first part of this sentence has to do with the second. I like (good) static typing precisely because it saves me effort—I find out about my mistakes at compile time rather than runtime. See Nickle's type system for an example of what I like.

    34. Re:Totally fresh in programming by Chapter80 · · Score: 1
      Actually, "self" is a convention. It could easily be called "self1" or "this" or some other name. But use "self". This is one of those conventions that you do NOT want to stray from.

      The instance is automatically passed to your class function (for your convenience) so that you can refer to it. The only way to "catch" that parameter is to list "self" (or similar) in the parameter list. That's why it's there. It's always passed, so you have to list it first.

    35. Re:Totally fresh in programming by modmans2ndcoming · · Score: 1

      you don't learn anything about computer science from learning to program in a language, no matter how low level. CS is about theory, not about application.

    36. Re:Totally fresh in programming by captain_craptacular · · Score: 1
      * You don't have to declare variables

      IMHO this is a very bad thing for a beginner (or anyone really). I don't know how many hours I've spent diagnosing bugs in non-declarative languages that turned out to be due to the fact the variable != varaible. This can be alleviated by a decent IDE that will warn you, but in general I don't see this "feature" as a plus.

      int itemcount = 0;
      while itemcount
      print itemcount;
      itmcount++;
      end while
      welcome to an endless loop...
      --
      They who would give up an essential liberty for temporary security, deserve neither liberty nor security
    37. Re:Totally fresh in programming by Just+Some+Guy · · Score: 2, Insightful
      I like (good) static typing precisely because it saves me effort

      Many of us - both beginners and not-so-beginners - like dynamic typing for the exact opposite reason: things that would be errors in statically typed languages are perfectly acceptable in dynamic language. Implicit, pervasive polymorphism can let you create some very robust code in a relatively short amount of time. Writing "foo_int", "foo_string", "foo_float", etc. gets a little old, even if it does give you some explicit guarantees about the data you're manipulating.

      --
      Dewey, what part of this looks like authorities should be involved?
    38. Re:Totally fresh in programming by tdelaney · · Score: 1

      Not correct.

      *Instance* methods must have `self` (it can be renamed, but woe-betide any one who does so ;) which is the instance upon which the method was called.

      *Class* methods must have `cls` which is the *class* object upon which the method was called.

      *Static* methods don't have a mandatory first parameter.

      Class and static methods are called in the same way, but class methods have the class object passed to them while static methods don't. It's very rare that you'll want to use a static method, as class methods can do everything static methods can and more, but there are circumstances where you may prefer to. In any case, switching between them is transparent to calling code.

    39. Re:Totally fresh in programming by DaveInAZ · · Score: 1
      I think it depends on what you actually want to accomplish. Do you want to learn to program or do you simply want to achieve some more definite, practical goal? If it's the latter, Python would probably be a good starting point. It's small and easy to pick up, by most accounts.

      If you want to learn to program, I think it's probably not the ideal starting point for the very reasons that some other people are pointing out as benefits; it's (too) easy and does (too) much of the work behind the scenes where you can't really learn from it. I think you'd be better off learning Java, which requires more understanding of the fundamentals involved. If you're really concerned about your ability to learn (and you certainly don't need to be the smartest person on the planet to learn programming), take a look at one of the free tutorials, like; http://java.sun.com/docs/books/tutorial/index.html . If you can understand that, you've got nothing to worry about. And, while I like O'Reilly's "Nutshell" series, I'm not a huge fan of some of their other books, either.

    40. Re:Totally fresh in programming by neelm · · Score: 1

      Seems like you've got your answer from the other replies; yes python is a perfect place to start. The best reason is the interactive interperter; this is useful even after you've "learned" the language. Python is also able to help you learn coding methods, like Test Driven Development. Web, GUI, Networking, all in python, so when you're ready for those concepts, the stuff to do them is there.

      Eric Raymond wrote in How to be a Hacker (http://www.catb.org/~esr/faqs/hacker-howto.html) that you should learn Python first, then Java or C/C++ depending on where you want to go. He also recommends perl, because so much of it is out there, and LISP, because it will teach you to think differently.

      Eric also has some other python info on his site.

    41. Re:Totally fresh in programming by Jason+Earl · · Score: 2, Interesting

      The funny thing about cross-platform applications is that, until you have done a few, it is easy to make mistakes. This is especially true if the software in question is not entirely self-contained. Heck, Windows even has different file handling abilities than most other systems. In the real world these issues are thorny enough that most people don't really bother. After all, most applications only end up running on one architecture. In fact, most applications only end up running on a handful of machines. Python is easy enough to use that you quickly find yourself writing scripts that are not only custom to your machine, but customized to the way that you like to work. For example, I have a set of scripts that I wrote for altering the HTML versions of baen.com's ebooks so that they make slightly nicer plucker ebooks. Next thing I knew I had a script that logs into my account using my username and password, downloads all of the new books I have purchased, mangles them, and formats them as plucker ebooks. It then checks to see if there are any new free ebooks on baen's site and downloads and formats them as well. Lastly, it updates of list of "books to read" so that I can know which books are new and which books I have already read.

      Clearly, I am not the least bit interested in making sure that particular piece of software is portable. Why should I? I know perfectly well that for the forseeable future my home desktop will be a Linux box. I chose Python (over Java which I use professionally) because I knew that Python would get the job done in less time. HTTP transfers, zip files, HTML mangling, etc. are all things that Python does extremely well with a minimum of fuss.

      Basically, I use Python because it is fun. The fact that I can easily write portable software is part of what makes Python fun (it makes what can be a difficult job painless and easy), but it is only a part of what makes Python fun enough that I use it to mangle ebooks instead of mangling them by hand.

    42. Re:Totally fresh in programming by GalacticCmdr · · Score: 3, Interesting
      * You don't have to declare variables
      * Code blocks are simply based on how you indent, making it always very legible
      These are the two very reasons I dislike python. It is far to easy to have a typo cause problems in the use of a variable. Since you do not have to declare variables if you want striker, but instead fatkey in an increment to strikr then it becomes a problem that can be difficult to find.

      Second, any language that requires indenting to signify code blocks is in my mind a great step backwards to the days of Fortran. This makes code blocking too vulnerable to pretty printers and version control methods that may "adjust" indentation.
      --
      Programming: Its not just a job - its an indenture.
    43. Re:Totally fresh in programming by m50d · · Score: 1
      I've used python as a language to teach people programming (in the context of a physics course, to do numerical simulations). It was OK, but the significance of whitespace was a major barrier for them to overcome.

      Then it's a good thing they learnt it. There's nothing worse than programmers who can't indent. Seriously, you'd have to teach them to indent like that for C anyway, so what's the problem?

      Another consideration is that it might be good to use a language that's small enough to run in a web browser.

      Python does that too.

      Python's strengths, AFAICT, are its pure object-oriented design and the large set of libraries available for it.

      The clean syntax and readability are also major strengths, and the last in particular is important for beginners.

      --
      I am trolling
    44. Re:Totally fresh in programming by Anonymous Coward · · Score: 0

      Try Motley Pythons Flying Circuits

    45. Re:Totally fresh in programming by Rei · · Score: 1

      Yes, in a *production language*, you often want to have such code flag an error. In a *learning language*, the person has enough to learn about without having to deal with data types. Also, it keeps the code shorter without losing readability, which some would argue makes up for that deficiency.

      Python, by the way, would catch that error at runtime (if that were python code, which it isn't). You don't have to declare variables, but you do need to initialize them before they can be accessed (and that's only common sense). You can't just call "a=b" without ever having said what b is. But you can do "b=1", then "a=b", without ever having said what a was, because it doesn't matter what a was, if anything; it's equal to b now.

      --
      The *special* hell.
    46. Re:Totally fresh in programming by Fahrenheit+450 · · Score: 1

      And what does this have to do with static v. dynamic typing? You either need sketchy implicit conversions from on type to another, explicit conversions to (and possibly from) a single intermediate type, or repeated code for each of the different types. Static typing can handle this via means such as Haskell's type classes or good old fashioned algebraic types. E.g.


      type multi = Int of int | Float of float | String of string;;

      let multi_exp arg =
          let f =
              match arg with
              | Int i -> float i
              | Float f -> f
              | String s -> float_of_string s in
          exp f;;


      It's a bit more work than relying on implicit conversions, but generally speaking, much safer.

      --
      -30-
    47. Re:Totally fresh in programming by OctoberJones · · Score: 1

      Well, I haven't quite forgotten how I learned to program, but it was Fortran, Basic, Z-80 assembler, and C, so I don't really recommend that route. What I do strongly recommend for somebody who is just starting to learn programming, however, are Leo Brodie's two books on Forth: Starting Forth and Thinking Forth. It doesn't matter that you may never actually use Forth for any practical project. These two books can't be beat for teaching you how to think about programming. In the course of our lives we occasionally run into things that change the way that our brain works in a fundamental way. For me it was working hard at chess and learning Forth from these books. Check them out.

    48. Re:Totally fresh in programming by jtwJGuevara · · Score: 1

      As someone who can code in python, but not in C++, I found the GoF Design Patterns book to be a bit of pain to try and read. I would not recommend reading this before learning C++ or Smalltalk (the other language the book uses for examples).

    49. Re:Totally fresh in programming by AT · · Score: 1

      Python's strengths, AFAICT, are its pure object-oriented design

      Python is not a pure OO language. Yes, OO is built into the language in a clean and intuitive way (unlike IMHO perl), but it is possible to ignore it. Python also brings together the best features of functional programming languages (e.g. list comprehension), lisp-like languages (e.g. lambda expressions) and smalltalk (e.g. closures).

      I would rephrase that "Python's strengths, AFAICT, are it's multi-paradigm design"

    50. Re:Totally fresh in programming by slashdotnickname · · Score: 1

      Absolutely! I think it's one of (if not the) best languages for new programmers. My main reasons are:

      It has a very simple syntax.


      I agree with Python being one of the best, but nothing beats TCL's syntax as far as simplicity.

    51. Re:Totally fresh in programming by JTorres176 · · Score: 1

      Well, the programs itself don't need to be modified but sort of "tweaked" for usage on different systems. My latest little app written with tkinter doesn't actually need to have any changes to use the app itself, but saving files is different. Of course, with different file hierarchies, trying to save something to C:\Program Files\User\foobar.cfg isn't going to work in Linux, the same as saving to %HOME/.foobar.cfg isn't goint to work in Windows.

      Setting these variables to query the OS and modify parts of the save file really isn't something that I'd consider a major modification. There is no real "platform independant" programming language simply because each platform has minor changes that must be compensated for when it comes to complex functions, however python allows this transition to occur much more easily than any other language I've used IMO.

      To imply that Python is completely platform independant was a mistake on my part because there is no 100% independant language, however using the import function to import libraries to assist with many complex functions makes it easier to perform the task of making it operational on multiple platforms.

      --
      Evil Walrus >83=
    52. Re:Totally fresh in programming by stormcoder · · Score: 1

      It is easy to write cross platform apps in Python but it is just as easy to write an app that will never run on another platform without a lot of work. Just like anything else, you have to plan a head. ie. If you write an app to drive an ActiveX control you can count on it not running on a non-windows platform.

      I often have to write GUI apps that run on both Windows and Linux and doing it in Python is very easy when compared to C++ or Java.

      --
      Sorry my bullshit sensor overloaded.
    53. Re:Totally fresh in programming by MilenCent · · Score: 1

      ......okay, now I'm confused all over again. What is the difference between an instance and a class method declaration? The examples I've been learning from don't mention cls at all.

      Tell me, which is a class's __init__ method? All the examples I've seen pass self to that.

      And again, why does syn (the editor I use) mark self as a reserved word? Possibly a misunderstanding of how Python works on the part of its author?

    54. Re:Totally fresh in programming by JTorres176 · · Score: 1

      Pippy's sadly outdated, but I don't exactly need the 2.4.2 functionality in every little thing that I write. If it's something for personal use, it doesn't need to be all flashy with the latest-n-greatest bells and whistles but to perform a simple function (usually in CLI if it's for me)

      Heck, I'm not writing a PostgreSQL tie-in function for the Apache webserver running on a Tungsten E here. It was just a short little script to back up data onto a memory card when her battery gets low. Strangely enough, it's basically the same app I used to back up commercial servers on a daily basis until a recent rewrite about 2 months ago.

      --
      Evil Walrus >83=
    55. Re:Totally fresh in programming by Chapter80 · · Score: 1
      Actually, Python has routines that allow you to build a path and file name so that it *is* platform independant.

      You can create your path, without concern for whether the machine uses forward slashes or back slashes as separators, without concern for case sensitivity, etc.

      The trick to making the software platform independent is to USE the routines. As an earlier post said, of course you *could* write software that is NOT platform independent, but Python has modules that help you make your program platform independent - it's just a matter of using them! And if you use them, then you don't even need to do the "tweaks" that you mention!

    56. Re:Totally fresh in programming by Rei · · Score: 3, Insightful

      then it becomes a problem that can be difficult to find

      Only if you already have a variable called 'strikr'. Otherwise, you'll get a runtime exception. Not having to initialize variables is completely different from "all variables come pre-initialized to some value". If you type "a=b", b better be defined. It doesn't have to be *declared* (nor does a), but it must contain a meaningful value (which could be None - python has a concept of null).

      vulnerable to pretty printers

      Who would run some random code formatter on their code when it's not designed for their language? That's just idiocy. Even still, if it treats "4 spaces" in one place as the same as "4 spaces" in another, the code will still work - python just cares that you're *consistant* with your indentation. Meanwhile, with C/C++, you can shove the brackets almost anywhere and do the most bizarre indentation imaginable, and it's perfectly content with you - bad form.

      --
      The *special* hell.
    57. Re:Totally fresh in programming by calgaryjer · · Score: 1

      I just finished a two year programming diploma and the first language we learned was Python. Not only because it can completely resemble "pseudo-code" but it is great for learning the programming basics - a la "Hello World"...

      --
      Sig Nature
    58. Re:Totally fresh in programming by Anonymous Coward · · Score: 0

      ...even works on my wife's Palm with similiar minor mods.

      How? I've seen stuff from a couple years ago that didn't work too well. I haven't seen anything recent.

    59. Re:Totally fresh in programming by jma05 · · Score: 1

      Python would be fantastic for you.

      1.) Python's pre-cursor was ABC, a language for teaching kids to program.
      2.) Guido specifically targets Python this way as a general purpose language for everybody.
      (http://www.python.org/doc/essays/cp4e.html)

      This means Python devs debate a lot before adding any new feature that may not be completly consistant with the whole design of the language.

      I learned Python quite late and would not speak from experience about use as a first language but you may try these tutorials and see if you find them friendly.

      http://www.ibiblio.org/obp/thinkCSpy/
      (Quite Basic, despite that name, it is not *academic*)

      http://www.byteofpython.info/
      (Another well written one)

    60. Re:Totally fresh in programming by __aaclcg7560 · · Score: 1

      I don't know what to tell "kids these days."

      CTRL-C and CTRL-V from the Internet?

    61. Re:Totally fresh in programming by jma05 · · Score: 1

      I think you are confusing "strongly typed languages vs weakly typed languages" and "statically typed languages vs dynamically typed languages". Python is strongly, dynamically typed language. Your arguments apply to languages like early BASIC which are weakly typed with type coersion. Python clearly states you can't use one variable in place of another by raising an exception. However that cannot be detected by an IDE usually. Even for statically typed languages, not that many have IDEs that can put that wiggly line for you, just for the very popular ones (C#, Java etc).

      From personal experience, I never had any of these problems while using Python. However, I used to in my BASIC days.

    62. Re:Totally fresh in programming by petermgreen · · Score: 1

      suppose you do (and this is just to make a point its not intended to be any particualr language)

      counter = 1
      while counter 10 {
          do something..............
          couner = counter +1
      }
      in a statically typed language that is picked up at compile time. in a dynamically typed language you won't notice it until your app hangs at runtime and you'd better hope your in a situation where you can easilly attatch a debugger.

      and if its in a rarely called branch of an if and your testsuite sucks or perhaps the count is a sanity check and the loop usually exits early you may not notice the error for a while.

      forcing variable declaration converts a whole class of bugs to compile time errors. this is a very good thing!

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    63. Re:Totally fresh in programming by chromatic · · Score: 1

      That has nothing to do with the type system. Perl has a dynamic type system yet can catch those errors.

    64. Re:Totally fresh in programming by Just+Some+Guy · · Score: 2, Informative
      Ummm, Dude? Python is not strongly typed.

      Ummm, Dude, yes it does.

      Guido seemed to be discussing dynamic versus static typing, not weak vs. strong.

      --
      Dewey, what part of this looks like authorities should be involved?
    65. Re:Totally fresh in programming by petermgreen · · Score: 1

      if you don't have explicit declarations how can the language tell if the assignement to couner is a deliberate attempt to create a new variable or a typo?

      note: explicit declarations and dynmaic typing can be seperate but they usually seem to be seen together.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    66. Re:Totally fresh in programming by petermgreen · · Score: 1

      yeah until some of your students mix spaces and tabs............

      seriously a language that depends on stuff thats invisible in a normal editor sounds like it would cause the lab demonstrators hell.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    67. Re:Totally fresh in programming by Rei · · Score: 1

      And why wouldn't the person write +=1? I'll just ignore the fact that they're not using for loops, because there are actually realistic reasons in "do something" that one might not want to.

      Present a more realistic example, please. You'll find that you have to get somewhat convoluted before you can actually cause a problem. As someone who regularly programs in python, I don't think I've ever run into an error like that (now, "variable is not initialized" errors, I've had 'aplenty ;) )

      --
      The *special* hell.
    68. Re:Totally fresh in programming by chromatic · · Score: 1

      Explicit variable declarations don't have to include type annotations.

      Perl 5's declarations denote the scope of lexical variables, so if the compiler hasn't seen a declaration for a variable in that scope, it can give a warning. (For global variables, the compiler uses the heuristic of counting the number of occurrences of variable names. If there's only one, it's probably a typo.)

      I miss that behavior in both Python and Ruby.

    69. Re:Totally fresh in programming by LionKimbro · · Score: 1

      Sure, sure, but:

      You do that, I don't think you're really getting the meat out of it.

      What I mean is: If it's just Ctrl-C, Ctrl-V, then it may as well just be "cp" or "copy".

      When you do it by hand, it forces you to review everything. And you make mistakes, and have to figure out where it went wrong, and how to fix it..!

      But I think the value, really, is seeing out the program works on the inside.

    70. Re:Totally fresh in programming by Anonymous Coward · · Score: 0

      Perhaps skip the theory, but I'm seeing most beginning CS courses skip a lot of the data structures themselves..

      Maybe those Chem majors and Math majors don't need to see hashes, structures, graphs and trees, but I don't know, when I learned them we could do more interesting things, sooner.

      Python is a good language for beginners, Its like the dangerous brother of Java.

    71. Re:Totally fresh in programming by i.r.id10t · · Score: 1

      Think about basic things, and boil them down to their most basic actions and decisions. Then write those out, and theres your psuedocode. Then pick a simple language like Python (trying to keep on-topic), php, bash script, etc. and get a good book or two on it. Then read up on real basics - variables (and data types), comments (put all your psuedocode at the top as a comment for reference), iteration, if-thens, and you should eventually get a moment of "a-ha!". Keep your written "code" handy while you RTFB. Then get a few more books, find some homework exercises, challenges, etc. from the intarweb relating to your language, and have at it.

      --
      Don't blame me, I voted for Kodos
    72. Re:Totally fresh in programming by Peter+La+Casse · · Score: 1
      ROFL! What a maroon.

      Actually, I'm white.

    73. Re:Totally fresh in programming by shaitand · · Score: 1

      "The original Quake would also probably work in python, but I'm guessing you meant Quake IV"

      Not if you tried to run it on the same computers that were originally used to play the original Quake.

    74. Re:Totally fresh in programming by jozeph78 · · Score: 1
      I went through a very similar experience less than 3 years ago. In my undergraduate degree (CIS) I took C++ classes, SDLC, a database class, assembly languages, a programming languages class... in the end I couldn't sit down and write a useful program. I could hardly write a productive query.

      In my graduate program I learned Java. I even took the condensed Java course and kept up but had a very hard time trying to apply what I knew, which discretely was the language itself. Sure we did file IO and sockets but did that prepare me for the distributed systems course wehre I had to write an HTTP Server? NO! While assigning variables and other syntactic elements were clear along with the concepts of opening a socket to send and receive data, applying it in a useful and concrete scenario were foreign.

      After a few other classes applying programming concepts it became more and more clear that the language you know doesn't mean you "know" programming. Now, after taking foundations of programming languages and getting cosy with EBNF notation, learning a language to an intermediate level is about a 2 week process (excluding bizarre transitions like my first functional language, In summary, try to do something with a language and learn the language along the way. You'll be much more productive learning a language when you are asking abstractly how is this done instead how is it done in this language. The truth is most all languages can do pretty much everything you'd need, manipulate files. I don't want you to think that formal education is essential it's just the path I walked. I was also concurrently doing my first programming job working in C#, VBS, and tons upon tons of SQL. Solving real work problems with programs will also helped to drive stuff home.

      In defense of the people who say they magically learned to program, it really is a foggy moment of enlightenment. Suddenly you realize you've written useful programs in 10 languages. At this point you realize the insignificance of the language. Beyond this point, you start to realize the significance of each language, but hopefully for the proper reasons (not I like python because it's uber!).

      --
      Ever done a `man` on `top` ?
    75. Re:Totally fresh in programming by burner · · Score: 1

      Not if you're considering a purely message passing language. Either a receiver can handle a message or not. No need for any sort of conversions.

      --
      MRSH-Recording device, corned beef sandwich with kraut, seafaring bird, and the foamy top of a beverage.
    76. Re:Totally fresh in programming by RalphTWaP · · Score: 1

      http://www.boost.org/libs/python/doc/

      You really don't mean C
      You really mean C++'s C-compatible subset

      Completely worth it for the boost-python interface

    77. Re:Totally fresh in programming by MrDomino · · Score: 0

      I hate to nit-pick, but it's worth noting that Lua is entirely platform-independent, requiring only an ANSI C compiler to build the complete interpreter and compiler set.

    78. Re:Totally fresh in programming by Coryoth · · Score: 2
      counter = 1
      while counter < 10:
          do something...
          couner = counter +1
      in a statically typed language that is picked up at compile time. in a dynamically typed language you won't notice it until your app hangs at runtime and you'd better hope your in a situation where you can easilly attatch a debugger.

      In some ways the confusion here arises from the fact that static types had benefits in optimization, and hence were necessary information for the compiler to parse correctly. At the same time static types are used as a means of checking (to a certain extent) the correctness of code. Because the compiler ends up doing the correctness checking because it needs to sort out the types it has become common to conflate compilation and static error checking into a single task, when really they are two quite separate tasks. What am I getting at here? That compiling or interpreting a program isn't really how you should be checking for correctness - it's nice but hardly necessary. If you ran python static correctness checking tool pychecker (which tries to statically catch many common errors) over that code it would throw a warning that "couner" was set but never used, happily catching the typo/spelling error. In fact if statically checking your code is important you'll find pychecker will catch a great many common errors for you.

      Now as to the separation of static checking and compilation - if you're willing to see that static checking is a separate task and devote tools to just doing that then you can do a whole lot better than just static types. Check out JML which, by adding extra annotations beyond just static type annotation, allows you to use far more powerful static checking like ESC/Java2 which makes standard static type checking via javac look as poor at catching errors as a dynamically typed language.

      Jedidiah.
    79. Re:Totally fresh in programming by Just+Some+Guy · · Score: 2, Insightful
      Python is portable, too. But it's still possible to write non-portable code, such as Windows programs that call COM objects, or Unix programs that create device nodes.

      Basically, if you stick with the core modules and don't hardcode pathnames or do other bad things, then your programs will be portable. Venture past that, just as with any other language, and all bets are off.

      --
      Dewey, what part of this looks like authorities should be involved?
    80. Re:Totally fresh in programming by achacha · · Score: 1

      Lua is not really like C and I always feel they went out of their way to design it to be just different enought to be annoying to C++ developers.

      Line comment:
      C++: // Lua: --

      Block comment:
      C++: /* */ Lua: --[[ ]]

      NULL value:
      C++: NULL Lua: nil

      Block:
      C++: directive { } Lua: directive end

      etc...

      They could have used same tags as C++ and made life a bit easier and concept more understandable.

      Python is a lot more powerful than Lua and the Python libraries are way more extensive. Just my opinion.

      I would recommend Python for beginners hands down.

    81. Re:Totally fresh in programming by youknowmewell · · Score: 1

      Though I might be modded down or flamed to hell, I'd recommend looking at http://www.gigamonkeys.com/book/ and check out Common Lisp. I'm just getting into it after playing around with PHP, and I am very excited to be learning a language so powerful but so simple to use and look at. The tools for coding in Lisp might not be the greatest (Emacs is the only editor that can be realistically used to code in it at this point), if you've got the patience that it takes to be a good programmer, you can do it. From what I've heard, Lisp can be used for simple scripting or hardcore programming. I believe it.

    82. Re:Totally fresh in programming by i_finally_got_an_acc · · Score: 1
      Aw knuckle up dude! The first step towards being an awesome programmer is to believe in your abilities. You remind me of a friend of mine. You'll never go far if you doubt everything you do. Just dive in and make some horrible mistakes. That's how you learn. Good judgment comes from experience, and experience comes from bad judgment.

      The second step is to adopt the attitude that you can never master programming. There will always be more for you to learn, so keep your eyes peeled. You can never stop learning.

      So what I'm saying is, grab Python and write some code. Dive in.

      --
      "I'm not religious, but at the same time I don't get why science always has to have something to prove."
    83. Re:Totally fresh in programming by tdelaney · · Score: 1
      Most editors that have a python mode will syntax-colour `self` as a keyword. It's not technically a keyword, but the convention of using `self` is so strong that it might as well be. `cls` as the first argument of a class method is also a strong convention, though not quite as strong yet as `self`.

      __init__ is an instance method. It is called passing the instance as the first parameter. It allows the instance to set itself up.

      __new__ (for new-style classes) is a class method. It is called passing the class object for which an instance is to be constructed. (The class object itself is an instance of another class - its metaclass - but you don't need to worry about that for now).

      So, for a new-style class, construction and initialisation is:
      instance = klass.__new__(args)
      instance.__init__(args)
      __new__ receives the `klass` object as it's first (cls) argument, whilst __init__ receives the `instance` object as its first (self) argument.

      Class methods are declared as:
      class A (object):
       
          @classmethod
          def method (cls, arg):
              pass
    84. Re:Totally fresh in programming by snilloc · · Score: 1
      In a *learning language*, the person has enough to learn about without having to deal with data types.

      Speaking as a person who attempted to use python as a learning language (but gave up due to more pressing projects), you DO need to deal with data types, and I am undecided about whether declaring the type might be beneficial, as has been suggested.

    85. Re:Totally fresh in programming by po8 · · Score: 1

      As I said, if you're used to older, restrictive static type systems, this is a real problem. Check out Nickle or ML or Haskell or Java 1.5 (formerly GJ). All of these languages have easy ways around the problem you cite. In any of these languages, it's actually challenging to write something that isn't statically type-correct but will work correctly at runtime. Nickle, in particular, tries to guarantee that any program that results in a static type error would have failed if it had been executed with only the runtime type system. Also, because Nickle has subtyping, you can simply type anything you don't care about as "poly" and the static type system will get out of the way.

      When I type
          string copies(string arg, int count) {
              string result = "";
              for (int i = 0; i < count; i++)
                  result += arg;
              return result;
          }
      and then accidentally say
          string s = copies(5, "foo");
      deep in some rarely-executed code, I really appreciate having the Nickle compiler stop me. And unless I make a mistake like that, Nickle really does get out of my way.

    86. Re:Totally fresh in programming by Jack9 · · Score: 1

      I taught myself to program 8 years ago. I know all the languages listed (to varying degrees...the middle stuff less than the top and bottom of the list)..

      I assume you know BASIC HTML.

      If you want to learn to program, learn scripting, learn PHP, use Apache if you can.

      If you want to learn about databases, learn SQL, use MySQL. SQL IS A MUST IN ALL LANGUAGES FOR THE FUTURE.

      You might get a job one day making scripts that make webpages with these skills.

      If you want to learn compiled programming, graphics, real applications, you want to try Python. If you took Pascal in school, you still need the graphics experience.

      If you find you want to make useful applications quickly and sloppily (read: Visual Basic), try RealBasic. I've made programs in 3 months in RealBasic (MSSQL backend) with 0 experience that I have _sold_. That's why VB got popular and why it's dangerous.

      If you can't take classes to learn C++ AND the Visual C++ development environment, try Java. They are similar kinds of pain. After your VC++ training you might get a job (ridiculous but true). After 2 Java classes you'll have a vague understanding of all the things a windows C++ programmer has to think about without being employable as a Java OR C++ programmer. Personally, I think learning Java hurts you nowadays.

      If you want to move on to something more progressive after you can bang out a database abstraction, a program that saves a screenshot of your own screen to the desktop, and can send a message to GAIM in a couple languages (one of which will be Python), try a concurrent language like erlang.

      P.S.
      I've written millions of lines of Java, but I can already hear real Java professionals coming at me.
      Met a girl at a bar tonite who has a (PHP) sticker on her Jetta cause that's what she does for a living. That's hot.

      --

      Often wrong but never in doubt.
      I am Jack9.
      Everyone knows me.
    87. Re:Totally fresh in programming by renoX · · Score: 1

      > Otherwise, you'll get a runtime exception.

      Only in some case let's see:
      striker = foo

      strikr = foofoo

      then use striker again which has the *wrong* value.

      This type of error happen.
      They're of course rare, they occur much less than single mistake only but still they do happen, and they're *very* hard to catch when you reread the file.

      So automatic variable declaration is quite stupid, personnaly I prefer Limbo way: use 'x := val' to declare and assign a variable of val type and x=y as simple assignment.
      To prevent programmers abusing := the language just has to forbid double declaration of variable.

    88. Re:Totally fresh in programming by renoX · · Score: 1

      > Otherwise, you'll get a runtime exception.

      (Grr stupid slashdot ate some of the text)

      The problem is that you'll get exception or warning only in some case let's see:
      striker = foo
      ( use striker )
      strikr = foofoo
      ( use strikr again due to copy/paste )
      then use striker again which has the *wrong* value.

      This type of error happen.
      They're of course rare, they occur much less than single mistake only but still they do happen, and they're *very* hard to catch when you reread the file.

      So automatic variable declaration is quite stupid, personnaly I prefer Limbo way: use 'x := val' to declare and assign a variable of val type and x=y as simple assignment.
      To prevent programmers abusing := the language just has to forbid double declaration of variable.

    89. Re:Totally fresh in programming by MacroRex · · Score: 1

      I don't normally participate in these kind of discussions, but maybe one should consider a bit further before throwing around assertive statements like this:

      I've written millions of lines of Java

      You do realize Java 1.0 was released in May 1996? If "millions" >= 2,000,000 then you just said you have written well over 500 lines of Java every single day for almost ten years.

      Now, I'm not unfamiliar with bouts when one can achieve productivity of over a KLOC a day, but that statement was just silly.

    90. Re:Totally fresh in programming by 6mullet · · Score: 1

      I am probably not the smartest person in the world, and I have no programming experience what so ever. What I am looking for, is some easy language to either script or program. Would python provide a good starting environment? Have any of you been at my level, then learned python?

      I was in a similar situation a couple of years ago. As a kid I'd played around with BBC BASIC but hadn't progressed very far and then proceeded to forget most of the little I had learned over the following decade. I eventually stumbled across Python and thought it might be interesting to have a play around and see how easily I could pick it up.

      The best place to start is the non-programmers section of the Python site. I found Alan Gauld's free book here particularly useful. He teaches a complete non-programmer to programme using several languages but with the emphasis firmly on Python. The book focuses on learning to programme rather than learning a specific language and is a great place to start. Several of the other tutorials linked from the Python site are also worth a look.

      Good luck and I hope you enjoy yourself as much as I did.

    91. Re:Totally fresh in programming by rmstar · · Score: 1

      Try out this book. Very nice. Head to #lisp on freenode to get help on how to install a Lisp environment.

      Lisp is a very nice language with very little notation to get confused about (you need an editor to help you with the notation, though). It was my first language, and I still love it.

    92. Re:Totally fresh in programming by bensch128 · · Score: 0

      Why is obviously completely insane. After reading most of the guide, I came away with more of an impression that Why is totally intraverted and nuts then the nuts and bolts of Ruby.
      (Maybe he puts the nuts into the "Nuts and Bolts of Ruby"...)

      Besides that, it is funny rambling....
      Cheers,
      Ben

    93. Re:Totally fresh in programming by MilenCent · · Score: 1

      Wow. I almost understood that, but....

      What are new-style classes? How do I make sure I'm not using self instead of cls by mistake, or the other way around? I take it that there's special syntax for "class methods" over "instance methods," but this is the first time I've even heard of a distinction. Maybe you should just point me to a site where I can read more about it myself, could be faster, hmmm.

    94. Re:Totally fresh in programming by xouumalperxe · · Score: 1

      I started off by programming lego robots with quickbasic (in those times, we had an ISA interface board for the 4.5V motors, and issued direct hardware commands for the stuff. I only fully understood that many years later, though). Then I hopped to pascal. Next came Mathematica, and then C. php came next. All of these were done at school/university in some fashion. After this I started self-learning python, perl, bash, sed, awk, and all those mini-languages that those powerful linux tools use. I also did Java and C# at some point in between, but both of those left a sour taste.

      If you want my opinion, one of the interpreted languages (python, perl or shell) is best. If you use linux, or are planning on it, I'd reccomend bash, on the basis that it's very very easy to use it to create productive things. On the other hand, I never really felt the desire to take it beyond the one-liner state, at which it is emminently useful. I can, and do, debug (at an elementary level) other people's shell scripts, so even basic knowledge is quite useful.
      for a more robust language, either python or perl would do. Which one depends on your personality. Amongst other things, it involves how orderly you are.
      If you are quite orderly, either will do. Just get disciplined in the ways of writing pretty code and go on ahead. If you are unorderly but see it as flaw, take up python. It'll make you become orderly. Or take up perl, and you'll learn soon enough how your unorderliness will bite your arse. If you are unorderly and like it, do perl. And pray to $DEITY that your own messiness doesn't bite you before you get a grip on programming.

      All in all, I'd leave C/C++ for later. When you grasp the basic concepts of programming, and understand high-level data structures that python/perl take for granted, you'll be in a fine state to start working downwards and understanding how those structures are built. Personally, I don't like Java or C#, irrespectively of the extensive frameworks they provide (which, make no mistake, are quite useful).

    95. Re:Totally fresh in programming by Anonymous Coward · · Score: 0

      I haven't worked with it, but you may want to have a look at pyrex. Allows you to declare and use C variables inline (with python syntax) and operations that only involve C vars will have C speed.

      Just a thought.

    96. Re:Totally fresh in programming by Sun+Rider · · Score: 1
      I'm a systems administrator, but every 3 years or so I need to write some relatively simple program for one reason or the other, so I'd rate myself as a permanent beginner. This time I needed to replace an older MS-DOS Foxpro-based system for barcode scanning and printing with something Windows-based, so after some research there were two languages that seemed to be the right ones currently in vogue, Java and Python. Java seemed to be overkill for a small project that might have to run in machines with little memory, so I settled for Python. I read the tutorials, and bought the book Windows Programming for Windows (O'Reilly).

      First thing is that there's no single package to download or buy from a single source like for example Visual Basic, ODBC database support needs some third party module (Egenix) which I'm not sure is free or not. The language itself is very nice, and I was quickly connecting to dbf files which was very hard to do in VB (remember I'm a beginner). Documentation was not very good for some things like scope of variables between modules, so it was trial and error in many parts.

      Since it's not included I had to find some package to create a Windows GUI, and wxPython seemed to be the way to go. Making screens was a nightmare, documentation is horrible and incomplete. Back to trial and error for every little thing I needed to add to the screens. Definetly nothing that can be recommended to a novice programmer that needs to create a GUI. It took me like a month or so to create simple screens with menus, text boxes, etc, and they're a pain to modify, and the needed code is very hard to understand, basically you need to copy examples from their tutorials and modify them by trial and error to make them work.

      I tried packages like Boa and Pythoncards, but the code they generated was very hard to integrate into my project mainly because of its complexity.

      Long story short, Python is probably an excellent language for beginners that plan to become professional programmers, but for programmers in companies where they need to do an ocasional database capture program, Python needs to be a more complete environment, something like Visual Basic. Remember that for every excellent Slashdot programmer there must be 50 to 100 people from other walks of life that need to write simpler programs for use at offices or at home. Whoever comes up with an environment that matches Microsoft's (for simple programs) will make a killing.

    97. Re:Totally fresh in programming by GileadGreene · · Score: 1

      Please do not confuse "static type checking" with "explicit variable declaration". They are two different things. Languages such as Haskell and ML have an extremely strong static type system. However, they do not require explicit variable declarations, because they use Hindley-Milner type inference to determine the type of variables and functions.

    98. Re:Totally fresh in programming by Chapter80 · · Score: 1
      You do realize Java 1.0 was released in May 1996? If "millions" >= 2,000,000 then you just said you have written well over 500 lines of Java every single day for almost ten years.

      Lots of comments and lots of blank lines. It was probably a "code" generator that cranked it out, and probably written in Python!

    99. Re:Totally fresh in programming by Eivind+Eklund · · Score: 1
      At least I find that I make so few errors that would be caught by a static type system that the costs of static typing (especially when used with type declarations) usually aren't worth the hassle - type declarations getting in the way of refactoring, expanded code size, etc. This will vary by programmer and by environment, of course.

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
    100. Re:Totally fresh in programming by Jack9 · · Score: 1

      My last program was over 400,000 lines, written over one summer. This was the project that taught me that USB drives are UNRELIABLE. Coded alone. Some line generated by Eclipse plugins (get/sets), some blank lines some brackets and declarations, etc. Outside of design time, I write 6 lines a minute in Java (which is SLOW work) on average...2000 work hours in a year, do the math. I have met AMATEUR programmers who program slower and faster than me to varying degrees.

      At best, your comment is unnecessarily critical, at worst, plain ignorant. I wonder where you are coming from. Millions of lines of code is nothing extraordinary.

      --

      Often wrong but never in doubt.
      I am Jack9.
      Everyone knows me.
    101. Re:Totally fresh in programming by Anonymous Coward · · Score: 0
      I have programmed in Java, JavaScript, C++, C, and Python.

      You could beat this dead horse until it is a bloody mess, but don't waste the energy

      **Everyone now is going to go off on their particular rant about forced whitespace usage, static vs dynamic, blah blah blah... Ignore it for now, come back to it later if you choose.**

      Python is a good language that has a great tutorial section and active peer support. It also has its limitations vs. other languages (Perl & Regular Expressions come to mind). In short, since no one language makes everyone happy start with Python and make up your own mind in a year or two...


      Here is a quick program I wrote to double click on all my downloaded Webshots pictures in Python:

      import os
      import re
      import time
      Directory = "c:/Program Files/Webshots/Archive/2005/2005-12/"
      FileList = os.listdir(Directory)
      FileList.sort()
      Count = 0
      for FileName in FileList:
      CompleteFileName = Directory + FileName
      print "Executing FileName = " +CompleteFileName
      os.startfile(CompleteFileName)
      Count = Count + 1
      time.sleep(5)
      print str(Count)+ " files executed"
    102. Re:Totally fresh in programming by po8 · · Score: 1

      As I said, if you're using a reasonable language, the "hassle" is exceptionally low. Type declarations shouldn't "get in the way of refactoring": quite the opposite. Once you have type guarantees on something, you can rearrange or reuse it with confidence that it won't go wrong at runtime.

      As for "I find that I make so few errors that would be caught by a static type system", I think you might be surprised. If not, you're a truly exceptional programmer; one in a thousand, if not one in a million. At any rate, I've never met your like, and I teach programming for a living.

    103. Re:Totally fresh in programming by Eivind+Eklund · · Score: 1
      Most static typists are very very afraid of runtime. Runtime isn't a problem. The question is if the bug is hard/takes time to find and fix; getting it at compile time help a little compared to getting when I run my tests, of course. However, even in the abscense of unit tests I very often catch errors *before* compile/start time, from reading the diffs my own changes. With tests, I get the errors when I run the tests (as I usually don't diff before running tests.)

      I think you might be surprised if you checked out how few type errors you get when you're used to programming without them.

      Of course, it might help that I've been used to programming without them on machines where my entire environment crashed and I had to wait ten minutes for a restart of the OS if I made a serious error, or that I've been used to work on software where a single cycle error somewhere would mean I'd have to get the oscilloscope to find out what the heck was up with the timing, or (very very very seldom) an error in my algorithm could mess up sensitive hardware, or (more frequently) corrupt my filesystem and force me to reinstall the entire machine from backup. It's amazing the number of ways you can mess up while doing file system programming and still not lose your data, BTW. Starting programming at 8 and having programmed professionally for two decades probably hasn't hurt, either (though my error rate is somewhat higher now than it was at one point, it's very seldom anything a type checker would take - it's minor algorithmic errors.)

      Anyway, I don't make many type errors. My guesstimate (from observing and thinking about my errors compared to static types) is that I - at the moment - get about 5% of my errors from something where a static type checker could catch them. Well over 90% of these again are trivial bugs to fix, even without unit tests. With unit tests, these problems have always been easy to fix - as easy as a compiler error, and with about the same machine time involved.

      I would expect that teaching programming didn't expose you to truly good programmer much? I'd expect it expose you to NEW programmers, and these days I would expect it to expose you to programmers that, if they have experience at all, have only programmed in memory protected environments. Environments that don't blow up in any way if you make an error...

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
    104. Re:Totally fresh in programming by tdelaney · · Score: 1
    105. Re:Totally fresh in programming by justaaron · · Score: 1

      From the opposite point of view that you were looking for (how does one start out),
      I made my living for years writing software, and I'm also not sure what it was like to not know how to write software.

      However, I've been out of the software business for five years now, and I'm no longer fluent in any programming language. For that reason I use python when I need/want to do a bit of programming.

      Based on my experience I believe python to be an excellent language (as many will agree).
      Based on my infrequent need, I can still be productive in python without having to crack the books over much.

      If you think you'll be doing a lot of web work, and you'll be doing it on a hosting service (instead of your own machine), then php might serve you better. Otherwise I enthusiastically recommend python.

      --
      aaron@justaaron.com
    106. Re:Totally fresh in programming by captain_craptacular · · Score: 1

      My argument has nothing to do with types. I don't care what type foo and fo0 are. I'm saying is that if you think you're type foo and you really type fo0 and the complier doesn't bitch about it, you can and will end up spending a bunch of time trying to find out why fo0 = null even though you know damn well you just populated it 2 lines before.

      Get my drift? The point is you typo the variable, and instead of being warned you basically just made an entirely new, and empty variable. But since the compiler doesn't give a crap, you're going to have to manually scan all the code and find the typo.

      --
      They who would give up an essential liberty for temporary security, deserve neither liberty nor security
    107. Re:Totally fresh in programming by captain_craptacular · · Score: 1

      I responded to a different but similar comment already, but... My comment doesn't have anything to do with type. Basically what I'm trying to say is in non-declarative (you don't have to specifically declare variables) languages, it's easy to typo variable names and not know you did it.
      String FOO; /* "EFF"+"OH"+"OH" */
      FOO = 'BAR';
      if (FO0 == 'BAR') /* notice that this FO0 = "EFF"+"OH"+"ZERO" */
      {
      print('This will never print and the compiler won''t tell you why');
      }

      --
      They who would give up an essential liberty for temporary security, deserve neither liberty nor security
    108. Re:Totally fresh in programming by MilenCent · · Score: 1

      Ah, thanks much

    109. Re:Totally fresh in programming by WilliamSChips · · Score: 1
      nothing beats TCL's syntax as far as simplicity.
      Lisp. Or Forth. But TCL is close.
      --
      Please, for the good of Humanity, vote Obama.
    110. Re:Totally fresh in programming by MacroRex · · Score: 1

      Yeah, it was probably a mistake to consider that most people do other things than write code every waking moment. My "best" is about 100,000 lines in three months, but that was written in office hours only, ie. 7,5h a day, 150h a month. From this I know how it is when one gets into the "zone", but I also know how difficult it is to maintain such productivity much longer. Maintaining it for 5+ years... Well, on paper it's possible and I guess such people exist, but calling it not extraordinary is funny :)

    111. Re:Totally fresh in programming by sjames · · Score: 1

      Performance is tolerable for most applications - just don't try to write Quake or physics calculation software in it.

      A really nice thing about Python is that once you have it working, it's dead simple to replace a few performance critical functions (such as the inner loop of your computation) with C.

    112. Re:Totally fresh in programming by sjames · · Score: 1

      Meanwhile, with C/C++, you can shove the brackets almost anywhere and do the most bizarre indentation imaginable, and it's perfectly content with you - bad form.

      Syntactically meaningful indentation is probably the most controversial issue with Python. When I first tried it (coming from C) I questioned the wisdom of that myself. What I actually found was that most C programmers reading over code actually use the whitespace as the primary visual cue and may or may not even notice the braces. It makes sense for the visual cue and the syntactically meaningful feature to be the same thing. That is, in practice, Python's use of indentation doesn't cause any more problems than any other way to define blocks.

    113. Re:Totally fresh in programming by sjames · · Score: 1

      but it is possible to ignore it.

      Given sufficient determination, it is possible to do old-school procedural coding in any language. Just like it is possible to write object oriented code in C. When C++ came out, a LOT of C programmers treated it as a C compiler that understood // and accepted default parameter values.

    114. Re:Totally fresh in programming by sjames · · Score: 1

      The real value of Python as a teaching language would come in later. OO is well designed in Python, and the introspection available lets you show what OO does 'under the hood' (e.g. print MyObject.__class__, MyObject.__dict__).

    115. Re:Totally fresh in programming by jma05 · · Score: 1

      Yes! I get your drift now :-). My bad.
      I agree with your point, that this can be confusing for a *newbie* (I think I had those experiences in BASIC and Python does not help here either) though rarely for an experienced programmer.

    116. Re:Totally fresh in programming by jma05 · · Score: 1

      A followup.

      There are static analyzers for Python that track these errors.
      PyChecker
      PyLint

  6. Devouring? by MosesJones · · Score: 5, Informative

    Python seems to be devouring everything these days... even replacing Perl

    From Dice.com

    Python : 545 matches
    Perl: 3809
    C#: 3850

    Ummm over 1/8 of the demand of Perl or C#

    Java: 11856

    Java+BEA: 621

    So Python is smaller than one specific application servers development requirements.

    Python is better than Perl, but in terms of devouring? Its like saying that American Football is devouring other sports around the world.

    --
    An Eye for an Eye will make the whole world blind - Gandhi
    1. Re:Devouring? by GigsVT · · Score: 4, Insightful

      That's not a good measurement.

      Those are unfilled jobs. Jobs that they couldn't find someone for without resorting to advertising. In other words, the jobs that get listed on job sites are the ones that no one wants.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    2. Re:Devouring? by blackmonday · · Score: 1

      I wouldn't use dice.com as a tool to measure Python usage.

    3. Re:Devouring? by Anonymous Coward · · Score: 1, Insightful

      It said devouring, not devoured ... meaning it is all
      about dynamic grouth.
      Do the same query one more time in a month and then
      compare numbers. Ones that change faster are the ones
      that deserve "devouring" attribyte.
      Pretty sure, Python will be one of them

    4. Re:Devouring? by Anonymous Coward · · Score: 0

      No actually that is Nascar...

      number one spectator sport in the world

    5. Re:Devouring? by Decaff · · Score: 1

      I wouldn't use dice.com as a tool to measure Python usage.

      Then what would you use?

    6. Re:Devouring? by Reality+Master+101 · · Score: 4, Interesting
      Just to make another useless-but-interesting experiment, I tried the following: Google for:
      "written in python": 665,000 hits
      "written in perl": 1,140,000 hits
      "written in c": 1,500,000 hits
      "written in c++": 772,000 hits
      "written in c#": 342,000 hits
      "written in java": 1,750,000 hits
      "written in haskell": 33,600 hits
      "written in lisp": 61,400 hits
      "written in pascal": 51,800 hits
      "written in objective c": 26,800 hits
      "written in ruby": 120,000 hits

      I'm not sure what this measures, but it's interesting. :) Python actually did a lot better than I expected.

      --
      Sometimes it's best to just let stupid people be stupid.
    7. Re:Devouring? by Anonymous Coward · · Score: 0

      American Football is devouring other sports around the world.

      Bad comparison, because American Football is not superior to for instance soccer.

    8. Re:Devouring? by Decaff · · Score: 1

      It said devouring, not devoured ... meaning it is all
      about dynamic grouth.
      Do the same query one more time in a month and then
      compare numbers. Ones that change faster are the ones
      that deserve "devouring" attribyte.
      Pretty sure, Python will be one of them


      I like and use Python, but this just doesn't make sense. You can change as fast as you like, but unless you have significant presence, you can't seriously be said to be 'devouring' anything!

      Otherwise I could declare that COBOL is devouring everything because last week I saw 3 jobs and this week I saw 10. Look at that growth!

    9. Re:Devouring? by Decaff · · Score: 5, Insightful

      Python is better than Perl, but in terms of devouring? Its like saying that American Football is devouring other sports around the world.

      You are forgetting that this is the Slashdot Universe, where...

      "Java/Intel/Oracle/Sun/Windows is dying..."

      "No-one uses commercial UNIX..."

      "Open Source is GPL and anything else is evil.."

      "PHP scales for everything...."

      and...

      "Favourite open-source language [fill in the blank] is the future and everyone is already using it...."

      When in this Slashdot dimension, you have to understand the rules!

    10. Re:Devouring? by smallpaul · · Score: 2, Insightful

      Job descriptions trail language popularity because they are driven by the need to replace people who were working on pre-existing projects. If every programmer decided to day to switch to Intercal, that wouldn't seriously show up in the job postings until a few years from now when the code needs to be maintained.

    11. Re:Devouring? by Anonymous Coward · · Score: 0

      It means that Java, Perl, and Python (in that order) are the top three languages not in Visual Studio.

      Java has way too much marketing, so its rank is almost certainly higher than it should have been. Perl and Python are on roughly equal footing as far as marketing, and Python has more than half as many hits as Perl.

    12. Re:Devouring? by plams · · Score: 1

      "written in brainfuck": 463 hits

      I'm sure it measures something!

    13. Re:Devouring? by Anonymous Coward · · Score: 0

      Hahahahahahaha!!!!

      You need to get out more!

    14. Re:Devouring? by killermookie · · Score: 3, Interesting

      "written in php": 2,190,000 hits

    15. Re:Devouring? by belmolis · · Score: 2, Interesting

      Here are the current Freshmeat statistics. The numbers are the number of projects in the specified programming language. I've omitted those with fewer than 10 projects. They probably give a fairly good idea of the popularity of programming languages if you take into account the bias toward the Free Software world. In the MS Windows world Visual Basic, for example, would no doubt rank much higher. Also note that these are cumulative over the past 6 years or so.

      C 7863
      Java 4567
      C++ 4077
      Perl 3569
      PHP 3529
      Python 2234
      Unix Shell 852
      JavaScript 634
      SQL 475
      Tcl 455
      Objective C 321
      Ruby 289
      Assembly 238
      C# 217
      Scheme 127
      PL/SQL 88
      Delphi 83
      Lisp 83
      Fortran 69
      OCaml 63
      Ada 62
      Common Lisp 60
      Emacs-Lisp 60
      Haskell 58
      Pascal 56
      Awk 46
      Zope 46
      ASP 40
      Visual Basic 37
      Eiffel 33
      ML 32
      Basic 31
      Smalltalk 31
      YACC 30
      Cold Fusion 27
      Forth 24
      Lua 23
      Erlang 21
      Object Pascal 20
      Prolog 20
      Pike 14
      Rexx 13
      Modula 10

      For the scripting languages, Perl and PHP lead, followed by Python, then Javascript, then Tcl. Ruby still isn't that popular on Freshmeat, and Lua, REXX and Pike hardly register.

    16. Re:Devouring? by Russ+Nelson · · Score: 1

      you realize, of course, that you just increased the hit count for each of those strings, meaninglessly.
      -russ

      --
      Don't piss off The Angry Economist
    17. Re:Devouring? by Russ+Nelson · · Score: 1

      You forgot "Open Source is not Free Software", as long as we're listing silly ideas.
      -russ

      --
      Don't piss off The Angry Economist
    18. Re:Devouring? by Decaff · · Score: 1

      I don't see how this is any better or worse than Dice. It simply shows what Freshmeat developers use. Who knows how that relates to developers in general?

    19. Re:Devouring? by saltydogdesign · · Score: 1

      In combination with Dice, I think it is fair to say a relatively clear picture is emerging.

      --
      // This is not a sig.
    20. Re:Devouring? by belmolis · · Score: 1

      It's better than Dice as a measure of what programmers like since the language of a Freshmeat project will generally be chosen by the programmers while that of a job offered on Dice will generally be chosen by the employer. We also have some idea, albeit an imperfect one, of how it relates to what developers in general use, precisely because of the orientation of Freshmeat to Free Software. As I said, in the MS Windows world some differences would be predictable, e.g. a much higher usage of Visual Basic.

    21. Re:Devouring? by Decaff · · Score: 1

      OK - how about this?

      http://www.tiobe.com/tpci.htm

      Seems reasonable to me - shows Python has significant popularity.

    22. Re:Devouring? by Decaff · · Score: 1

      We also have some idea, albeit an imperfect one, of how it relates to what developers in general use, precisely because of the orientation of Freshmeat to Free Software

      We do? I'm not sure anyone has a good idea of the relationship of Free Software to general use.

      I'm not saying this is wrong (although I suspect it overstates use of C as a general language), just that it is hard to tell.

    23. Re:Devouring? by Naum · · Score: 2, Interesting

      "written in COBOL": 43,100
      "written in REXX": 809
      "written in CLIST": 168
      "written in scheme": 34,900
      "written in RPG": 700
      "written in FORTH": 10,900
      "written in objective-c": 26,700
      "written in WFL": 5
      "written in tcl": 106,000
      "written in bash": 24,000
      "written in korn": 480
      "written in smalltalk": 20,400

      And finally...
      "written in curses": 40

      --

      AZspot
    24. Re:Devouring? by Cylix · · Score: 1

      I did some searching of my own...

      Written in blood: 258,000
      Written in water: 24,900
      Written in heaven: 77,000
      Written in hell: 555 (not as popular as heaven)
      Written in lies: 47
      Written in truth: 700 (much higher then I would have thought)
      Written in house: 52,600
      Written in nature 616

      So from this I can conclude the following statements are true. People prefer heaven over hell and they are obviously trying to keep the lying down. Unfortunataly, no one wants to leave the house much. Thankfully, blood is still thicker then water.

      --
      "You should always go to other people's funerals; otherwise, they won't come to yours." -- Yogi Berra
    25. Re:Devouring? by Breakfast+Pants · · Score: 1

      Insightful? I'll leave it as an exercise to the reader to find the glaring logical fallacy in the parent post.

      --

      --

      WHO ATE MY BREAKFAST PANTS?
    26. Re:Devouring? by pilkul · · Score: 1

      WTF are REXX, CLIST and WFL? Well, at least I'm not the only one who's never heard of them.

    27. Re:Devouring? by mooingyak · · Score: 1

      Where I currently work, we have several job openings.

      They're not open jobs because no one who already works here wants to do them.

      They're open jobs because they are either skillsets that we don't have, or the people who do have them don't have enough hours in a day to do as much as we need done.

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
    28. Re:Devouring? by Klaruz · · Score: 1

      Java+BEA is a python job, at least if you have any sort of exposure to WLST, their scripting tool for running weblogic servers that based on jython.

    29. Re:Devouring? by Britz · · Score: 1
      "PHP scales for everything...."

      http://developers.slashdot.org/article.pl?sid=02/1 0/29/2052239

      That was the story about Yahoo making the switch to PHP. There might be a couple large scale apps out there that are bigger than Yahoo, like Google or Wallmart. So Your assumtion is right. But for most things I imagine PHP to work OK.

      Btw. I heard that Google does a lot in Python.

    30. Re:Devouring? by Anonymous Coward · · Score: 0

      What about "written in fortran": 209,000 hits, you insensitive clod?

    31. Re:Devouring? by Decaff · · Score: 1

      "PHP scales for everything...."

      http://developers.slashdot.org/article.pl?sid=02/1 0/29/2052239

      That was the story about Yahoo making the switch to PHP. There might be a couple large scale apps out there that are bigger than Yahoo, like Google or Wallmart. So Your assumtion is right. But for most things I imagine PHP to work OK.


      There seems to be a common Slashdot belief that 'my favourite language [whatever... python/ruby/php/perl] is so powerful that it can be used for absolutely anything and those people paying for big expensive UNIX boxes and using Java are just SO silly....'. PHP scales for some things, but for other things it doesn't. This is true for any language.

      Btw. I heard that Google does a lot in Python.

      Yes. They also do a lot in Java, in C++, in all sorts of things....

    32. Re:Devouring? by Lairdsville · · Score: 1

      My results for java were:
      "written in java": 2,880,000
      Not sure how you got 1,750,000...

    33. Re:Devouring? by Decaff · · Score: 1

      Java has way too much marketing, so its rank is almost certainly higher than it should have been.

      Ah, right. Because the only possible reason that all those developers use Java is because of marketing. We are all just so gullible.

      Talk about being condescending to others who don't share your opinion of languages!

    34. Re:Devouring? by Tzarius · · Score: 1

      "written in brainfuck": 885

      masochism at work?

    35. Re:Devouring? by Chapter80 · · Score: 1
      ...AND Google hired Guido (creator of Python) back in December (see earlier Slashdot story).

      Not sure it's significant, but it's on topic, so I thought I'd throw it in.

    36. Re:Devouring? by The+OPTiCIAN · · Score: 1

      written in visual basic 27,700,000

      Poor fools! :)

      --


      Believe with me, my saplings.
    37. Re:Devouring? by archeopterix · · Score: 1
      "written in php": 2,190,000 hits
      It must be phrases like "I wouldn't touch anything written in php with a ten foot pole !"

      Just kidding.

    38. Re:Devouring? by GigsVT · · Score: 1

      It looks like a more reasonable ranking, closer to what I expected. Their methodology is still a little questionable, but it's much better than going on job listing numbers.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    39. Re:Devouring? by Paradise+Pete · · Score: 1

      What, no written in stone? (257,000, apparently just losing out to blood.)

    40. Re:Devouring? by jwdb · · Score: 1

      You forgot quotation marks...

      "written in Visual Basic" - 357,000
      "written in C" - 2,750,000

      Go C Go!

    41. Re:Devouring? by Elad+Alon · · Score: 1

      "written in English" - 1,740,000 hits.

      --
      News for merdes. Shit that matters.
      Ask me about my sig.
    42. Re:Devouring? by yuretz · · Score: 1

      hmmmm.... 1,700,000 for "written in English" - it's even less then in php. Can someone explain it?

    43. Re:Devouring? by trouser · · Score: 1

      written in blood: 42,500,000 hits.

      --
      Now wash your hands.
  7. On a related note... by Just+Some+Guy · · Score: 2, Informative
    For a quicker introduction to the language, you might look at the article I wrote for Free Software Magazine. It's not an in-depth analysis by any means, but should get you acquainted with the basics in under 10 minutes.

    It's licensed under the Creative Commons "Attribution-Share-alike" License, so feel free to pass it around if you want to.

    --
    Dewey, what part of this looks like authorities should be involved?
    1. Re:On a related note... by d474 · · Score: 1

      Who the hell modded parent -Offtopic? There are like 30 posts above this one on this very topic, so why single this one out? Wasted Mod, dude.

      --
      Authority questions you. Return the favor.
  8. Hmmm... by somethingprolific · · Score: 0, Offtopic

    Why would we need better written programs? I hope this posts... IE crashed 3 times

  9. Beginner, no programing experince! by rkeenjr · · Score: 0, Offtopic

    Is this the book for someone like me? If not anybody have a suggestion? RKeenJr

    1. Re:Beginner, no programing experince! by Colonel+Panic · · Score: 1

      How about How to Program by Chris Pine. I hear it's excellent for people who have no programming experience.

      Another good (and fun) choice is Why's Poignant Guide to Ruby . No other learning to program book has cartoon foxes.

    2. Re:Beginner, no programing experince! by Wisgary · · Score: 0

      When I was at borders yesterday I saw a book, I think it was from thompson that was for complete beginners with no previous programming experience. Lemme check to see if I can find a link... yes I found it, here's a link

    3. Re:Beginner, no programing experince! by rkeenjr · · Score: 1

      Saw that on your other post will purchase the First on in PDF tonight! Thanks for the insite!

    4. Re:Beginner, no programing experince! by Tachikoma · · Score: 1

      free pdf at www.diveintopython.org

      i'm half way through and think it's great. gives you examples upfront, and then walks you through step-by-step as to what your doing.

      --
      i don't care
    5. Re:Beginner, no programing experince! by juhaz · · Score: 1

      Of python specific literature, thinkcspy is probably the best suited for absolute beginner who hasn't ever written a line of code in any language.

  10. Before too many people post please read this! by Wisgary · · Score: 1, Interesting

    I was at borders yesterday and I saw maybe 500 books from O'Reilly, 500 more from thompson and 1,000 more from random publishers, please for the love of god someone help me out and name me some *good* python books for an intermediate programmer. Most of my experience is in C++ and I would like to learn a high level language like Python, so please name me some books and help me in this impossible quest at borders.

    1. Re:Before too many people post please read this! by warewolfe · · Score: 3, Informative

      I've had good experiences with O'Reilly in general, and with "Learning *", "Programming *", and "* Cookbook", where * has been Python, Perl, PHP. However, have a look at http://python.oreilly.com/ and download the free chapters and source code before you buy. For an intermediate level programmer you can probably do without the "Learning Python" book. Good Luck.

      --
      Then again, I could be wrong.
    2. Re:Before too many people post please read this! by kfg · · Score: 1

      You might want to consider:

      Beginning Python: From Novice to Professional

      Just a thought.

      Also check out the webpage Instant Python. Link in the first post along with links to books by the same author.

      KFG

    3. Re:Before too many people post please read this! by Wisgary · · Score: 0

      Oh I didn't know you could download chapters, that's awesome, I'll test a few and see what's good, thanks

    4. Re:Before too many people post please read this! by Wisgary · · Score: 0

      Yeah yeah I know about the review book, duh, just wanted more input, and yeah I'll also check out that link. Thank you.

    5. Re:Before too many people post please read this! by jcarter · · Score: 1

      Uh..

      Well..

      "Beginning Python: From Novice to Professional"?

      I hear it's pretty good.

      In case you have difficulty finding.. oh, I don't know.. a review of it, here's a link. Just click on it and scroll to the top:

      CLICK ME

    6. Re:Before too many people post please read this! by kfg · · Score: 1

      Sorry for being a smartass . . . well, not really, it's what I do, but the fact of the matter is the review book and the first post actually are my input.

      Didn't leave me much of any place to go but being a smartass.

      KFG

    7. Re:Before too many people post please read this! by Darby · · Score: 1

      I've been programming python for going on 2 days now ;-) I have a safari account on oreilly.com, so I've been using "Python in a Nutshell" and it's pretty quick and to the point. If you already have programming experience I highly recommend the * in a Nutshell books.

      the Learning * books are great for beginning programmers, but could be a bit slow and boring if you just want to pick up a new language.

    8. Re:Before too many people post please read this! by Anonymous Coward · · Score: 0

      Since you already know c++, I suggest "Python in a Nutshell". It's concise and requires knowledge of OO techniques but it covers the topic well without boring you. It's my favorite python book. ALSO: the FREE documentation that comes with the python distribution is actually very good and includes a tutorial and language reference. Before you spend hard currency, CHECK OUT THE FREE STUFF!

    9. Re:Before too many people post please read this! by belmolis · · Score: 1

      I found David Beazley's Python: Essential Reference more useful than the O'Reilly Learning Python. It isn't suitable for novice programmers, but for experienced programmers learning Python I think it is excellant. In spite of the title, it isn't simply a reference manual.

    10. Re:Before too many people post please read this! by Anonymous Coward · · Score: 0

      I concur with the beazley title. i carried around two python books for awhile. beazley and python cookbook.

      the cookbook sits at home now, but python essential reference goes with me everywhere. and it's the first printing. I'll probably splurge for the third printing/revision, but it won't contain all my notes. the tutorial in chapter 1 (all 11 pages) will have you programming in python.

      if you already understand the basics of programming, it is all you need.

    11. Re:Before too many people post please read this! by gbobeck · · Score: 1

      If you want to learn python, skip buying a book and instead read the documentation and tutorials over at the python.org site http://www.python.org/doc/2.4.2/ . I learned Python, Perl, TI Basic, Intercal this way.

      --
      Navicula hydraulica plena anguilarum est. Omnes castelli tuus nostri sunt. Ed elli avea del cul fatto trombetta.
    12. Re:Before too many people post please read this! by rusty0101 · · Score: 1

      I learned Python, Perl, TI Basic, Intercal this way.

      I'm impressed. I didn't know you could learn Intercal at the python.org website. I don't personally have a need for TI Basic, but Intercal might be usefull some day.

      Thanks for the pointer.

      --
      You never know...
    13. Re:Before too many people post please read this! by gbobeck · · Score: 1

      The Python people are multi-talented.

      My original post should have read "I learned Python, Perl, TI Basic, Intercal by going to their various sites and reading their tutorials and documentation." To the best of my knowledge Python.org does not have documentation for perl, ti basic or intercal.

      --
      Navicula hydraulica plena anguilarum est. Omnes castelli tuus nostri sunt. Ed elli avea del cul fatto trombetta.
    14. Re:Before too many people post please read this! by rusty0101 · · Score: 1

      Oops, I forgot the sarcasm marks. I do agree in general that many languages, as well as many of the tools to support different platforms are best learned by going to the website of the developer, or searching any of a variety of resources on the Internet for FAQs about that subject. No it is not infaliable. Perl, and Python are very good examples. Others may vary by any of a number of reasons.

      Some of the very best explanations of how some things work have been created not by the originator of that thing, but by people who wanted to make use of it, but didn't initially understand how. I have seen a recomendation for someone to start an FAQ by writing the questions that they had down, then writing potential answers to those questions, and posting the resulting document. The reason this supposedly is effective is that you start getting feedback from people who know more about each individual question, and can revise the FAQ with their explanations (properly attributed) as well as taking any questions that they may include in their response. You then release a revised FAQ.

      Initially the revisions may come out every hour or so, then daily, then weekly, for perhaps a year every month. At some time you declare that you are no longer going to maintain the FAQ, and off it goes to the archives. One reason for no longer maintaining the FAQ may be that the platform that the FAQ was designed to address may have moved on in such a way that a large portion of the questions, or explanations are no longer valid. It may also be that no one is using what the FAQ addresses.

      Other reasons may exist as well, perhaps the maintainer has moved on to a platform where the original tool is not available, or is suplanted by tools that are superior in some way. As an example I used 4dos as a replacement for my command.com interpreter in Dos. When I moved to OS/2 I switched to a combination of cmd.exe and REXX. That took care of most of what I had been using 4dos for. Since moving primarily to Linux I use Bash almost exclusively. I didn't write a FAQ for 4dos, but had I been maintaining one, I would probably have dropped it by now.

      Thanks for the response. It looks like it was taken in the good humor it was intended.

      -Rusty

      --
      You never know...
    15. Re:Before too many people post please read this! by gbobeck · · Score: 1

      I figured that there were sarcasm tags in there, but I felt that I had to protect the internet idiot hordes from their own stupidity. :-)

      I remember one OSS developer/team lead telling me in one of my classes that the best way to learn something is to answer questions about it. This is how he ended up learning enough about the nuts and bolts of Gentoo Linux to become a team lead.

      Of course, you can learn Python the same way I did... take Markup Languages at Loyola University Chicago with Dr. George Thiruvathukal. Our first assignment in that class was to literally learn and become Python experts within a week.

      BTW, Dr. Thiruvathukal has written a Python book (Web Programming in Python: Techniques for Integrating Linux, Apache and MySQL).

      --
      Navicula hydraulica plena anguilarum est. Omnes castelli tuus nostri sunt. Ed elli avea del cul fatto trombetta.
  11. O, yeah? by Anonymous Coward · · Score: 3, Insightful

    "And, unlike Perl, it's very easy to do complicated things in simple, legible code."

    Perhaps it is time for you to get a perl book or take CS-101 course or something.

    1. Re:O, yeah? by Anonymous Coward · · Score: 0

      more likely, perl just behaves assininely and python just makes sense. I've been at my job over a year, and I'm forced to program in the attrocity that is perl.

      Some things which don't work in the manner one might consider obvious...

      spacing to allow for readability
      my @my_array =
      (
        (
          (a, b), (c, d)
        ), (
          (e, f), (g, h)
        )
      ); #is actually (a, b, c, d, e, f, g, h)

      myfunction (@my_array, @my_array)

      sub myfunction(@@)
      {
          my (@a, @b) = @_; #most languages just let you do this in the prototype, but perl makes you type extra lines...
          #@a = (a, b, c, d, e, f, g, h, a, b, c, d, e, f, g, h)
          #@b = ()
      }

      #now lets assume for fun sake that, @my_array did initialize correctly. I call
      #this "array splatter", as
      #it's like dropping a soft object from a good height onto a solid surface...

      my @second_array;
      my @{$second_array[1]} = @{$my_array[1]}; # (a, b, c, d) is the result, not ((a, b), (c, d))

      I'd even take sparc or x86 assembler of perl were it an option

    2. Re:O, yeah? by Anonymous Coward · · Score: 0

      No dude,

      "my @my_array =
      (
          (
              (a, b), (c, d)
          ), (
              (e, f), (g, h)
          )
      ); #is actually (a, b, c, d, e, f, g, h)"

      is simply
      @a = 'a'..'g';
      But that is clearly not legible and requires a clue :)

    3. Re:O, yeah? by KDR_11k · · Score: 1

      Is a equivalent to 'a'?

      --
      Justice is the sheep getting arrested while an impartial judge declares the vote void.
    4. Re:O, yeah? by Just+Some+Guy · · Score: 4, Insightful
      "And, unlike Perl, it's very easy to do complicated things in simple, legible code."

      Perhaps it is time for you to get a perl book or take CS-101 course or something.

      I've got both. So, tell me: what's the syntax for returning multiple complex objects from a function in such a way that they don't have to be dereferenced by the calling code (that is, they can be used directly, just like you were returning a single scalar)?

      Python example from the interactive shell:

      >>> def foo():
      . return {'one': 'ein', 'two': 'zwei'}, lambda x: x + 5, str
      >>> a, b, c = foo()
      >>> a['two']
      'zwei'
      >>> b(5)
      10
      >>> print c.__doc__
      str(object) -> string

      Return a nice string representation of the object.
      If the argument is a string, the return value is the same object.

      I'm not overly stupid, but doing something so relatively easy in Perl put me at my limits. I like Perl, and I've written many large programs in it, but I always had to fight against the syntax. Python got out of the way and let me concentrate on logic instead.

      --
      Dewey, what part of this looks like authorities should be involved?
    5. Re:O, yeah? by Anonymous Coward · · Score: 0

      the problem is, there's structure to that array. It shouldn't be equal to 'a'..'g'. But perl kills the structure.

      and yeah, I forgot to quote my characters on this, but in the many pecies of code where I did stuff like this, the problem was for lack of coding, it was for lack of keeping array structures.

      The day I never have to see Perl again... Oh, it will be a beutiful day.

    6. Re:O, yeah? by Coryoth · · Score: 2, Insightful

      "And, unlike Perl, it's very easy to do complicated things in simple, legible code."

      Perhaps it is time for you to get a perl book or take CS-101 course or something.


      It is, I quite agree, entirely possible to write fairly simple clear legible code in perl. It does require a few extra hoops, but in general it isn't that hard, it just requires a fair bit of self-discipline or, if you're working in a team, some very rigid well defined coding standards ... that everyone sticks to. From my point of view, if you're at the point of bothering to have and enforce coding standards, why not just enforce them at the language level? The compiler/interpreter can then tell you whether you're meeting appropriate standards, and does a much better job of ensuring everyone actually conforms to a consistent interpretation of the standards. In effect that's what Python does to a certain extent (and you can also find it in other languages like Eiffel and Ada). I perfectly understand that such strict and required enforcement isn't always necessary or desireable - not every software project has maintainability and legibility of code as a primary concern, and if you're just coding by yourself obviously you'll always meet your own standards - but if you are serious about maintainability then, to my mind, language enforced coding standards and a certain amount of "one right way to do it" has real value.

      Jedidiah.

    7. Re:O, yeah? by Anonymous Coward · · Score: 0

      Well, that is obviously is not possible in perl (=5). So what. Dereference and move on. Many things can be done easier in Perl than in Python or some other language. The tool is just as good as your skill. Just because you cannot speak French/Russian/Insert-the-language-you-cannot-spea k does't make that language is not legible....

    8. Re:O, yeah? by chromatic · · Score: 3, Insightful
      ... if you're at the point of bothering to have and enforce coding standards, why not just enforce them at the language level?

      Because the language designer probably doesn't know as much about your team and the problems you're trying to solve as you do.

    9. Re:O, yeah? by Parity · · Score: 4, Insightful

      That's a really foolish argument. Of course you have to make references and dereference to do the same thing in perl, because perl is a pass by value language; python is a pass by reference language.

      In perl you have to be explicit to dereference.

      In python you have to be explicit to copy.

      Your case happens to be one where references are needed, and in python, implicit. In cases where copying of arrays is need, python needs to be explicit; perl is implicit. So ignoring the ridiculous 'without dereferencing' restriction:

      sub foo {
        return { 'one' => 'ein', 'two' => 'zwei' }, sub { my $x = shift; return $x + 5; }, "string"
      }

      my ($a, $b, $c) = foo();

      print $a->{'one'};
      print $b->(5);
      print $c;

      --
      --Parity
      'Card carrying' member of the EFF.
    10. Re:O, yeah? by Anonymous Coward · · Score: 0
      Translation:

      "I don't know how to do that, either, but Perl is teh 1337 so I feel compelled to defend it religiously."

    11. Re:O, yeah? by Just+Some+Guy · · Score: 1
      In perl you have to be explicit to dereference.

      In python you have to be explicit to copy.

      The problem I have with that is I can count the number of times I've needed to copy a Python object with one hand (and still have fingers left), but I seemed to be forced into dereferencing Perl objects all the dang time.

      So ignoring the ridiculous 'without dereferencing' restriction:

      Erm, no. I gave a fairly common real-life example of something most people would like to be able to easily do, but can't with Perl (without throwing more code at the problem). If you know of a similar problem caused by Python's structure, I'd be quite happy to look at it.

      --
      Dewey, what part of this looks like authorities should be involved?
    12. Re:O, yeah? by m50d · · Score: 1

      Doing things in legible code in perl does not count as "very easy". It requires significant effort, wheras in python it happens without thinking. Sure, you can write legible perl - but python's advantage is that unless you're actively trying not to, you *will* write legible python.

      --
      I am trolling
    13. Re:O, yeah? by Anonymous Coward · · Score: 0

      read output of 'perldoc perlref'

    14. Re:O, yeah? by Parity · · Score: 1

      Using {} instead of () or adding a -> is that much more code?
      (Never mind that I didn't write as tersely as possible... sub { 5 + shift } would've worked if you want 'less code').

      Python's problems mostly involve silent errors and unexpected value changes.

      If you have a function 'foo', you can have python code like,
          x = foo
      or,
          foo
      and python will go on its merry way without so much as a warning, though in the x = foo case you'll probably get an exception later on when you try to use x, depending on how you use it. (Of course, this is a side-effect of having easily accessible function references; x = func is meaningful, after all.)

      Worse are errors like,
        self.widgt = self.widget + 1
      which will silently fail to increase widget. This is a side effect of python trying to save programmers a little typing.

      Then there's all the issues that copy-by-reference can create - if you change it in one place it changes everywhere. Every python learning book has (or should have) a chapter on this and the differences between L = L + M, L.extend(M), and L.append(M).

      Anyway, in this area, basically, python does a lot of things implicitly. The programmer has to know what he wants keep clearly in mind the difference between a thing and a reference to a thing and what he needs, but what he writes will be 'clean' of any indication of that difference.

      Perl is much more explicit, and yes, requires a handful more characters. The programmer still has to know what he wants, of course, and keep things and references distinct in his mind, and what he writes will be 'cluttered' with notation to indicate which kind of thing he's working with.

      Perl of course, allows you to 'use strict;' and enforce variable declaration or not as you choose. Python does not offer that option.

      Anyway, I don't think that a default of pass by reference vs. pass by value is that big a deal. Now, perl has some strong advantages in text processing, especially powerful regular expressions. On the other hand, python's objects are vastly more usable than perl's. Those are areas where you can really distinguish the languages as having dramatically different powers.

      CPAN vs. Batteries Included of course is a very useful comparison, but one that could take us until the heat death of the universe to complete.

      --
      --Parity
      'Card carrying' member of the EFF.
    15. Re:O, yeah? by Anonymous Coward · · Score: 0

      the problem is, there's structure to that array. It shouldn't be equal to 'a'..'g'. But perl kills the structure.

      The problem is, you don't know perl syntax. Parens are for grouping, not structure. Use [] for nesting arrays, e.g.

      my @array = (
              [
                  a, b, [
                                    c, d
                              ],
              ],
      );

    16. Re:O, yeah? by Just+Some+Guy · · Score: 2, Interesting
      The reason that drove me nuts, though, is that you had to handle objects returned from a function differently than objects you created in the same scope:
      my ($a, $b, $c) = foo();
      print $a->{'one'};

      my %d = ('one' => 'ein', 'two' => 'zwei');
      print $d{'two'}

      Of course, you could always deference $a into another variable and access it that way instead, but that's the sort of "throwing extra code at it" that I meant.

      I'm not saying Perl is bad. A lot of people use it to do lots of things. For me, though, the warts eventually overwhelmed the pearls and I went looking elsewhere.

      --
      Dewey, what part of this looks like authorities should be involved?
    17. Re:O, yeah? by Parity · · Score: 1

      Oh, well, perl is certainly a lumpy language.
      Your particular complaint on different syntax isn't uncommon, and as a result there are a lot of people who always do,

      my $d = { 'one' => 'ichi', 'two' => 'ni' };
      print $d->{'two'};

      IE, using reference syntax even when you could've used the regular object. That way the syntax remains consistent whatever they're doing and they don't have to switch back and forth.

      Whether that's good or not, I couldn't say. It makes syntax somewhat more consistent but at the same time rather eliminates the whole point of decorating variable names (that is, to make the distinction between types visually obvious).

      (Although it still distinguishes it -as- a variable, which I like. I hate that I can't call a variable 'class' in python, because, of course, it's a keyword. In perl it's twice not a problem because class isn't a keyword, but even if it were, I could refer to '$class' without colliding with 'class'. In some hybrid of the two languages I could have 'class $class { stuff }'! But this is admittedly relatively trivial and every language has some problems with keyword conflicts. )

      --
      --Parity
      'Card carrying' member of the EFF.
    18. Re:O, yeah? by Anonymous Coward · · Score: 0
      IE, using reference syntax even when you could've used the regular object. That way the syntax remains consistent whatever they're doing and they don't have to switch back and forth.

      I don't understand why would you want, for every single variable in the code, know if it came from a function result or was locally created. Move out some code, and you have a lot of stupid maintenance to do. Why not add a special syntax to know if it is an integer, to know if it was aliased (referenced more one once), if it has been ever been copied, in which file it was first declared, which is the name of the function was created the value first, was it defined on a line with a line number odd or even, ... or a lot of overhead irrelevant most of the time.

      Similarily I never understood the real need or use of $, %, my, bless, ->, or whatsoever, for every single line of code of a program.

      As for 'use strict', the Python equivalent for programmers is pylint. It's free and it is stupid not to use it.

    19. Re:O, yeah? by Anonymous Coward · · Score: 0

      that's nice to know, though documentation on it was nonexistant or footnotes from what I've seen at CPAN and the books I've looked at (learning/programming by O'Reily).

      Also, why don't groupings nest? that would make sense. As I said, perl makes a lot of stupid decisions on how things work.

      And that doesn't explain why it fails with other array structures

      my @arr;
      $arr[0][0][0] = 'a';
      $arr[0][0][1] = 'b';
      $arr[0][1][0] = 'c';
      $arr[0][1][1] = 'd';
      $arr[1][0][0] = 'e';
      $arr[1][0][1] = 'f';
      $arr[1][1][0] = 'g';
      $arr[1][1][1] = 'h';

      my @arr2;
      @{$arr2[0]} = @{$arr[0]};
      #this is not [['a', 'b'], ['c', 'd']]
      #or [[['a', 'b'], ['c', 'd']]]

    20. Re:O, yeah? by renoX · · Score: 1

      > As for 'use strict', the Python equivalent for programmers is pylint. It's free and it is stupid not to use it.

      No, it isn't.

      foo = x
      ( use foo )
      fooo = y
      ( use fooo due to copy/paste )
      now use foo which has a bad value

      I doubt that pylint catch this, and in a sufficient big program, this kind of error will happen and is hard to catch.

    21. Re:O, yeah? by Anonymous Coward · · Score: 0
      foo = x
      ( use foo )
      fooo = y
      ( use fooo due to copy/paste )
      now use foo which has a bad value

      I doubt that pylint catch this, and in a sufficient big program, this kind of error will happen and is hard to catch.

      Your example is quite contrived because 1) you must copy the variable names by copy and paste and each time, not realize that there is a mistake AND you must use both foo and fooo AND you must assign to fooo before using it, 2) the variables in question are not attributes of objects.

      I've barely ever copied variable names by copy and paste, so this scenario never occured to me in 10 years, the "2)" shows that if you have a big program, and you will likely use OO (90+% of my code is in objects), this scenario is quite limited, basically it is limited to identify one single function or method which doesnt work.

      In any case, your contrived scenario isn't found by pylint indeed, so technically, pylint is not 100% equivalent to "use strict". However pylint will find other errors not found by strict, and Perl code will have errors not possible in Python, and Python code will have errors not possible in Perl...

    22. Re:O, yeah? by renoX · · Score: 1

      In a sufficient big body of code, this exemple is likely to happen and show the danger of automatic variable declaration.
      Sure pylint catch other errors but why allow this kind of 'hard to catch error' in the first place, that's a strange defense of a stupid scenario: a 'use strict' would be useful for python too.
      There are language in which variable declaration isn't hard to read: Limbo for example, Scala..

    23. Re:O, yeah? by Chapter80 · · Score: 1
      This is only my second python program, so excuse me if this is poor, but it seems like you could pretty easily force declarations as below. Not perfect (you need to assert any time you want to check to see what's not declared), but you can easily change the "assert not" to "print", and out spits your undeclared variables.

      Note, the Assert statement fails because "fo0" is not declared. 4 extra lines of code to handle the declaration set up, and one line to do your strict checking. As I said, I am a complete rookie, so no laughing.


      def declare(list):
      .... declarations.extend((list,)) #indent instead of periods
      declarations=["_[1]"]
      declarations.extend(locals().keys())


      declare("foo")
      declare("bar")


      foo=1
      bar=2
      fo0=3


      assert not [k for k in locals().keys() if k not in declarations]

    24. Re:O, yeah? by renoX · · Score: 1

      Interesting, it's true that Python or Ruby are quite flexible, so it should be possible to reinvent a 'use strict'.

      Thanks for the idea, I'm not sure if it's pratical but it is interesting.

    25. Re:O, yeah? by Anonymous Coward · · Score: 0
      In a sufficient big body of code, this exemple is likely to happen and show the danger of automatic variable declaration.

      Only if you cut and paste and are unlucky. And "self.fooo = self.foo + 1" will be caught by pylint. This means that that kind of error is limited to when you do this inside a single function, which makes it considerably easier to debug. Maybe it will happen once when you write 100,000 lines of code, but at standard rates of errors, you'll have about 1,000-3,000 bugs in those lines to start with.

      Sure pylint catch other errors but why allow this kind of 'hard to catch error' in the first place,

      Because it is not worth effort. Pylint is free, but declarations are not. There are about 10,000 other kinds of errors that can be made, so why bother uncumbering the code with declarative statements to eliminate just one of 10,000 kinds of errors?
      Why not enforce the Smalltalk feature of having to name all the arguments you are passing also, like such as "f(count=0, total=2)" instead of "f(0,2)", which definitly remove some bugs as well ?
      If you want to go all the way to it, you can also declare the types of each variable, then some assertions on the values of each variable (zero, non-zero, non-empty list, ...), then some invariants, then some logical properties ("if x == 0 then y != 0"), and you end up writing logical proofs on your programs, and slowing your development by one, two or three orders of magnitude, while indeed you will enjoy extraordinary low bug rate.

      I use Python for development speed, and freedom. The downside is that certain kind of bugs can be more frequent, while many features about readability, development speed, ... can remove directly or indirectly some bugs (writing a program in one day rather that one week, can limit logic bugs because you can remember better how things are structured).

      While you are busy writing cumbersome declarations catching just one of 10,000 kinds of errors, I'll write part of the test code which can catch not only this error, but also the 9,999 others.
      As for debugging code, because I write tests, and systematic debugging, it's ok - and it's my job to find where they come from, and indeed I found some bugs quite a little more obscure than that (including C++ compiler bugs, function call conventions incompatible between compilers, deep-hidden mmap performed inside an array of values, wrap-around when using non-aligned pointer on ARM processors [HA!], ...), some which required debugging the machine code.

      There are language in which variable declaration isn't hard to read: Limbo for example, Scala..

      I know. You could even define ":=" as the mandatory assignement to use when the variable at left does not exist and it would cheap to type. But when I code, I want the minimum number of irrelevant things to distract me, and this is one. In any case, it could be extraordinary easy to other ways as well in Python, and probably it has already been done, but I won't bother to do that 99% of the time, for the same reasons as I would have choosen Python over Java, C# or C++.

    26. Re:O, yeah? by renoX · · Score: 1

      > why bother uncumbering the code with declarative statements

      Well that's a cost/benefit choice but ':=' instead of '=' for declaration isn't a lot of clutter!
      And while mispelling which cannot be caught by compiler/pylint are rare, they're quite difficult to find: humans are not very good at distinguishing striker and strikr embedded among lots of code.

      I'm in favor of passing argument by name instead of position (for function having more than 1 parameter) : not only it helps making fewer errors while writing code, it is also quite good for readability (it works even for printed/mailed code, no need of an IDE), now should it be mandatory?
      That's a difficult choice.

      About the other thing you said: additionnal statements slow down writing code and add visual clutter so of course it's a tradeoff.
      But as said using ':=' instead of '=' slow down writing very little (only when you move existing code otherwise when you introduce a new variable you know it so it's not a problem) and it has basically no visual clutter, calling a function with parameter names instead of position: in both case you need to know the signature of the function to call it properly so it doesn't slow down the writing, sure it adds a little visual clutter but it also adds information for the reader so I consider it worthwile.

      About Freedom, sorry but it isn't Python's strong point: it's Perl's strong point and we all know how TWTDI can hurt code maintenability, Python is more about consistency.

      So it all depends on where you put the limit.

    27. Re:O, yeah? by Chapter80 · · Score: 1
      I took one more crack at it. It looks a little cleaner. I'm sure a Python Pro could write it even better (maybe trapping anytime locals() adds a key (meaning that you just added a new variable), so that you could trap that, and raise an exception if the variable being added isn't in the declarations list). But that's beyond my beginnner expertise.

      Here's my latest revision of a strict variable checker (released as free software; help yourself!)

      Two files: one a called strict.py, which you can import. Here is strict.py, a simple 3-line file:
      def declare(var): declarations.append(var)
      def undeclared(l):return [k for k in l.keys() if k not in declarations]
      declarations=["declarations"]+locals().keys()

      The other demonstrates how to use it:
      from strict import *

      declare("foo")
      declare("bar")


      foo=1
      bar=2
      fo0=3


      print undeclared(locals())
      assert undeclared(locals()) == None

      The output of the program is this:

      ['fo0']
      Traceback (most recent call last):
      File "C:\PythonProjects\junk\declare.py", line 12, in ?
      assert undeclared(locals()) == None
      AssertionError
      >>>

      As you can see, you can Print the undeclared local variables('fo0' is printed for you), and you can assert that there are no undeclared local variables (which will raise an exception, and potentially halt the program (if you want)).

      Pretty cool! OK, what other excuses are there not to try Python? ;)

    28. Re:O, yeah? by Anonymous Coward · · Score: 0
      Well that's a cost/benefit choice but ':=' instead of '=' for declaration isn't a lot of clutter!

      Yes it is. It distracts. You must think and know if it is the first assignment. It derails you from thinking exclusively about the semantics of the program. You will argue that the distraction is small. But the benefit is small as well. That small distraction alone, is guaranted to be an additional source of bugs, too. As any distraction would do.

      About Freedom, sorry but it isn't Python's strong point: it's Perl's strong point

      We are talking about different freedoms here. Perl makes you artificially free by offering many ways to do the same things - as any language do but more than any language. You are free to write either: (1 I'm talking about programming freedom, as in breaking free from hassles totally irrelevant to the semantics of the program you are writing. ':=' fits in that category as much of "my", "bless", "local", "$", "->", ... of Perl but also some good part of Python as well. ':=' expresses property of the program you are writing, but is irrelevant to helping you implement the semantics of the program. Think about it, if you had to write pseudo-code, will you write some ":=" and some "=" ? No, most of the time you will not, because it brings very little.

      As a programmer I've grown intolerant to the wasting of my precious concentration, for accepting having to focus on things which have nothing to do with solving the problem and implementing the semantics of the programs -- such as worrying about manually freeing memory for instance. This is freedom from hassles.

      That's why people say proudly Python is "executable pseudo-code" and why it is a good thing.

      So it all depends on where you put the limit.

      I put my limit, for superb sytems or for over-clever hacks designed to catch anywhere from one to 9,999 error out of 10,000, is at an extremely low level. The real important limit I care, however, is about readability - I accept to waste time and go through hops for improving readability.

    29. Re:O, yeah? by Anonymous Coward · · Score: 0
      Well that's a cost/benefit choice but ':=' instead of '=' for declaration isn't a lot of clutter!

      Yes it is. It distracts. You must think and know if it is the first assignment. It derails you from thinking exclusively about the semantics of the program. You will argue that the distraction is small. But the benefit is small as well. That small distraction alone, is guaranted to be an additional source of bugs, too. As any distraction would do.

      About Freedom, sorry but it isn't Python's strong point: it's Perl's strong point

      We are talking about different freedoms here. Perl makes you artificially free by offering many ways to do the same things - as any language do but more than any language. You are free to write either: (1<<16), 0x10000, 65556L, 256*256 in Python too. Or choose between "if x: f(y)" OR "x and f(y)". Or whatever.
      I'm talking about programming freedom, as in breaking free from hassles totally irrelevant to the semantics of the program you are writing. ':=' fits in that category as much of "my", "bless", "local", "$", "->", ... of Perl but also some good part of Python as well. ':=' expresses property of the program you are writing, but is irrelevant to helping you implement the semantics of the program. Think about it, if you had to write pseudo-code, will you write some ":=" and some "=" ? No, most of the time you will not, because it brings very little.

      As a programmer I've grown intolerant to the wasting of my precious concentration, for accepting having to focus on things which have nothing to do with solving the problem and implementing the semantics of the programs -- such as worrying about manually freeing memory for instance. This is freedom from hassles.

      That's why people say proudly Python is "executable pseudo-code" and why it is a good thing.

      So it all depends on where you put the limit.

      I put my limit, for superb sytems or for over-clever hacks designed to catch anywhere from one to 9,999 errors out of 10,000, is at an extremely low level. The real important limit I care, however, is about readability - I accept to waste time and go through hops for improving readability.

    30. Re:O, yeah? by Chapter80 · · Score: 1
      Grrrr...

      Change
      assert undeclared(locals()) == None
      to
      assert not undeclared(locals())

  12. I forgot to add by Nichotin · · Score: 1

    Sorry, but I forgot to add the obvious part: Why do I want to program/script? In the first place, I would like to just create some gadgets, like my own ncurses gentoo installer or something (not too fancy, just for my own systems), or some simple webapp, like a poll (can be done with python server pages, right?). Other than that, tools for automating system tasks, perhaps.

  13. Has to bash on Perl by Anonymous Coward · · Score: 2, Insightful
    And, unlike Perl, it's very easy to do complicated things in simple, legible code.

    This must mean you aren't able to write legible Perl code. Perl has been making complicated things simple for more than a decade. If you don't know how to write clean code, then your Python will also suck.

    1. Re:Has to bash on Perl by Myddrin · · Score: 5, Insightful

      And, unlike Perl, it's very easy to do complicated things in simple, legible code.

      This must mean you aren't able to write legible Perl code. Perl has been making complicated things simple for more than a decade. If you don't know how to write clean code, then your Python will also suck.

      Not directed at the parent, but at the Perl-snipping in the original post....

      <RANT>

      I'm a professional python programmer, and I've been making my living at it for a number of years now. (It was my embracing of python that allowed me to transition to a 100% MS free workspace.) I started using it a project a few years ago, and it's just stuck for a number of reasons. (meta-classes, extensibility, etc.)

      One thing that drives me buggy about some python evangelists, (and many evangelists, in general) is the need to bash anything that is not their favorite brand (be it Creative vs iPOD, Python vs (insert any language here). And so on. The fact of the matter is that Perl is a perfectly good language. I don't use it on a regular basis personally, but I've seen, read and understood a good deal of Perl code w/o a hassle. (yes, I've seen some scary code, but I've seen scary code in C++, Python, Java, etc., etc., etc.)

      Sometimes we just have to admit that there are multiple good tools that we could use, but we have a personal (and possibly irrational) preference for one over the other. That's life as a human being (which I'm assuming at least 99% of the readers out there are. :) ). Just because some people use Perl, doesn't make my choice of python (of C++, my other "main" language) any less valid.

      It's real life, not a multiple choice test -- there is no single "correct" answer.

      </RANT>

      Ok, I'm done... back to work.

      --
      Myddrin
    2. Re:Has to bash on Perl by Anonymous Coward · · Score: 0

      In my mind (though your post wasn't in reply to anything I said), it's not so much that I'm hardcore for any one language (though I tend to prefer C or PHP, and python does look good), of the 10 or so languages I know, Perl, I find is the easiest to write obscure code in, has some of the worst debugging messages (even with strict, warnings, and the one other that I can never remember, turned on), and it handles many things in a less than intuitive matter. I've had more than one case, where what should have been a simple same-type assignment, modified my data. And personally, in my mind, nothing is worse for readable code, than the reliance on $_, in all of it's invisible forms.

    3. Re:Has to bash on Perl by jtorkbob · · Score: 1

      Amen brother. Remember: A poor workman blames his tools, and a jaded programmer blames his predecessor's tools. Bad code transcends boundaries of language.

      for my $cliche (@$cliche_library) {
          print "$cliche\n";
      }

      --
      AC: Only on slashdot... could the sentence "My hovercraft is full of eels." be moderated "+4, Insightful
    4. Re:Has to bash on Perl by jcarter · · Score: 1
      C'mon.. just between us Perl programmers... it does tend to get ugly.

      I am a Perl programmer, and I'm still fascinated by the language after seven years using it. It's powerful, it's fast, it's conducive to creativity and fast design, it makes easy things easy and hard things possible.

      But it does tend to look like line-noise after awhile. Especially when you know all the tricks for things like writing a one-liner for reading your dog's mind.

      C'mon.. admit it. Perl is awesome, and it can be pretty. But it doesn't have to be, and it usually ain't.

    5. Re:Has to bash on Perl by mkcmkc · · Score: 1
      This must mean you aren't able to write legible Perl code.

      Not necessarily. It might mean that he's sick and tired of debugging the avalanche of horrid Perl that's already out there. (I know I am.)

      Perl has been making complicated things simple for more than a decade.

      Perl was definitely an improvement over what came before it. It doesn't follow, though that there aren't languages that are now definitely an improvement over it.

      If you don't know how to write clean code, then your Python will also suck.

      True, by tautology.

      --
      "Not an actor, but he plays one on TV."
    6. Re:Has to bash on Perl by m50d · · Score: 1
      This must mean you aren't able to write legible Perl code.

      Not at all. I can write perfectly legible Perl code - but it takes effort. I write legible Python code without thinking about how it works.

      Perl has been making complicated things simple for more than a decade.

      Simple, yes, but not in legible ways.

      If you don't know how to write clean code, then your Python will also suck.

      No it won't. That's the great thing about Python. It's possible to write illegible Python, but it takes a lot of effort. You can get someone who just brute-forces the code to do what it needs to do, without caring about how it looks, and their python will still be quite legible.

      One thing that drives me buggy about some python evangelists, (and many evangelists, in general) is the need to bash anything that is not their favorite brand (be it Creative vs iPOD, Python vs (insert any language here). And so on.

      The submitter is describing an advantage of python over perl, because python is often an alternative to perl for the same project.

      (yes, I've seen some scary code, but I've seen scary code in C++, Python, Java, etc., etc., etc.)

      I've never seen scary python that wasn't specifically trying to be obfuscated. And I've seen a far greater proportion of scary perl code than in any other language.

      --
      I am trolling
    7. Re:Has to bash on Perl by bhaskin · · Score: 1

      Well, ESR seems to agree with the reviewer here:

      "These problems combined to make large volumes of Perl code seem unreasonably difficult to read and grasp as a whole after only a few days' absence. Also, I found I was spending more and more time wrestling with artifacts of the language rather than my application problems. And, most damning of all, the resulting code was ugly--this matters. Ugly programs are like ugly suspension bridges: they're much more liable to collapse than pretty ones, because the way humans (especially engineer-humans) perceive beauty is intimately related to our ability to process and understand complexity. A language that makes it hard to write elegant code makes it hard to write good code."

      Taken from http://www.linuxjournal.com/article/3882 where ESR also gives his reasons for switching mostly to python as a replacement for perl.

      Brian

    8. Re:Has to bash on Perl by Anonymous Coward · · Score: 0

      >> If you don't know how to write clean code, then your Python will also suck.

      > No it won't.

      IT'S A MIRACLE!!! Your programs will look beautiful even if you don't really know how to program!

      Oh, please.

    9. Re:Has to bash on Perl by Anonymous Coward · · Score: 0

      Now that's political correctness turned mad..
      Nobody has said that every language is equal to every other one in terms of clarity, or actually nobody has to do that..
      I used to program in Perl and I taught various courses in it. The thing was pretty unusable for large programs, and you get the feeling that the students are probably going to trip in so many points. When I found python I switched and switched teaching as well; python makes much more sense to students immediately, and I find it easier to use.
      Now, if you are going to say that Perl is easier for you that's totally acceptable to me. But it needs a different mindset than most of the other languages. I still believe it belongs to the sed/awk people..
      Looks like perl6 may be a real cleanup, I will check it that time. For now, sorry, perl is baaaaaaaaaaaaaaaaaaaaaaaaaaaaad..

  14. My 2 scents by Cro+Magnon · · Score: 1, Offtopic

    I'm a total n00b in Python, but I like what I see. I'm planning to rewrite a Perl program I have in Python.

    My biggest gripe is that Python lacks a "use strict" to protect me from my own badd speling.

    --
    Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
    1. Re:My 2 scents by Anonymous Coward · · Score: 2, Insightful

      Run "pychecker" on your python scripts. It catches all sorts of things; certainly almost anything having to do with misspelling.

    2. Re:My 2 scents by Cro+Magnon · · Score: 1
      Run "pychecker" on your python scripts. It catches all sorts of things; certainly almost anything having to do with misspelling


      Thanx!
      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
    3. Re:My 2 scents by Anonymous Coward · · Score: 0

      Pychecker is a menu option in IDLE, the Python IDE, which altogether is a very slick piece of work.

    4. Re:My 2 scents by jonathansamuel · · Score: 1

      If all of my variables are class attributes then many of the problems with typos seem to fix themselves. Python won't recognize self.myvar if there is no myvar attribute.

      --

      Marjo Wycam, Master of the Programming Arts
    5. Re:My 2 scents by Cro+Magnon · · Score: 1

      Doesn't it just create the attribute?

      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
    6. Re:My 2 scents by jonathansamuel · · Score: 1

      Oops. You are correct. Mistyping the class name creates an error, but mistyping the attribute name does not.

      --

      Marjo Wycam, Master of the Programming Arts
  15. the obligatory Python vs Perl post by hashmap · · Score: 5, Funny

    EXTERIOR: DAGOBAH--DAY

    With Yoda strapped to his back, Luke climbs up one of the many thick vines that grow in the swamp until he reaches the Dagobah statistics lab. Panting heavily, he continues his exercises--grepping, installing new packages, logging in as root, and writing replacements for two-year-old shell scripts in Python.

    YODA: Code! Yes. A programmer's strength flows from code maintainability. But beware of Perl. Terse syntax... more than one way to do it... default variables. The dark side of code maintainability are they. Easily they flow, quick to join you when code you write. If once you start down the dark path, forever will it dominate your destiny, consume you it will.

    LUKE: Is Perl better than Python?

    YODA: No... no... no. Quicker, easier, more seductive.

    LUKE: But how will I know why Python is better than Perl?

    YODA: You will know. When your code you try to read six months from now.

    1. Re:the obligatory Python vs Perl post by Randolpho · · Score: 1

      After setting Yoda down, look looks around apprehensively.

      LUKE: I feel cold.... death......

      YODA: That file is strong with the dark side. A domain of perl it is. In you must go.

      --
      "Times have not become more violent. They have just become more televised."
      -Marilyn Manson
    2. Re:the obligatory Python vs Perl post by rkeenjr · · Score: 1

      Thanks I needed a laugh!

    3. Re:the obligatory Python vs Perl post by ezeecheez · · Score: 1

      YODA: You will know. When your code you try to read six months from now. If your syntax in general weren't so tortured, master Yoda, you wouldn't have this problem.

    4. Re:the obligatory Python vs Perl post by ExoticMandibles · · Score: 2, Informative
      Thanks for reposting that. No thanks for removing the attribution--I wrote that, back in 1999. And I have proof.

      larry

    5. Re:the obligatory Python vs Perl post by Chapter80 · · Score: 1
    6. Re:the obligatory Python vs Perl post by pilkul · · Score: 1

      Er, why do you care whether the joke is attributed to "hashmap" or "funkster at midwinter.com"?

    7. Re:the obligatory Python vs Perl post by mav[LAG] · · Score: 1

      Maybe because he came up with it? It's his joke, he made it up and he's entitled to be credited as the original author of it. Kind of reminds me of the snotty kid who tried passing off the BOFH archives as his own. I'm not accusing the OP of that sentiment but credit where credit was due would have been nice.

      P.S. Larry is correct - my mail archive shows he came up with it at the latest in 2000.

      --
      --- Hot Shot City is particularly good.
    8. Re:the obligatory Python vs Perl post by pilkul · · Score: 1
      Sure, but if he had happened to choose his slashdot nickname to be "hashmap" instead of "ExoticMandibles" then the end result would've been exactly the same. Where is the breach of ethics? It really makes no difference whether some writing is attributed to one symbol or another when there is no associated monetary or other tangible benefit of any kind.

      I'm saying I don't get people who get all worked up about writing being copied; it's an irrational extension of the concept of physical property.

    9. Re:the obligatory Python vs Perl post by Ereth · · Score: 1

      This would imply that you've never written anything worthy of being copied.

      Credit where credit is due is the core underpinning of the Hacker Culture. If you create something, and someone else passes it off as their own, without giving you credit, you have every right to be upset. A clever bit of writing is as worthy of credit as a clever bit of coding. It's just as wrong to pass off someone elses joke or short story as your own as it would be to pass of their script or program as your own.

  16. Simple, Legible Code by AthenianGadfly · · Score: 5, Insightful

    And, unlike Perl, it's very easy to do complicated things in simple, legible code

    The issue with Perl isn't that it's particularly hard to do complicated things with simple, legible code (not more so than a lot of other languages, anyway), but that it's very, very easy to do something extremely quickly, which often - but not always - means code that makes sense at the time but isn't necessarily readable, or leads to overly terse code. Yes, Perl makes it easy to do things wrong (and a lot of people out there do use Perl to make unreadable programs), but that doesn't mean that it can't be used to do things correctly as well as any other language.

    1. Re:Simple, Legible Code by lawpoop · · Score: 2, Interesting

      In Perl, it is easy to make legible code, and it is easy to make illegible code.

      In Python, it is easy to make legible code, but it is difficult to make illegible code.

      I would argue that this fact makes it harder to write legible code in perl than in python.

      --
      Computers are useless. They can only give you answers.
      -- Pablo Picasso
    2. Re:Simple, Legible Code by SCHecklerX · · Score: 1

      What I've found is that perl is the only language I can be away from for an extended period of time, and then be able to write in it without looking at a single reference the next time I try. That is very powerful. Perl lets you use your own style is probably the reason. If your style of coding is organized, you have nothing to worry about when trying to decipher what you wrote a few years ago.

    3. Re:Simple, Legible Code by Red+Flayer · · Score: 1

      "I would argue that this fact makes it harder to write legible code in perl than in python."

      Not harder, just less likely. Unless remembering to write legibly really taxes your brain ;)

      --
      "Trolls they were, but filled with the evil will of their master: a fell race..." -- J.R.R. Tolkien on Olog-hai
    4. Re:Simple, Legible Code by michael_cain · · Score: 1
      The issue with Perl isn't that it's particularly hard to do complicated things with simple, legible code (not more so than a lot of other languages, anyway), but that it's very, very easy to do something extremely quickly, which often - but not always - means code that makes sense at the time but isn't necessarily readable, or leads to overly terse code.

      When I was a lad, I wrote a bunch of numerical analysis and statistical modeling code in APL. Now there, young Jedi, was a write-only language! Not only was it sometimes easier six months later to start over rather than modifying the existing code, it was almost always easier to start over than to rewrite.

    5. Re:Simple, Legible Code by m50d · · Score: 1

      It is harder than it has to be. It's just as easy to get a working solution in python - and, in the absence of evidence one way or the other, there's far more chance of that working solution being legible in python than in perl.

      --
      I am trolling
    6. Re:Simple, Legible Code by lawpoop · · Score: 1

      If you agree that it's difficult to write illegible code in Python, and not difficult in Perl, then it's not a matter of likelihood, because code is not a random process. Writing code requires human effort, and if one type of code is more difficult than the other, you aren't going to get the harder type of code precisely because it's harder. In Perl, illegible code is as easy to make as legible code. In Python, it takes *more* effort to write illegible code.

      Because, say you are trying to write illegible code. In Python, it's difficult. It Perl, it's easy. You will get more illegible code in Perl simply because it's easy, if that's your goal.

      As a better example, say you are new to the game. You don't really know the difference between legible and illegible code. There's nothing preventing you from writing the illegible code in Perl, whereas there is in Python. You will get more illegible code from beginners in Perl, because it doesn't require any extra effort.

      --
      Computers are useless. They can only give you answers.
      -- Pablo Picasso
    7. Re:Simple, Legible Code by Red+Flayer · · Score: 1

      I understand what you are saying, and I agree in effect. It's just semantics we're discussing.

      "There's nothing preventing you from writing the illegible code in Perl, whereas there is in Python."

      That doesn't mean it's harder to write legible code in Perl. It just means it's harder to write illegible code in Python. The net effect though, as you point out, is that you'll see more illegible code in Perl than in Python.

      --
      "Trolls they were, but filled with the evil will of their master: a fell race..." -- J.R.R. Tolkien on Olog-hai
    8. Re:Simple, Legible Code by mooingyak · · Score: 1

      That probably depends more on training and background than anything else.

      I can stay away from C or Bourne/Korn shell scripting for a while and then come back to them without checking a reference too.

      This however:
      If your style of coding is organized, you have nothing to worry about when trying to decipher what you wrote a few years ago.

      describes more of the problem than anything else.

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
    9. Re:Simple, Legible Code by archeopterix · · Score: 1
      The issue with Perl isn't that it's particularly hard to do complicated things with simple, legible code (not more so than a lot of other languages, anyway), but that it's very, very easy to do something extremely quickly, which often - but not always - means code that makes sense at the time but isn't necessarily readable, or leads to overly terse code.
      Well, I am starting to see some of this also in Python. Here are some mini-WTFs I found while maintaining a Python app. Replace the starting dots with spaces, I'm too lazy to figure out how to indent in slashdot-html. And one thing - this isn't to support the thesis that Python, or dynamic languages in general are bad. It's rather to say that you cannot (and should not try) design a language where it's easy to write 'good' things and difficult to write 'bad' things.

      ..while hasattr(object,'proxy'):
      ....object=object.proxy
      My comment - it's reflection being abused + lack of private fields. This, of course isn't python-specific. Yeah, I know of the __privateField convention. Too sad it isn't more widespread. Everytime I see something like this, I get more convinced that 'private by default' should be, ugh... a default ;-). I feel tempted to add a bogus 'proxy' field to the last object in the chain and complain to the author that his code doesn't work :-) Another one:
      name,status,dateCreated,dateModified,modifiedBy,cr eatedBy,processed,my DogsName, myNeighborCatsName, myFridgeContents =func(*args)
      My comment - Python makes it easy to abuse sequences(tuples,lists) as return values. It starts innocent. You find out that a function returning a value needs to return something more - a source of the value, a condition, whatever. You simply change the return retval to return (retval,condition) and the calling code from a=foo() to a,cond=foo(). This repeats several times, each time making it harder to return (I mean refactor all the code using the function) something more explicit, like a proper object or at least a dictionary of named values. Soon you have to memorize that foo()[6] is status and bar()[7] is timestamp. It gets even worse when you start nesting sequences. Soon you have to write foo()[0][1][0][1][1] , then you replace it with cadaddadr(foo()) functions and become a LISP-er ;-P. Again, this is neither python-specific, nor an argument against flexible data structures. I love being able to write [1,'banana', self.aMethod, (1,'dog') ], especially in one-time-run or proof-of-concept code. One just has to remember it can accumulate and fall on your head.

      This has gotten long, so I'll just repeat: this is just to show that people will always find ways to write muddy code. Python has still an unbelievable easiness/muddiness ratio :)

  17. Dive into Python by Jazzer_Techie · · Score: 4, Informative

    No discussion of Python literature can be complete without mentioning Mark Pilgrim's Dive into Python, which is an excellent way to get to know the Python language. It's free for download in a variety of formats. Two caveats however, being that 1) it hasn't been updated in about a year and a half and 2) it assumes that you already have a pretty good grasp of programming in some other language. But if you've you got some coding experience and want to take a serious look at what Python has to offer, this is a great book full of nice examples (with the code available for download as well).

    1. Re:Dive into Python by rmccann · · Score: 1

      Dive into Python is a fantastic book. I learned Python from it. However I think "it assumes that you already have a pretty good grasp of programming in some other language." is one of its strongest suits. Many people already know how to programme. With Dive into Python you are not being introducted to the difficult 'if' statement in chapter 5.

    2. Re:Dive into Python by JFMulder · · Score: 1

      Good to know, I've just bought this book for my development team today so that developers without any knowledge of the language can learn it efficiently. I know, there is an online version, but reading on a computer never beats a good old book (nicer for the eyes), plus, if you want to read it on your way to work, you just can't beat a book.

  18. python regexes by funkelectric · · Score: 2, Insightful

    After hacking perl for over 10 years, Python sounds very good. The first program I tried to write in Python was the quick-and-dirty thing I need most: Read a file and parse it using regexes. Perhaps I stumbled upon the one area where Perl shines in comparison with Python, for that is the impression I got. The Python regex methods do not seem a natural fit for the problem.

    1. Re:python regexes by Golthur · · Score: 1
      Perhaps I stumbled upon the one area where Perl shines in comparison with Python, for that is the impression I got. The Python regex methods do not seem a natural fit for the problem.

      To put my Python/Perl bias out in the open - I've used both, but prefer Python to Perl.

      However, I'd say that Perl's regexes are among its greatest strengths. Python's regexes are alright (about the same as many other languages), but are certainly nothing spectacular. So, yes, your particular problem was more ideally suited to Perl, and less so to Python.

      --
      Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
    2. Re:python regexes by Anonymous Coward · · Score: 0

      I'm another unrepentant Python partisan, but based on
      my (admittedly limited) experience with Python regexes I'd have to agree..
      dealing with regexes in Python kinda sucks, but then dealing with regexes
      anywhere is not necessarily pleasant...for the dilettantes, I'm sure with sufficient practice it'd get easier.

      The rest of the language does rock, though. Check it out further..

    3. Re:python regexes by Just+Some+Guy · · Score: 2, Informative
      What part of Python's regexps did you not like? The main difference I was was that instead of:
      if ($var =~ /some?pattern*/) { foo }
      you'd write something like
      if re.search('some?pattern*', var): foo
      or if you're doing the same match many times:
      pattern = re.compile('some?pattern*')
      if pattern.search(var): foo
      (kind of like Perl's "/o" once-only modifier).

      So, the calling convention is slightly different - one is procedural, and one is OO - but Python uses Perl's regexp engine so the patterns themselves should be identical.

      --
      Dewey, what part of this looks like authorities should be involved?
    4. Re:python regexes by Coryoth · · Score: 1

      One of the things that I got to be quite fond of in Python regexps that I didn't really find a satisfactory replacement for in perl was the ability to create named match groups and then get a group dictionary from the resulting match object. Sure it's just syntactic sugar, but it made pulling out substring matches a lot clearer to read and use by having sensible names for everything.

      Jedidiah.

    5. Re:python regexes by Anonymous Coward · · Score: 1, Interesting

      I use both Perl and Python frequently, and have taught beginning programming courses in both.

      Python regexes do anything Perl regexes can do, but they aren't as fully integrated into the language: you have to type more characters to accomplish the same thing. Regexes are a hugely common task, so this difference is significant for many real-world uses, particularly short one-time-use scripts used by system administrators.

      As with many areas of comparison between Python and Perl, the extra effort will sometimes make for better programming in the long run (eg, encourage you to precompile your regexes for better performance). When you only want a quick-and-dirty, use-once-and-throw-away script, Perl will be your choice. But if you plan to re-use your code (or if you don't plan on it but later wish you had), Python is worth the slight differences, even the strange ones like the unique approach to list indexing.

      The most important example of how Python is better for code re-use, in my mind, is exception handling. Python has a built-in, powerful, hierarchical (you can just catch a parent class and be sure you're handling all the children), nestable, extensible (define your own exceptions) system of exception handling. Perl has eval blocks. You COULD use eval blocks to write nested exception handling, if you religously catch every exception and re-throw what you don't handle. But that strategy is laborious and error-prone and I've never seen anyone seriously attempt it.

      In short, Perl makes you do extra work to support stuff (like exceptions and, to a lesser extent, inheritance) that should be built in to a modern language. Python can feel awkward (compared to Perl, but try doing this stuff in Java) trying to do some common stuff that ought to be easy (like regexes). It all depends which features you value.

      To return to the topic at hand, Python's "one right way" mindset can be more of an obstacle than it should be, because the documentation isn't geared toward newcomers. Say you're starting out in Python (or haven't used Python in ages) and you need to concatenate a string and an integer. The answer is simple and concise, but see how long it takes you to find it in Python's online documentation. I hope that new books will help.

    6. Re:python regexes by funkelectric · · Score: 1

      The example you give is already a mash of seemingly different methodologies IMO. It gets worse if you want to do stuff to subpatterns or do replacing if I recall correctly.

    7. Re:python regexes by imbaczek · · Score: 1

      You tried to write a program that a Python programmer would consider writing in Perl... Not a good choice :)

    8. Re:python regexes by Anonymous Coward · · Score: 0

      Have you ever looked at ruby? Regular expressions are first class objects, and the syntax is much like perl. It also has lots of other worthwhile features (pure OO, closures, mixins) that make it, IMO, the most well-rounded and powerful high level language around.

      I used to be a big python and perl fan, but since discovering ruby, I've hardly used them at all.

    9. Re:python regexes by Just+Some+Guy · · Score: 1
      The example you give is already a mash of seemingly different methodologies IMO.

      In what way? I thought it was pretty consistent.

      It gets worse if you want to do stuff to subpatterns or do replacing if I recall correctly.

      Subpatterns:

      >>> re.search('(a*)(b*)(c*)', 'abbbbb').groups()
      ('a', 'bbbbb', '')

      Replacing:

      >>> re.sub('foo', 'bar', 'foofight')
      'barfight'

      It's a different access pattern than Perl, but I think it's pretty much equally easy to use.

      --
      Dewey, what part of this looks like authorities should be involved?
    10. Re:python regexes by Black+Perl · · Score: 1
      um,
      #!/usr/bin/perl
      use Error;
      # now you can have nested try/catch blocks
      --
      bp
    11. Re:python regexes by ubernostrum · · Score: 1

      The first program I tried to write in Python was the quick-and-dirty thing I need most: Read a file and parse it using regexes. Perhaps I stumbled upon the one area where Perl shines in comparison with Python, for that is the impression I got. The Python regex methods do not seem a natural fit for the problem.

      Well, to be honest, you picked the one task that, above all others, Perl is engineered from the ground up to be good at, and compared it to the same task in another language which doesn't place any special emphasis on that task. If you take a language that specializes intensely in a particular task (and I don't think anyone could claim Perl doesn't place a huge amount of focus on text processing with regexes), it's probably going to be better, for that particular task, than a language that doesn't specialize in that task. In much the same way, if you want to do clean object-oriented programming Python's got Perl beat hands-down; Python is OO to the core, and is now designed to be that way, while Perl's OO is still in the "bolted on" phase. So really, it all depends on the task.

    12. Re:python regexes by Anonymous Coward · · Score: 0
      Um, except now your code is not really understood by other Perl programmers unless they know which of at least two (non-standard) Error modules is installed on your particular system. And you've added an obstacle to portability.

      Don't get me wrong, Perl's extensibility (and the sheer size of CPAN) is probably its greatest strength. But other languages (including Python) have lots of extensions and available libraries too; if you're going to compare languages, compare the language itself. Libraries and extensions are a whole other story.

    13. Re:python regexes by Black+Perl · · Score: 1
      If they don't know how to type
      cpan Error
      then they don't really know Perl.

      Your comment shows you don't know the difference between a distribution and a module. The second Error module is part of the 'bioperl' distribution and you can only get it by installing bioperl.

      CPAN is standard. 'cpan' comes with every release of Perl. CPAN pretty much is Perl. All well-written Perl apps/modules build upon high-quality, tested, CPAN modules. There is absolutely no point in reinventing the wheel when there are so many high quality classes available. If you're not using CPAN, you're writing way too much code, and you might as well use Python.

      I like Python (and Ruby) but I can write less code in Perl than in any other language. Sure, CPAN is like "cheating"... but the only people who really seem to get upset about that are Python syntax snobs with a chip on their shoulder about Perl.
      --
      bp
  19. Python is very tasty by digitaldc · · Score: 1

    "While it's nearly 30 chapters in length, most of them are short and focused, making them easily digestible and highly useful."

    It also goes well with a cup of Java, fried Kalamaris and a side of Perl pasta.

    --
    He who knows best knows how little he knows. - Thomas Jefferson
    1. Re:Python is very tasty by teklob · · Score: 1

      That sounds delicious, apart from the Kalamaris. I'm allergic to C food.

  20. Troll by Anonymous Coward · · Score: 0

    Troll: And, unlike Perl, it's very easy to do complicated things in simple, legible code.

    That is nothing but a troll and everyone who has actually used perl knows it. You can write illegible code in any language. You can write legible code in any language (except joke languages like Whitespace and BrinF*ck).

  21. Python? Why not Ruby (on Rails)? Because ... by chriss · · Score: 5, Informative

    Since this is inevitable to pop up, a very simplyfied version (slightly offtopic):

    Why not ditch Python and use Ruby (on Rails)?

    • Ruby is a nice language. It looks more like Java (or C or Perl) than Python, so that may be an advantage for those who dislike Pythons whitespace handling (I think it is genius)
    • Rails is a very nice framework for developing database driven web-apps very fast
    • Someone (David Heinemeier Hansson) really cared to make this user/developer friendly. There is good marketing, nice screencasts (although basically smoke and mirrors), good documentation, a well structured central web site, lots of support. All this may be even more important than the technical differences to other platforms like Python.
    • It's hype, so you could easily sell it to management

    Why better stick with Python?

    • Most of the hyped features Rails are available on Python too, although not yet in such a nice package. The Turbogears folks try this, but in a more pythoniac way. I like it better, since they actually bundled already established products like CherryPy and SQLObject instead of simply writing from scratch. This may not result in a smooth package like RoR, but it is more clearly aimed at the integration of other products.
    • There are tons of modules and documentation for Python out there. So if you come to the point where you want to include other features than those already present in your framework, it will be easier to add them from different sources, because a) there are more and b) integration is a more established process.
    • There has been a lot going on in the RoR aftershock to improve the situation, like discussions about merging the different frameworks (Turbogears/Subway) to create a unified and very powerful platform.
    • There is always a way up in Python with Zope (although this is a beast and documentation is bad, 3.X is much better, but lots of products currently still require 2.X) and integration in J2EE.
    • Python is old. There has not only been one generation of developers whos projects failed, but many. RoR is still in the "early adaptors" phase, where everyone sees the revolution and casualties are accepted. Ruby alone has had a strong following in Japan, but for the rest of the world Rails was the first contact. Wait a year until the "RoR sucks" postings appear, than you'll be much wiser.

    Chriss

    --
    memomo.net - brush up your German, French, Spanish or Italian - online and free

    1. Re:Python? Why not Ruby (on Rails)? Because ... by NardofDoom · · Score: 1
      Wait a year until the "RoR sucks" postings appear, than you'll be much wiser.

      I'm a time traveler!

      --
      You have two hands and one brain, so always code twice as much as you think!
    2. Re:Python? Why not Ruby (on Rails)? Because ... by gnovos · · Score: 1, Flamebait

      for those who dislike Pythons whitespace handling (I think it is genius)

      Until the first time you try and copy and paste it from a web browser or email...

      --
      "Your superior intellect is no match for our puny weapons!"
    3. Re:Python? Why not Ruby (on Rails)? Because ... by jma05 · · Score: 1

      When that happens, I usually paste it into an RTF editor first and then to my regular editor. But I will have to concede that it is an occational effort, although it is a price I am gladly willing to pay.

    4. Re:Python? Why not Ruby (on Rails)? Because ... by guet · · Score: 1

      Just for fun here's a couple of the very basic examples in Thinking in Python going from Python to Ruby.

      #!/usr/bin/python

      list = [1,2,3,4,7,8,11]
      print list
      list.append(13)
      for x in list:
          print x

      def sum(arg1, arg2):
          return arg1 + arg2

      print sum(42, 47)
      print sum('spam ', "eggs")

      #!/usr/bin/ruby

      list = [1,2,3,4,7,8,11]
      puts list
      list "although basically smoke and mirrors"

      Are they really so different? Does it really matter? Do we all have to take sides?
      To me the differences between the languages look very small, they're more about outlook and ethos than technicalities. The features are pretty close to even, and the syntax is even almost the same. So I don't see why you have go for a pre-emptive strike against the evil hordes of RoR users, who don't seem to have materialised in this article anyway : )

    5. Re:Python? Why not Ruby (on Rails)? Because ... by guet · · Score: 1

      oh great, mangled by the slashdot bit-eater, well, I'm sure you could guess the rest : )

      #!/usr/bin/ruby

      list = [1,2,3,4,7,8,11]
      puts list
      list << 13
      list.each do |x|
          puts x
      end

      def sum(a, b)
          a + b
      end

      puts sum(42, 47)
      puts sum('spam ', 'eggs')

    6. Re:Python? Why not Ruby (on Rails)? Because ... by chriss · · Score: 1

      So I don't see why you have go for a pre-emptive strike against the evil hordes of RoR users, who don't seem to have materialised in this article anyway : )

      Basically because I was wrong. I had a lot of discussions during the last few weeks with people praising RoR and bashing Python on the one side and people praising Python and dismissing Ruby as a toy on the other. So the pre-emptive strike was intended as a "hey, they are both worth considering, choose based on your needs" to stop any bashing in advance. To my total surprise the subject didn't even come up, making my posting surplus.

      Chriss

      --
      memomo.net - brush up your German, French, Spanish or Italian - online and free

    7. Re:Python? Why not Ruby (on Rails)? Because ... by Anonymous Coward · · Score: 0

      Shh! The space/tab thing is a great way to obfuscate Python code in non-obvious ways, especially as you can have it so that any time someone "fixes" the code, it all breaks. But don't let on or soon everyone will be wise to the trick and that nice job security will be gone again...

    8. Re:Python? Why not Ruby (on Rails)? Because ... by zardo · · Score: 1

      I went from perl to ruby, I investigated python, but I chose ruby because I liked the syntax better, and it seemed to have more OO features and I am an OO nut.

    9. Re:Python? Why not Ruby (on Rails)? Because ... by Dicky · · Score: 1

      I see two noticable differences between the Python and Ruby examples:

          Python:

              list.append(13)
              for x in list:
                  print x

          Ruby:

              list << 13
              list.each do |x|
                  puts x
              end

      The first difference is in punctuation: The Ruby has |x| and << - okay, I'm a Python coder, so : and append() make sense to me, but it does seem that the Python is closer to English, and therefore easier to understand without knowing the syntax, and, I think, easier to think in.
      The other difference is in indentation: Actually, there's no difference in the indentation at all, but Ruby has the redundant 'end' statement after the code block. Any coder worth the name will indent just like that anyway - particularly in a language which doesn't use () or {} or something similar to mark code blocks - so there's just no need for the 'end' to mark the end of indentation.

      --
      Paranoia isn't an infectious condition, it's a way of life
    10. Re:Python? Why not Ruby (on Rails)? Because ... by Eivind+Eklund · · Score: 1
      You are ignoring one thing about Ruby that I see as quite important: Uniform access, borrowed from Eiffel. Python people generally don't intuitively "get" this (no wonder - they've not been exposed to it) - yet it's a significant thing when you're working with code later. Methods and attributes are accessed that way, so you can refactor an object to use code instead of an attribute, or an attribute instead of code. Without changing the client code.

      There has also been a fair amount of Ruby programmers out there before Rails; not infinite, yet not so few that they don't count. Ruby and Python are about the same age, it's just that Python took off earlier in the western world (due to being developed in english rather than japanese).

      And I'd like to note the difference in the ATTITUDE of the Ruby and Python programmers - the Ruby community is extremely friendly and fairly tolerant of different ways of doing things, while the Python community is reported to have the attitude of There-Is-One-Way-To-Do-It-And-Python-Is-Right-In-C hoosing-That-And-You-Are-Wrong.

      There are probably other sides of Ruby vs Python discussion, too - I've never got around to learning Python, as everybody I talk to that know both prefer Ruby, language-wise - even some that program in Python for interpreter speed.

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
    11. Re:Python? Why not Ruby (on Rails)? Because ... by Eivind+Eklund · · Score: 1
      My experience is that the missing block termination ("end") in Python makes it hard to scan Python programs - they get so "jaggy", visually. That is probably a question of habit, yet it's a mark against Python for being easily available to people that have habits from other languages.

      I also find Ruby programs easy to think about, though I've got 20 years of habits to carry over to thinking about Ruby, so that's not certain to be important for somebody else.

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
    12. Re:Python? Why not Ruby (on Rails)? Because ... by guet · · Score: 1

      I see two noticable differences between the Python and Ruby examples

      Noticable? yes. Significant? No.

      A significant difference would be

      for(int i = 0; i numberOfStock; i++)
      {
      System.out.println(list[i]);
      }

      or

      NSEnumerator *childEnumerator = [list objectEnumerator];
      NSObject *obj = nil;
      while (obj = [childEnumerator nextObject])
      {
      NSLog(obj);
      }

      That said, it's interesting to look at the small differences - I wonder if there's a site someplace that does comparisons of languages with basic routines each rewritten in the different idioms?

      I personally love the loss of braces and the use of indentation in python, but haven't really explored the language as I picked up Ruby first and enjoy that too much. The do end doesn't really bug me very much either - that weird ':' at the end of the for x in list line upsets me just as much : )

    13. Re:Python? Why not Ruby (on Rails)? Because ... by sjames · · Score: 1

      I'm not sure I see how. The indentation used in any 'normal' style will be the same. It's just that C, Ruby, and Perl will have gratuitous lines containing either '}' or 'end'.

      Judicious use of empty lines between blocks will make any of those a little kinder to the eyes.

    14. Re:Python? Why not Ruby (on Rails)? Because ... by Dan+Hayes · · Score: 1
      You mean properties?

      class foo:
      ....def __init__(self):
      ........self._hiddenvar = 0
      ........self.prop = property(getprop, setprop)

      ....def getprop(self):
      ........return self._hiddenvar

      ....def setprop(self, value):
      ........self._hiddenvar = value

      You can change a variable in a class to a property pretty easily without changing anything in any code using the class.

    15. Re:Python? Why not Ruby (on Rails)? Because ... by Anonymous Coward · · Score: 0

      Ruby can use {} for code blocks, and often does for one liners.

      So you could write

      list.each { |x| puts x }

      Or heck, if you wanted to dispense with the block:

      puts list.join("\n")

      I do prefer Ruby to Python. It just seems more elegant to me. But that's a matter of personal taste. Python certainly has better library support.

    16. Re:Python? Why not Ruby (on Rails)? Because ... by Eivind+Eklund · · Score: 1

      I see the end braces or end statemetns as a code scanning aid. I use them as visual markers when I look at code. You find them gratious, I find Python hard to read because they're not there.

      You find empty lines to make code more friendly to read. I, on the other hand, find the use of empty lines to be gratious and make the code harder on the eyes.

      I believe both of these are mostly questions of habit.

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
    17. Re:Python? Why not Ruby (on Rails)? Because ... by Eivind+Eklund · · Score: 1
      Actually, I don't mean properties. That creates (somewhat) contorted code in the class, and "magic" around the property - including the ability of getters/setters to be weirdly named.

      Uniformity of access makes refactored code look like the design originally was that way. And it makes it possible to also move what was method calls to be attributes. In Ruby, this is done by only relating to messages, of course.

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
  22. I have to wonder about this by Timesprout · · Score: 1

    I like to play with Python occasionally but when I see something like

    hat said, there are a few things in the book that I tend to disagree with. For example, the author dissuades you from using destructors in your code, but in my experience they're far more reliable, and a better place to do some cleanup, than he states.

    I really have to wonder. Does someone have no idea what they are talking about or does a certain language have a very crappy garbage collector.

    Anyone care to offer some insights as to why the reviewer made this statement?

    --
    Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
    What truth?
    There is no dupe
    1. Re:I have to wonder about this by Golthur · · Score: 1

      I'd probably say that it's because Python is both reference-counted and garbage-collected.

      That is, it tracks reference counts for objects and calls __del__ when the last reference to the object goes away. If you don't create object reference cycles in your code, using __del__ for cleanup works great, but if you do, you then have to wait for the next run of the garbage collector to clean up the "lost" objects. The catch is that the garbage collector doesn't automatically reclaim the objects if you have a __del__ method - you have to manually determine the order to reclaim the objects in the cycle using the gc module (see here for more pedantic details).

      --
      Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
    2. Re:I have to wonder about this by Floody · · Score: 1
      That is, it tracks reference counts for objects and calls __del__ when the last reference to the object goes away. If you don't create object reference cycles in your code, using __del__ for cleanup works great, but if you do, you then have to wait for the next run of the garbage collector to clean up the "lost" objects. The catch is that the garbage collector doesn't automatically reclaim the objects if you have a __del__ method - you have to manually determine the order to reclaim the objects in the cycle using the gc module (see here for more pedantic details).


      That, and since the advent of weakrefs, destructors are wholly unncessary. Weakrefs will call back a function/method immediately after object finalization, which is slightly different than a true destructor that is called before finalization. Still, a simple closure or sep. cleanup object can provide references to any internals you need to cleanup. That and it has the advantage of cooperating very nicely with reference counting gc.

    3. Re:I have to wonder about this by tdelaney · · Score: 1

      There are a couple of caveats about using __del__.

      1. Python has multiple implementations, using different garbage collectors. For example, the reference C python implementation uses reference counting, with periodic garbage cycle breaking, while Jython (Python on the Java VM) uses the JVM garbage collector. Whilst with CPython you can (usually) be sure that __del__ is called as soon as the last reference to the object goes away, in Jython that is not the case.

      2. __del__ may not be called at all in some circumstances. For example, if you have a garbage cycle involving more than one object that implements __del__, the garbage collector cannot determine which must be called first, and so it doesn't guess.

      3. By the time __del__ is called, some references it needs may have already been disposed of. There are methods for ensuring this does not happen, but it's easy to miss something.

      In general, it's best not to rely on __del__, and use explicit resource deallocation. This will become much easier in Python 2.5 with the introduction of context managers and the `with` keyword.

    4. Re:I have to wonder about this by NoOneInParticular · · Score: 1

      The python gc is reference counted (by default. A 'true' gc can be programmatically enabled). This means that the destructor is called at predictable spots, namely whenever the last instance of the object goes out of scope. Because it is predictable it can actually be useful to define it, for instance to manage resources. Caveat: when the program ends, no destructors are called. Caveat 2: a less-deterministic gc can be enabled at any spot in the code. Conclusion: destructors are of limited use, yet in some circumstances they do allow correct resource management using object scope instead of having to program that manually, something you need to do in languages with a full gc.

  23. Perl vs. Python by Randolpho · · Score: 0, Redundant

    Perl vs. Python flame war commencing in 5...... 4....... 3....... 2....... 1......

    --
    "Times have not become more violent. They have just become more televised."
    -Marilyn Manson
    1. Re:Perl vs. Python by JoaquinFerrero · · Score: 3, Informative
      Why? You can write Perl & Python together:
      #!/usr/bin/perl

      use Inline Python => <<'END_OF_PYTHON_CODE';
      def add(x,y):
      return x + y

      def subtract(x,y):
      return x - y

      END_OF_PYTHON_CODE

      print "9 + 16 = ", add(9, 16), "\n";
      print "9 - 16 = ", subtract(9, 16), "\n";
    2. Re:Perl vs. Python by Lairdsville · · Score: 1

      Ahhh - that is just tooo evil. I can just imagine the worst of both worlds
      But worse than that is http://wwwuser.gwdg.de/~jbehren/fpx3.html. At attempt to "simplify Fortran source code development with an integrated set of macros, directives and embedded Perl/Fortran. Wow - someone has combined my two least favourite languages in an attempt to make a 'better' one!

  24. No programming experience? Here's what you need. by Anonymous Coward · · Score: 0

    bembry.org/technology/python/index.php

    Bryce Embry has written a set of Python tutorials well suited to first time programmers. I think it was written for high school students.

    The trouble with trying to learn anything is the amount of 'noise' you have to filter out. You don't need 90% of what is in the man page. Most of the time, you need a minimum implementation that isn't obvious when you try to follow the documentation. Maybe that's why the dummies books are so successful.

    Anyway, if you've never programmed before, this is the web site to see.

  25. Dive Into Python? by bblazer · · Score: 1

    What about Dive Into Python by Mark Pilgrim? Like the title says, you dive right in. There is no "Hello World!" stuff to mung through. He uses real world examples right from the start, and explains them in a way that a 4 year old could understand.

    --
    My .bashrc can beat up your .bashrc!
  26. Learning Python by kevin_conaway · · Score: 2, Informative

    I am a Java programmer by profession but I wanted to give Python a shot because it seemed like fun.

    As a programmer experienced with OO programming and some other types of "scripting" languages, all I needed to read was Learning Python from O'Reilly. Great book, great language.

    On a shameless side note, if you're a Scrabble fan, come check out my online, multiplayer Scrabble program written in Python. PyScrabble

  27. python isn't just for web apps by jbellis · · Score: 2, Insightful

    For various reasons (more mature stdandard & third party libraries; English docs; real threading support -- this is a big one; etc) Python is a much better general-purpose language than Ruby.

    (It's also about twice as fast, but honestly if Ruby is too slow for your project a factor of 2 probably isn't going to save you. Still, speed is a nice bonus.)

    1. Re:python isn't just for web apps by jaydonnell · · Score: 2, Informative

      yes and no. I use python and ruby at work and I prefer ruby as a language. Python does have better support and more mature libraries and it's a very nice language. We have a mix of linux and windows and python has much better windows support which is why we still use it as much as we do. The docs issue is weird. Ruby doesn't have as many docs, but I feel the docs they do have are often better (this is probably just personal preference). The python docs have left me wanting many many times. They are there for sure, but they can be really lacking.

      Also, python does not have real threading support. It has the GIL which will prevent your threaded python app from using more than one processor, but it's still better than ruby's thread support. I don't think this is much of an issue for two reasons.
      First, a lot of threaded apps are threaded because they are waiting on io of some sort usually network io. Ruby and python both work perfectly well for this type of threading need.
      Second, I've only ever done one project that needed to be multithreaded so it's a non factor for me and I think most people are in the same boat.

    2. Re:python isn't just for web apps by Anonymous Coward · · Score: 0

      So might Python be at risk for being squeezed - by Perl for those who want the widest user base and library support, and Ruby for those looking for hippest scripting language they can win flame wars with?

    3. Re:python isn't just for web apps by sjames · · Score: 1

      So might Python be at risk for being squeezed - by Perl for those who want the widest user base and library support, and Ruby for those looking for hippest scripting language they can win flame wars with?

      Naah, when it comes to squeezing, it's hard to beat a python.

  28. A few good and free Python books by YA_Python_dev · · Score: 3, Informative
    On the python.org site you can find a big list of Python books.

    I suggest:

    Good reading.

    --
    There's a hidden treasure in Python 3.x: __prepare__()
  29. most helpful book by engagebot · · Score: 2, Insightful

    I think the book thats most helpful to the novice programmer wouldn't be a book about any language at all.

    It'd be a book about programming and algorithms in general. Its MUCH easier to root around in a 'hello world' program or the like if you understand things like loops, if/then/else statments, function calls, etc. Even the fundamental idea of declaring and using a variable.

    --
    Han shot first.
    1. Re:most helpful book by grrrgrrr · · Score: 1

      you still need some kind of language to describe your algorithms . natural language is often a bit too ambiguous.
      scheme is nice like the famous free mit video lectures http://swiss.csail.mit.edu/classes/6.001/abelson-s ussman-lectures/
      i learned with pascal

    2. Re:most helpful book by m50d · · Score: 1

      Python is perfect because it is basically "executable psuedocode". It is hard to explain the concept of a while loop any more simply than in the python code for it.

      --
      I am trolling
    3. Re:most helpful book by grrrgrrr · · Score: 1

      Yes Python is pretty good for learning (unlike perl). But explaining a while loop can get pretty hairy. Recursion is much simpler to explain. ;-) (a Joke with a lot of truth in it)

  30. Err, my bad by RealProgrammer · · Score: 1

    I just looked at Python. I must have been thinking of a different language, probably ruby or tcl.

    --
    sigs, as if you care.
  31. GC and Destructors are Different Things by Anonymous Coward · · Score: 0

    I don't know too much about python, but in general destructors and garbage collectors are not competing features.
    A destructor can do some clean-up at the end of the objects life that is not necessarily memory related, like for a file object it could close the file.
    The destructor will usually be called by the garbage collector, when an object is deleted or goes out of scope in a language like C++.

  32. -1 Troll for Submitter by toupsie · · Score: 2, Insightful
    And, unlike Perl, it's very easy to do complicated things in simple, legible code.

    So can Perl.

    --
    Strange women lying in ponds distributing swords is no basis for a system of government.
    1. Re:-1 Troll for Submitter by the+eric+conspiracy · · Score: 1

      Really it is the converse that is true - it is harder to write simple illegible code in Python than in Perl.

      The issue of code readibility is why Perl is no longer my scripting language of choice.

    2. Re:-1 Troll for Submitter by chromatic · · Score: 1

      I'm using Python 2.4.2. Which version forces people to write small, self-contained functions and methods, to use meaningful and appropriate variable names, to document and comment their code appropriately, to write sufficient and maintainable tests, to eliminate repetition, to factor discrete subsystems into the appropriate modules and classes, and to use source control effectively? Should I wait for 2.4.3 to fix all of my readability and maintainability problems?

    3. Re:-1 Troll for Submitter by dcam · · Score: 1

      And, unlike Perl, it's very easy to do complicated things in simple, legible code.

      So can Perl.


      No it can't.

      --
      meh
    4. Re:-1 Troll for Submitter by scotch · · Score: 1

      Well said.

      --
      XML causes global warming.
  33. Python is for architects - Perl is for lumberjacks by mrfoos · · Score: 2, Insightful

    Comparing to two for me is like comparing tree cutting with building houses.

    When you build a house you need an architect and specific design rules so other people in the project can do their part. It takes a long time to build it, and someone has to live in the house a long time.

    When you cut down a tree you're only interested in the fastest way possible to get it down safely. Who cares if it's pretty. If you didn't like the way the first one fell, you can make adjustments on the next.

    A house builder wouldn't tell a woodcutter which axe to use. He doesn't care. Of course, woodcutters have no business building houses.

    Personally? I like being a lumberjack. Nothing like fervorishly hacking away and yelling "TIMBER!" from a safe distance.

  34. Python looks like a mess to me by KDR_11k · · Score: 1

    Maybe I just missed the appropriate packages but to my knowledge Python lacks things like strict typing that are invaluable helpers when you want to make sure stuff works as it should. Nothing is more annoying than reading "int has no member function ______" and having to track down where that variable got its int contents from. After being introduced to Haskell in university strict typing just becomes something I really want in a language. There's just no real way to be sure all variables are the type you want when you're bug hunting and lack of access control for classes and their free extendability (being able to just add members to any instance of the class) are enemies of debuggable code as well.

    Pattern matching would be nice too but probably not feasible.

    --
    Justice is the sheep getting arrested while an impartial judge declares the vote void.
    1. Re:Python looks like a mess to me by Chapter80 · · Score: 1
      Pattern Matching is completely in place in Python, with the re.search module (and other re modules).

      And the best part is verbose mode on Reg Ex's. You can really make them readable.

      Can you guess what I think the __worst__ __thing__ about Python is?

    2. Re:Python looks like a mess to me by the+eric+conspiracy · · Score: 1

      Python is a strictly typed language - however types are determined at run time rather than during a static compilation.

      If you want static typing use Java.

    3. Re:Python looks like a mess to me by CoderBob · · Score: 1

      If you mean pattern matching such as using regexes in code, there's a module that does so. It's named "re", I believe (haven't touched python in a couple months, and I have a horrible memory for module names), and while not as quick to use as Perl's, has many features.

    4. Re:Python looks like a mess to me by KDR_11k · · Score: 1
      I meant the Haskell definition of pattern matching:
      l = 3:5:7:9:[]
       
      addList::(Num a)=>[a]->a
      addList [] = 0
      addList n:r = n + addList r
       
      m = addList l
      Since l is constructed with the : constructor (creating a list), you can put the : into your function parameters to deconstruct l again. In this case it'd take the first entry of l and put it in n while putting the rest of it into r. Works with any kind of constructor. That way you don't have to manually deconstruct the variable and can more easily implement different behaviour based on different inputs. And I've seen some "pseudo code" for axioms in datatype definitions that would translate almost 1:1 into Haskell because of the pattern matching.
      If you had a stack implemented by the constructors EmptyStack and Push(Stack a,a) (sorry, forgot the syntax for that) you could implement
      pop::Stack a -> Stack a
      pop Push(r,_) = r
       
      top::Stack a -> a
      top Push(_,n) = n
       
      isEmpty::Stack a->bool
      isEmpty EmptyStack = True
      isEmpty Push(_._) = False
      Apologies for any syntax errors, been a while since I used Haskell. Also, that's bad style, pop and top aren't defined for empty stacks.

      I probably confused you more than helped, here's the official tutorial which should give a better idea of what I'm trying to say.
      --
      Justice is the sheep getting arrested while an impartial judge declares the vote void.
    5. Re:Python looks like a mess to me by Anonymous Coward · · Score: 0

      "Pattern matching" in the OP's terminology probably refers to a a feature in functional languages like ML. It doesn't necessarily have to do with regular expression pattern matching. For example, pseudocode like:

      def findLinkedListMax(node):
              """Returns the max value in a linked list."""
              if node == None: raise ValueError
              else if node.next == None: return node.value
              else: return max(node.value,
                                                findLinkedListMax(node.next))

      can be written in a pattern matching way like this (again, pseudocode):

      exception ValueError;;
      let rec find_linked_list_max l = match l with
              [] -> raise ValueError
          | hd :: [] -> hd
          | hd :: tl -> max hd (find_linked_list_max tl)

      where the language itself is aware of data structure internals and is able to de-structure things without having to use selectors. The example above doesn't seem like much, but for more complex data, pattern matching can lead to very clear code.

      For a larger example of pattern matching, see Wadler's paper on "A critique of Abelson and Sussman or why calculating is better for Scheming":

      http://www.cs.kent.ac.uk/people/staff/dat/miranda/ wadler87.pdf

    6. Re:Python looks like a mess to me by Anonymous Coward · · Score: 0

      I think what you're doing here is expressing what in Perl or Python is called a "slice" - assigning arbitrary part(s) of a list to other variables.

      (a,b,c) = mylist[1:3,5] #assign the second, third, and sixth things in mylist to a, b, and c respectively

    7. Re:Python looks like a mess to me by Anonymous Coward · · Score: 0

      No he is not expressing the idea of a slice. He is talking about pattern matching (which isn't the same as regular expression matching as the grandparent seems to think). Patterns are not just for lists -- they are for any inductive data structure. Go read some Haskell docs.

    8. Re:Python looks like a mess to me by Chapter80 · · Score: 1
      My bad. Thanks. I like learning something new.

      See, I thought Haskell was the pesky neighbor kid on Leave it to Beaver.

    9. Re:Python looks like a mess to me by SimHacker · · Score: 1
      Can you guess what I think the __worst__ __thing__ about Python is?

      The double underscores around special names like __init__?

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    10. Re:Python looks like a mess to me by Anonymous Coward · · Score: 0

      Er, *lots* of languages don't have static typing (I presume this is what you mean when you say "strict" - Python is perfectly strict, which is why it gives a nice exception when you try to call a method on an int).

      The pros and cons of static vs dynamic typing are well known.

      That a langauge is dynamically typed doesn't on its own qualify it as a "mess". Similar examples are LISP, Javascript, Smalltalk, etc. etc.

    11. Re:Python looks like a mess to me by KDR_11k · · Score: 1

      I'd prefer to get that exception where the int is assigned to the variable, not where the first function complains. I think Perl has a module that you can use to enforce declaration of variables before use and static variable types.

      The biggest problem I see is with more complicated datatypes. If you want a class to have a pointer to an instance of a certain class, you have to remember not to assign anything else to that variable (and anyone else using your modules will have to do that, too). And the class the thing points at is not obvious from the pointer's declaration.

      It's not an issue for small scripts but for larger chunks of code I'd at least like to have the option of enforcing variable contents and declaration.

      --
      Justice is the sheep getting arrested while an impartial judge declares the vote void.
  35. Re:Python just hasn't been the same.... by east+coast · · Score: 0, Offtopic

    Man, slashdot is getting rough when even a Python joke gets modded down...

    --
    Dedicated Cthulhu Cultist since 4523 BC.
  36. Python inferiority complex? by WampagingWabbits · · Score: 1

    Do I detect a trace of defensiveness in your tone? That you would like to think Python is gaining ground on Perl but you suspect it might not be? And you are confused as to why this is? Why don't Perl programmers leave their language in droves and convert to your favourite one? Why are slashdot, amazon, citysearch, ticketmaster, et al still using perl on their sites instead of Python for example?

    It could be that you misjudge Perl. Like judging a book by its cover, you have failed to see that Perl is perfectly capable of performing powerful tasks with simple, clean, easily maintained code. Perl is a practical language, and while dollar and percentage signs (and brackets) might not win a code beauty contest they provide useful information none the less.

    Perhaps while promoting Python's discipline over Perl's freedom of expression you have hit upon the reason for Python's failure?

    1. Re:Python inferiority complex? by grrrgrrr · · Score: 1

      Complex applications like zope do not exist in perl . It seems to me like perl is at a standstill at the moment there is al lot of innovative language development going on in python perl6 on the other-hand ........

  37. I tried python by plopez · · Score: 1

    But I found it too constrictive.

    Right now Ruby is my new Perl.

    --
    putting the 'B' in LGBTQ+
    1. Re:I tried python by Anonymous Coward · · Score: 1, Insightful

      Examples please, or you're just FUDing.

    2. Re:I tried python by Anonymous Coward · · Score: 0
      How do I mod "Missed the joke"?

      Of course, it's not much of a joke.

  38. MOD PARENT UP by Anonymous Coward · · Score: 0

    There's a book that introduces Python. There's an article that introduces Python. How the fuck is a link to the latter offtopic in a story about the former?

  39. My problems with the Python documentation. by Anonymous Coward · · Score: 0

    I've just started trying to learn how to program again and I've decided to give Python a go.

    They REALLY need to clean up the Global Module Index though. I've mostly learnt the syntax and I've tried to move onto the meatier module parts but the module functions just lack too much information.

    The function parameters are barely detailed. I have no idea if the parameters require a particular object type, or a string (or the string's particular format). Exceptions are barely documented either and I have no idea what exceptions are going to be propagated by a function that I am about to use.

  40. Obsess much? by DysenteryInTheRanks · · Score: 1
    Is Mr. Nazario writing about Python or Perl? I couldn't quite tell, because fully half the sentences in his summary text mention Perl.

    He writes the Python is "quickly supplanting Perl in some circles." That's an intriguing statement. But instead of explaining how great Python is in concrete terms (in either summary or review), Mr. Nazario seems content to simply rip on Perl with flamebait like

    unlike Perl, it's very easy to do complicated things in simple, legible code and

    unlike Perl, many Python developers I know don't bother with a dozen ways to perform a simple action, they get it done and move on

    This could leave a lot of people with the conclusion that Python mainly appeals to people with a chip on their shoulder about Perl, which does not serve the Python community well -- particularly when there are languages like Ruby that have evolved demonstrably superior ways of getting things done (compared to frameworks available for Perl OR Python).

  41. Unlike Perl by scottsk · · Score: 1

    "Unlike Perl" -- why are they so defensive? If Perl loses, it'll go the way of FORTRAN into the museum. If Perl wins, there's still plenty of room for other programming languages. Perl hasn't exactly made REXX, Pike, PHP, LISP, etc extinct or anything. (Not trolling, but I think Python users are so defensive because Python is the first language I know of since COBOL to make the whitespace of indention a significant part of the syntax.)

  42. Python+UML=. by Anonymous Coward · · Score: 0

    http://www.objectsbydesign.com/projects/python_uml .html

    "CP4E? This new acronym stands for Computer Programming for Everybody, a new initiative by the creator of the Python language, Guido van Rossum. The proposal for CP4E was submitted in July, 1999 to the Corporation for National Research Initiatives (CNRI). CP4E has set as its primary goals the creation of a training curriculum and advanced, easy-to-use development tools to be used to teach the Python language to millions of non-technical computer users. Why?

    "If we are successful, non-experts will be able use their computers and other intelligent devices much more effectively, reducing their level of frustration and increasing their productivity and work satisfaction."

    The Python language has already won acclaim as one of the most elegant and powerful, object-oriented programming languages in use today. Python is open source and freely available for a wide number of platforms and programming environments. Many highly scalable applications have been implemented with Python on these platforms. See our Python Link Collection for links to Python resources and to get an idea of the range of Python's deployment.

    It is our belief that UML, a widely adopted, standard notation for designing object-oriented software, could play a key role in the CP4E initiative and with Python development in general, as we will proceed to explain."

  43. Python Is For Stonecutters! by Anonymous Coward · · Score: 0

    Think about it. Prodigious use of WHITEspace. Led by a guy named Guido. Even the language name is a both a Biblical reference and phallic symbol. COME ON!

  44. Very nice by DaveInAZ · · Score: 1

    Nicely done. A very well written introduction.

  45. Indentation-Based Syntax by chromatic · · Score: 1

    Don't forget make!

  46. 1: scripting 2: simple oo 3: low-level language by goarilla · · Score: 1
    Although i do not consider myself a programmer (yet)

    I used to fiddle around in the win 3.x area when i was (6-10) with qbasic copy-pasting
    those speaker sounds and alternating things in that and later alternating gorillas.bas
    I remember those days took me a lot of time to get brother jackob, frère jacques, broeder jacob to play on my pc speaker
    because we in belgium use the do-re-mi music scale instead of the C,D,...

    But that's beside the point i'm just pointing out although i had extensive experience when i was young with basic
    i left it on the kitchentable when win95/98 came out and truthfully i lost a lot of skill.
    Tried VB when i was 14 made some stupid programs to measure mathematical things of cubes, triangles, ...
    But the most fun and the biggest learning experience i had
    was when i tangled around with source: most things i learned was with gorillas.bas or the simple 2 player shoot game(vb)

    Now i'm actively making a lot of shell scripts and i'm very happy with that.
    The reason imho that i'm happy with it is probably because in a sense its programming and ... it's constantly in my head
    i use that shell daily, it doesn't see the kitchen at all so to speak.

    I want to program, you want to program but it takes time, effort and u can't let it stand on the table!
    for that and other reasons i think the best way is to: start shell scripting and then evolve to python and later c/c++
    i'm trying python and
    i'm very happy with it but it's my next on my very big todo-list there still are some things i need
    to learn in bash

    A huge advantage bash, any scripting language, python, basic have in common is that it can/must (be) interpreted
    so u don't have to compile and wait!

    it's almost instant trial and error and that helps the beginning programming experience as you can tangle with source and see the results very rapidly

    Or, as the following modern Zen poem has it:

    To follow the path:
    • look to the master,
    • follow the master,
    • walk with the master,
    • see through the master,
    • become the master.


    i got this from this site which is probably an interesting read for you
    http://www.catb.org/~esr/faqs/hacker-howto.html
    Anyway good luck
  47. Wrox.... by In+Fraudem+Legis · · Score: 1

    Wrox has great books, including Beginning Python.

    --
    Per Aspera Ad Astra.
  48. Bah! Everyone knows the best Python book is... by Anonymous Coward · · Score: 0

    this one.

  49. I started with Perl by PerlPunk · · Score: 2, Informative

    Since the start of the review is basically a flame against Perl, I can't resist making a plug for it--especially since it was the first serious programming language that I learned.

    If a programming language is sufficiently powerful, you won't become proficient in it overnight. For myself, I went through three stages: tutorial, hobby, profession.

    It started with me back in 1999 when I wanted to learn HTML, and so I set out to learn it. But in the mean time, a friend of mine in the business told me that with Perl you could pretty much do anything you want in making web applications. At the time, I didn't know the difference between server-side and client-side scripting, and I figured, why not give it a try?

    So I searched on the internet and found Robert's Perl Tutorial. The introduction says, "It assumes that the reader knows nothing of programming whatsoever. . ." On reading it, I knew this was for me. So, eventually I found out I had to download Perl, which I did, and then I started going through the tutorial. URL: http://www.sthomas.net/oldpages/roberts-perl-tutor ial.htm

    Going through the tutorial took me two or three weeks. After finishing it, I decided to try to make my nascient website cooler than it was by adding some server-side scripting. Now that I wasn't just in the tutorial anymore, I had to learn something about CGI. That's when I found the site "CGI Programming 101", http://www.cgi101.com/class/ (I'm pleased it is still around, too.) From this I learned the rudiments of CGI programming with Perl.

    From this, I wrote a program called Article Master, which, had I stuck with developing it, could have been *the* killer-app blogging software instead of MovableType. (I'm sure there are probably 50,000 other geeks out there who also started out with something like this, discontinued development on it, and are still kicking themselves in the butt for missing out on coming out with the killer app.) In any case, after building the software and getting it to work kind of OK, I developed a deployment package for it and submitted it to an online Perl script archive. After submitting it, the archive gave me a free email address and access to the exclusive programming forums. The site sent me an email telling me I got these exclusive benefits because I was a programmer.

    I had never thought of myself as a programmer, but here was a site brimming with programmers telling me I was one of them. It was such a positive boost for me that it encouraged me further to develop my skills.

    Soon enough, I bought the Perl CD Bookshelf from O'Reily. Now, I had all the information and reference material I needed to write almost anything I wanted. I did some other personal online projects, and then, somehow I got the idea to try out getting a job using Perl. (This was at the beginning of 2000, just before the dot-com bust, so the entrance bar was set pretty low.) I called up a head-hunting agency and asked them if they needed someone who knew Perl. The agent on the other side said, "Get down here ASAP!" I went, I took their computerized test, and the results made him do backflips. (Hey, I knew what JAPH meant, and that was a question on the test!) He said he would have no problem getting me into a job, which he did. (And the money was more than I had ever dreamed of making.)

    When I started, I got an assignment (all CGI development) from one of the other lead programmers, and he asked me how long the job might take me. I hesitated, and just before I was about to say "a few days", he asked if I could do this in a few hours. I said, "Yeah, OK." I asked him if there was an HTML tool they used, and I just got this blank stare. I learned quickly that real Perl programmers don't use HTML editors--like our Perl code, we type everything else by hand. I somehow rose to the occaision and got the job done in time. From t

  50. Python Riddles by AlXtreme · · Score: 2, Interesting
    Recently came across pythonchallenge, it's a notpron/riddle site for learning Python, with each riddle requiring more and more code. Great idea, imho.

    As if python itself wasn't fun enough :)

    --
    This sig is intentionally left blank
    1. Re:Python Riddles by Tuross · · Score: 1

      It was pretty fun up until the point where it required using urllib (to retrieve more URLs than one has time to do manually), and urllib doesn't support NTLM-authenticated proxy servers. I was hence unable to continue.

      I'm fairly familiar with Python, and I enjoyed how the challenges were stretching my limits and making me think differently about the problem too. Good value for intermediate programmers.

      (I also found it recently via del.icio.us)

      --
      Matt
      1. Read Slashdot
      2. ???
      3. Profit
    2. Re:Python Riddles by juhaz · · Score: 1

      It gets annoyingly image processing centric at later levels, but first dozen or so are nice enough.

  51. Biased comment on perl by herve_masson · · Score: 1

    unlike Perl, it's very easy to do complicated things in simple, legible code.

    Not willing to start some useless python vs perl comparizon, your assertion is wrong: in perl, it is also easy to do complicated things in simple legible code. As someone who write and read perl code on a daily basis for about 5 years, I have the feeling that you should have written: "with perl, it is very easy to do complex things in obfuscated write-only code".

  52. More than one way... by Anonymous Coward · · Score: 0
    unlike Perl, many Python developers I know don't bother with a dozen ways to perform a simple action, they get it done and move on.

    I'd suggest an Obfuscated Python contest like the IOCCC, but I assume most Python coders actually have more important s--t to do.

  53. Re:Perl is for lumberjacks by baadger · · Score: 1

    Lumberjacks rule! When your tree falls upon and destroys a newly rehomed family's dwelling you can laugh at the accomplished architect maliciously, lunge at him with your axe and whip off his limbs...but watchit he'll bite your legs off

  54. also fortran uses indentation by bytemonger · · Score: 0

    This is also the case of Fortran77 which is probably newer than cobol, leftovers from the punchcards. Even with the latest fortran compilers from intel works best with old fortan77 code compared to porting it to fortran90 or fortran95. maybe because it lack most of the features in modern languages. Not even a function stack (recursion impossible). * C Hello World in Fortran 77 C (lines must be 6 characters indented) * PROGRAM HELLO WRITE(UNIT=*, FMT=*) 'Hello World' END

  55. yeah! OO stinks in perl by McKing · · Score: 2, Informative

    Objects!

    Perl == horrible bolted-on afterthought OO

    Python == *much* better (real objects, finally!)

    Ruby == pure heaven, everything is an object and iterable by default.

    I was bored one day at home and recreated a class in ruby that I wrote at work in perl. Took me all day to do something in perl that it took about 1/2 an hour to do in ruby, and I added a couple of features as well. I also spent way more time looking up how to do stuff in perl that in ruby, event though I've programmed off and on in perl for years (a decade, in fact)....

    --
    If only "common" sense was actually that common...
  56. Save FIFTEEN ($15) bucks! by Anonymous Coward · · Score: 0

    Save yourself $15.30 by buying the book here: Beginning Python: From Novice to Professional. And if you use the "secret" A9.com discount, you can save an extra 1.57%!

  57. Python is a straightjacket by Tony · · Score: 3, Insightful

    In Perl, it is easy to make legible code, and it is easy to make illegible code.

    In Python, it is easy to make legible code, but it is difficult to make illegible code.


    That's because Perl is versatile, flexible. Python forces you to do things The Python Way(tm). I've tried Python a couple of times, and I keep going back to Perl. Maybe I'm just a rebel, but I don't like a language telling *me* what to do (queue "In Soviet Russia..." joke here).

    And, yes, I mostly just hate the whitespace-as-blocking braindamage. It's like Guido loved LISP, but hated the braces, so he re-invented LISP, poorly. But that's why I love programming-- everybody gets to choose their favorite poison.

    --
    Microsoft is to software what Budweiser is to beer.
  58. My thought. by kurt_ram · · Score: 0

    Quoting "Handling indentation as code blocks" as a reason for why Python is better than any other language is not right. A good programmer will always indent his code doesnt matter which programming language he uses.

    --
    Clearly, Google is the next Microsoft.
  59. Python: Anti-Functional/Advanced Feature Bias? by logicnazi · · Score: 1

    So a couple months ago I got really into python. I've programmed in both C++, a bit of perl, and LISP (as well as a hodgepodge of other languages) and was really attracted to the powerful combination of functional tools and object oriented design. I found generators, iterators and other advanced language features absolutely great and started to really like the language.

    As I got a bit more into the language I started finding myself continually frustrated. Despite the "we're all adults" attitude about privacy and object protection it seemed Guido (guy in charge of python language) repeatedly made deciscions telling me that I shouldn't use features like co-routines, continuations or other powerful features except in limited circumstances (generators). I've even heard rumors about removing map (or was it apply) from the language. It wasn't that these features couldn't be implemented (stackless python did it) or they wouldn't be usefull (see ruby's use of coroutines) but as best I could tell Guido didn't like these functional or otherwise non-sequential features. Overall this lack of general functionality just made the language feel sorta unfinished and frustrating.

    I've moved on to ruby since then which, while underneath is pretty different, seems to give me all the features of python plus those general features like co-routines and continuations.

    Anyway this post might be a little off topic but I was wondering if there was any valid reason not to involve these powerfull features other than just personal taste. I can understand if some programmers coming from a procedural background might find these features confusing or harm code readability but is there any other reason? I love these sort of additions and I just can't figure out why, despite clear interest (stackless python, several PEPs) they aren't included in python to make it feel 'complete'.

    --

    If you liked this thought maybe you would find my blog nice too:

    1. Re:Python: Anti-Functional/Advanced Feature Bias? by arevos · · Score: 1
      Co-routines are supposed to be implemented in the next major Python update. I believe it's going to be just an extention of the yield keyword:
      def coroutine(x):
          while True:
              x = yield 2 * x
      Whilst the loss of map is no great loss, since list comprehensions handle it pretty well:
      def map(f, l):
          return [f(i) for i in l]
      Though I must say that I agree with your point in general. I use Python a lot, and my biggest gripe is along the same lines as yours. Namely, why can't I modify the methods and values of built-in types like str and int?
    2. Re:Python: Anti-Functional/Advanced Feature Bias? by logicnazi · · Score: 1

      Yes, in most cases the list comprehension works can work out (often better) than map and lambda. However, their are some examples using reduce (see discussion at lambda the ultimate). I don't know what the final verdict ended up being but clearly functional programming style is being discouraged.

      The only explanation google turned up for this is because python is supposed to have one way to do things. While I don't necessarily want a perl this seems to clash with the culture which prefers no explicit attribute protections. I just don't like feeling pushed and told to do things differently just because I *like* the functional style.

      Well I guess their is no reason to turn this into another argument over this issue. I think I have my answer. But I think if a language continues to push our people who prefer to do things in one style it is going to lose a lot of converts to other languages like ruby.

      Finally do you really mean a general yield is going to be in python 2.5. I understood this was the one issue that had technical problems unless you went to stackless python. Are you sure it isn't planned for python 3000.

      --

      If you liked this thought maybe you would find my blog nice too:

  60. Language Discipline by Tony · · Score: 2, Interesting

    . . . but if you are serious about maintainability then, to my mind, language enforced coding standards and a certain amount of "one right way to do it" has real value.

    Perhaps for you.

    "Maintainability" is undefined for this problem set. I can't maintain Python code because I fucking despise the language, for the same reason I don't like anal uptight bastards in three-piece suits -- it's inflexible. There's only one way of doing things, and often it is not be best way in specific situations.

    For me, it always comes back to blocking. Whitespace-as-blocking is a straightjacket, chosen for aesthetics, and not for any practical reason. This design philosophy permeates Python, making it one of the ugliest languages I know.

    It's like music. Any number of corporate-whore bands create smooth, aesthetic music that is bland and boring. I like my music hard, with sharp edges and dangerous points. For me, Python has always been the N*Sync of the programming world (VB is like New Kids On The Block, fwiw). Perl is more like the Pixies. LISP is like the Beatles. C is like the Stones. FORTH is like Gus' first album. Assembly is like the Black Keys. Java is like Abba.

    Huh. This is kinda fun.

    Now you can tell me about how programming is engineering, and not art. Go on, I know you want to.

    --
    Microsoft is to software what Budweiser is to beer.
    1. Re:Language Discipline by Coryoth · · Score: 1

      Actually I was going to say that I think classical sheet music compared to free form jazz would be a far better analogy. Put together a trio of classical musicians with a score and they'll do passably, but will seem quite stiff and uninteresting compared to a jazz trio just jamming. On the other hand you can put together a symphony orchestra with a score and get something very respectable. Try to get 50 jazz musicians to all do a free form jam together and mostly you'll get a mess.

      Jedidiah.

  61. whitespace (serious question, not troll, honest) by aurelian · · Score: 1
    A lot of people have religious problems with the whitespace significance in python, but I object to it on practical grounds. It bugs me every time I'm constucting conditional clauses - i.e. all the time. Coupled with the lack of a block quote (like /* */ in C), it means that if I want to move lines of code in or out of a condition, I have to cut and paste several lines, and edit their indentation. For large condition clauses this can be a real pain. In most other scripting languages, e.g. ruby, I just have to move an 'end' statement, or perhaps just comment out the if and end lines.

    Don't get me wrong - I'm all for having consistent and rigorous indenting once the code is finalised. I'm just irritated by the fact that the indentation has to be correct at every stage of the code development, even when I'm just experimenting with ideas. I like to be able to leave things a little messy while working on it, and then clean it up before moving to the next block of code. Using python is like having to always have a tidy desk even while you work at it.

    Also I hate the stupid colons. What are they there for?

  62. Re:Python is for architects - Perl is for lumberja by NewbieProgrammerMan · · Score: 1

    Wow...a comment on a Python story...about somebody wanting to be a lumberjack...can't....resist....

    The Lumberjack Song from "Monty Python's Flying Circus"
    Continued from Petshop, Barber, or a variety of other Python sketches....

    I never wanted to do this job in the first place!
    I... I wanted to be...

    A LUMBERJACK!

    (piano vamp)

    Leaping from tree to tree! As they float down the mighty rivers of
    British Columbia! With my best girl by my side!
    The Larch!
    The Pine!
    The Giant Redwood tree!
    The Sequoia!
    The Little Whopping Rule Tree!
    We'd sing! Sing! Sing!

    Oh, I'm a lumberjack, and I'm okay,
    I sleep all night and I work all day.

    CHORUS: He's a lumberjack, and he's okay,
                      He sleeps all night and he works all day.

    I cut down trees, I eat my lunch,
    I go to the lava-try.
    On Wednesdays I go shoppin'
    And have buttered scones for tea.

    Mounties: He cuts down trees, he eats his lunch,
                        He goes to the lava-try.
                        On Wednesdays 'e goes shoppin'
                        And has buttered scones for tea.

    CHORUS

    I cut down trees, I skip and jump,
    I like to press wild flowers.
    I put on women's clothing,
    And hang around in bars.

    Mounties: He cuts down trees, he skips and jumps,
                        He likes to press wild flowers.
                        He puts on women's clothing
                        And hangs around.... In bars???????

    CHORUS

    I chop down trees, I wear high heels,
    Suspendies and a bra.
    I wish I'd been a girlie
    Just like my dear papa.

    Mounties: He cuts down trees, he wears high heels
                        Suspendies?? and a .... a Bra????
                        (spoken, raggedly) What's this? Wants to be a *girlie*? Oh, My!
                        And I thought you were so rugged! Poofter!

    CHORUS

    All: He's a lumberjack, and he's okaaaaaaayyy..... (BONG)

    Stolen from here: http://bau2.uibk.ac.at/sg/python/Scripts/TheLumber jackSong

    --
    [b.belong('us') for b in bases if b.owner() == 'you']
  63. Re:whitespace (serious question, not troll, honest by corngrower · · Score: 1
    How is changing the indentation a pain. If you need to indent 15 lines, just move the cursor to the first line to be indented and use the command

    :15>

    Or mark the first line a, the last line b and use

    :'a,'b>

  64. Re:whitespace (serious question, not troll, honest by Chapter80 · · Score: 1
    You mean your editor doesn't allow you to highlight multiple lines, and change the indentation (indent more or indent less) with a simple keystroke?

    That was one error I consistently had, with C, C++, and Java was thinking something was conditional when it wasn't, and vice versa.

    I think significant indentation is a God-send.

    Now, for the colon.... I think it's just a delimiter - like "I'm done with the if condition". Like "Then" in Basic, or { in Java (with no } required).

  65. Re:whitespace (serious question, not troll, honest by corngrower · · Score: 1
    ...er that :15> should have been 15>> (or :.,.+14 >)

    To unindent 3 tabs, :.,.+14 3

  66. Re:whitespace (serious question, not troll, honest by aurelian · · Score: 1
    You mean your editor doesn't allow you to highlight multiple lines, and change the indentation (indent more or indent less) with a simple keystroke?

    Yes it does - I use vi - but I find that having to highlight multiple lines gets to be a real pain when the clause extends over many (e.g. > 20) lines, or involves a degree of hierarchy.

    for the colon.... I think it's just a delimiter - like "I'm done with the if condition". Like "Then" in Basic, or { in Java (with no } required).

    I know it looks like a delimter, but as far as I can see, unlike the {} in C it serves no syntactic purpose - the newline tells the intepreter that the body of the clause is next. All it is is an opportunity for syntax errors.

  67. Re:whitespace (serious question, not troll, honest by aurelian · · Score: 1
    sometimes I just want to move lines around and then quickly see what effect it has on the output. I find it frustrating having to edit their indentation as well as their location.

  68. Re:whitespace (serious question, not troll, honest by Anonymous Coward · · Score: 0

    On practical grounds:
    white space convention in Python makes it easier to write maintainable code.
    Basicaly its harder to make crappy indention. That I believe is the idea behind it. I earn my living maintaing other peoples code and believe me -- some programmers just have to do the indention their own way. Some do not use it at all. For those reasons (and some other) I prefer Python over other messy languages. Of course good coder can write beautiful code in any language. But honestly -- I have met quite few of them ;)

  69. "killer-app" by T-Ranger · · Score: 1

    ... does not mean what you think it means ...

  70. Re:whitespace (serious question, not troll, honest by aurelian · · Score: 1
    I understand where you (and other python advocates) are coming from on this. I also hate messy code, and I've also seen plenty, including people who don't indent at all. Such people should probably be forced to use python.

    But I think you're wrong when you say the white space convention 'makes it easier to write maintainable code'. What it does is make it harder to write unmaintainable code. I happen to think it also makes it harder for me to write maintainable code, in the sense that the actual writing process is straightjacketed in a way I dislike.

    I should add that I actually like almost everything in python apart from the whitespace thing - and I use it a lot!

  71. Re:whitespace (serious question, not troll, honest by Chapter80 · · Score: 1

    No new line required on the IF statement in Python. So the colon is significant in that case. I'm sure there are cases where there would be syntactic confusion without it, where the IF statement is on the same line with the conditional clause.

  72. Re:whitespace (serious question, not troll, honest by kpharmer · · Score: 1

    > A lot of people have religious problems with the whitespace significance in python

    I'd advise to give it a try. I understand that there are a few inconveniences. But after a few years of writing python code I find that these are very minor issues. On the plus side:

    1. there is more runnable code / line of text: Just like an ACM article from many years ago suggested, I find that my comprehension of code is aided if I can see entire code blocks, functions, classes, methods, etc all at once. Python is more vertically compressed in comparison to perl, java, etc - and so easier to see more code at once.

    2. no misleading indentation. The code runs the way it looks at first glance. Again, just another little feature that helps you in quickly understanding the code.

    I often have to look back at code I haven't seen for 6+ months. I settled on python because it was the easiest for me to pick up again later without having to invest more time in relearning the code.

  73. Re:whitespace (serious question, not troll, honest by Anonymous Coward · · Score: 0

    Well, you should be able to select blocks of text pretty easily. Example (in emacs ruby mode) --

    1) Move cursor to start of some long if block.
    2) Set the mark (C-Space)
    3) C-M-f (ruby-forward-sexp) moves the cursor to the 'end'
    4) Run comment-region (or uncomment-region)

    The colons are there so you can do one liners like "if foo: bar()"

  74. Try "Boo" by oblivion95 · · Score: 1

    Boo is like Python for .NET (or MONO on Linux). Really, it is a combination of the best parts of Python, Ruby, and C#. * It ALLOWS blocks instead of indenting in many places. * It ALLOWS Ruby/Perl-style regular expressions natively. * It infers types, so it can do compile-time type-checking w/o type declarations. * It ALLOWS type declarations. * It ALLOWS completely dynamic typing (like Python) via "duck" typing. (If it looks like a duck...) * It is nearly as fast as C# -- that's about 15 times faster than Python or Ruby. * It has full access to .NET/MONO. * It facilitates .NET extensions. * There are Boo C# converters if you want complete type-safety. * I could go on and on. It's a very flexible language.

  75. The one big argument against Ruby by ubernostrum · · Score: 1

    Is that unless you are a web application developer, Ruby's basically got nothing to offer. Not only is Rails the killer app for Ruby, it's the only app. That makes me uneasy about picking up the language.

    Also, you forgot Django in your mentions of Python web frameworks.

    1. Re:The one big argument against Ruby by chriss · · Score: 1

      Also, you forgot Django in your mentions of Python web frameworks.

      Well, I did not really forget it, I ignored it. Mainly to avoid the "there are lots of frameworks, all of which suck" discussion. From what I see Turbogears currently gets the most attention and is the closest in terms of "packaging" (including screencasts, PR etc.) to RoR, so I picked it for comparison.

      Chriss

      --
      memomo.net - brush up your German, French, Spanish or Italian - online and free

    2. Re:The one big argument against Ruby by ubernostrum · · Score: 1

      Well, I did not really forget it, I ignored it. Mainly to avoid the "there are lots of frameworks, all of which suck" discussion. From what I see Turbogears currently gets the most attention and is the closest in terms of "packaging" (including screencasts, PR etc.) to RoR, so I picked it for comparison.

      Django's in an odd situation, PR-wise. If you sit down and look at who's active in the communities, Django probably has the highest-profile people (in terms of names that'd be recognized by web developers or Python programmers) of any Python framework. And it easily has the largest installed base of any of the new generation of Python frameworks -- there are already Django-based commercial CMS products on the market, even. And when the "Snakes and Rubies" conference was held to talk about web frameworks, it was Rails and Django, not Rails and TurboGears. Somehow, Django is taking over the world without anyone noticing.

      I blame the lack of a screencast.

  76. perl vs. python fight a classic example by BadassJesus · · Score: 1

    It is really hard to convice people when recomending such a phony name language like "Python". Outside of the knowing community people were always reluctant to compliment Python.
    In another words if Perl has the design of Python then i would be an giant. Python with shady syntax of Perl would be another unknown script language.
    Its like the "Skoda" brand will never be a fancy sports car maker. Some people will always find it revolting to even bother.

    1. Re:perl vs. python fight a classic example by Chapter80 · · Score: 1
      I'm not disagreeing with you, there's something about the name. But what is it? Is C++ more charming in some way? Does the name need to be geekish? How is Java's name more attractive then Python?

      Is it just that Python is named after some comedians (who a lot of people frankly don't "get"), whereas Java is named after a beverage? Would a pun be better? Like C++ is to C and C was to B and Ruby is to Perl (take off on Pearl?)

      What's in a name?

  77. Pascal is cool by weierstrass · · Score: 1

    It was designed for students.
    it's a good balance between languages that are too high-level to get a good idea of what the machine is doing, and c/c++ which aren't really worth learning unless you're prepared to get into all the low-level concepts like pointers, and also learn a little bit about assembler.
    two downsides are;
    -it's a bit obsolete now. but fine for doing command line based stuff, even quite complex things
    -a the edit-compile-run cycle of a compiled language can be quite slow if you're spending long periods of time hunting for bugs. you will be.

    --
    my password really is 'stinkypants'
  78. You don't need python books by The+OPTiCIAN · · Score: 1

    I spent a while collecting python books whilst trying to get fluent in it. On the whole, they're a complete waste of time. The oreilly jython book was useful as a syntax guide (but with python having come so far since then I'd avoid it now), and the python cookbook is occasionally useful. It's one of those books you read through to learn solutions to problems you've encountered in the past, rather than in anticipation of patterns you might need.

    Basically - the python online documentation is adequate. It could have a few more examples in it, it's not as practically focussed as it might be, but it's better than anything else I've seen.

    Here's how I'd recommend learning python
    1) discpiline yourself to sit through a slab of the
    2) get really comfortable for the pattern of opening a file, reading lines from it, closing it
    3) get really comfortable with the pattern for list matching, [item.getName() for item in list] - this is gold
    4) try to solve a tiny problems with python a couple of times a week. It helps if it's practical. My first was a program that listed the files in a directory and wrote a html index page linking to them.

    If you can get this far, you're on the right path, and you don't need any books to get there. After this point you'll find yourself dropping into the python prompt to write little scripts to solve problems, and occasionally looking for modules to do slightly interesting things and - you're not there yet - but you're going to get there from this point. As time goes on become more familiar with lambda, map and reduce - these are fantastic, powerful approaches to solving poblems. If you haven't done any functional programming it's a bit weird to start with, but stick in there, it's worth it.

    --


    Believe with me, my saplings.
  79. Re:whitespace (serious question, not troll, honest by pilkul · · Score: 1
    In most other scripting languages, e.g. ruby, I just have to move an 'end' statement, or perhaps just comment out the if and end lines.

    Er? This sounds like it requires almost exactly the same number of keystrokes as adding/removing indentation.

  80. Artical summary blows it again. by Hosiah · · Score: 3, Insightful
    And, unlike Perl, it's very easy to do complicated things in simple, legible code.

    I just burned through the flamewall on this issue not three days ago. I use Python instead of Perl, love Python best of all languages currently, and may even like the book reviewed. But it is superstitiously ignorant to declare any language makes it "easier" to program in. Can we just once have a discussion of the strengths and weaknesses and merits and demerits of any language at all, instead of talking about it like it was a laxative? "Makes the code soft and it flows out smoothly!" No, it doesn't: nothing does; hard programs are hard to write, easy programs are easy to write. I'll even save the time and copy my closing argument from last time:

    I know a secret. It's a secret you only find out after programming for a while. It's one you obviously don't know if you ask me which programming language is the "easiest".

    There is this public perception, unanimous in user-land, and even permeating to the very depths of Slashdot, which goes: "Computers are only hard because evil computer programmers deliberately set out to make them hard." And the secret is: that that's a falsehood. Computers are not made artificially difficult. It does no good to tell you this; this is a special kind of secret that you can only learn through experience.

    The experience of struggling to design a usable user interface for your own system. The struggle to overcome the barriers of closed systems, lack of documentation, and misinformation everywhere you turn. The exasperation of dealing with users who come to you with the attitude that your program broke on purpose, you should fix it without knowing what the error was, and it's too hard to learn anyway because you make it difficult, because you're "evil".

    Programming experience erases that mental line drawn between user and programmer. You get experience on both sides of the fence, and eventually you see that there is no such thing as artificial complication. Interfacing with a machine upon which we have taught electricity to think and where we hope to make it sing and dance for us is inherently complicated TO START WITH, and the various tools we use to perform our tasks - why, each and every one was written by average people like you and me who also sat down with a clean file and furrowed their brow and wondered "How can I do this? How can I make it so people will use it?"

    No, you still have that mental mindset that there are programmers who deliberatly design things to be difficult, that it's all in spite, that they're laughing at you. Who, except as a joke, would deliberately make a programming language "hard to learn"? To fail at your task and blame your tool is simply a form of denial so that you don't have to face the fact that you have given up on trying to use something (no matter if it's COBOL or Javascript or Perl or freaking TECO, even!) that hundreds of other people have used successfully.

    There is no "easy". There is no "hard". There is only "Task".

    Now, you want to talk about an "easy" language? Binary, of course! Binary has just two commands (one and zero) so it's the fastest to learn, has cross-platform compatibility built-in (all computers know binary!), is easiest to test (no compiler or interpretter required, just "Rite 'n' Run"!), is readily available everwhere (ALL programs are "open source" in binary!), and needs no extension libraries (Binary can do it all!). If you thought this paragraph was stupid, this is how stupid the rest of you sound to me when you hyperfocus on "easy" and act like there's no other aspect to programming.

    1. Re:Artical summary blows it again. by horza · · Score: 1

      Surely you know that C++ is a hoax? What you fail to take into account is that people learn from their mistakes. Languages do become easier (though at an expense). For instance a lot of C program instability and security problems come from failing to free() memory or trying to reference null pointers. Modern languages use system based memory allocation with automatic garbage collection. Perl has many ways of doing things, an obscure syntax, and worst a hacker mentality. C and Java programmers are introduced to "style guides" before learning the actual syntax and functions, which enables one programmer to simply read the code of another. Python uses indenting to enforce its own style guide. Your binary example is not cross-platform as it would have to be recoded for every platform. When I was at college we had to program an embedded processor directly in binary using a toggle switch, and it wasn't easy and quite error prone.

      Multiple languages leads to a survival of the fittest, with derivative languages borrowing from the previous stronger surviving languages (eg C# from Java). Programmers are lazy and thus driven to make life easier for themselves. Hence they create new or even competing libraries (ala Qt vs GTK)... and languages. And long may it continue.

      Phillip.

  81. Or cut your teeth in a higher level language by Nicolay77 · · Score: 1

    And learn Lisp.

    Then design patterns become meaningless because there's no language limitations to try to overcome.

    I mean, machines are faster everyday, and programmer time is more expensive. So it's better to use more powerful abstractions.

    --
    We are Turing O-Machines. The Oracle is out there.
  82. A much easier lisp book by Nicolay77 · · Score: 1

    I found PCL useful to get that "ohh this sh*t is powerful" feeling, but very confusing to learn lisp.

    In contrast, this book takes your hand and teaches you in a very beginner friendly way, so you have better and long lasting foundations when you reach the end of the book:

    http://www.cse.buffalo.edu/pub/WWW/faculty/shapiro /Commonlisp/

    --
    We are Turing O-Machines. The Oracle is out there.
  83. Excellent!!!! by youknowmewell · · Score: 1

    That looks really good! I think I'll start with that to get a hang of the language before moving onto PCL. Thanks a lot!

  84. Perl and PHP references suck by SimHacker · · Score: 1

    Oh come on, face it: reference were thrown into Perl as an afterthought, and they're kludgy, badly designed, overly complex, absolutely horrible and unnecessarily subtle. PHP is crippled with the exact same problem, because it's a cargo-cult programming language, which tries to ape the superficial aspects of Perl and C++, instead of having a clean well thought out design.

    References in Perl and PHP disingenuously try to LOOK like C++ references by using the same punctuation character (thus misleading C++ programmers into thinking they understand what's going on), but they're each totally different ad-hoc kludges thrown in long after the base language was designed. At least C++ references are well defined in terms of pointers, so there aren't so many horrible edge cases that cause the interpreter to core dump:

    Bug #30674: Unexpected results and core dump with recursive references serializing
    Bug #32660 Assignment by reference causes crash when field access is overloaded (__get)
    Bug #22237 PHP crashes when class references property using variable variable
    Bug #34277 array_filter() crashes with references and objects
    Bug #22510 Zend Engine crashes calling FREE_ZVAL from zend_assign_to_variable_reference
    Bug #16387 PHP loop when using reference to an object in an object (both in session)
    Bug #34137 assigning array element by reference causes binary mess
    Bug #32179 xmlrpc_encode() Segmentation fault with recursive reference
    Bug #31525 object reference being dropped. $this getting lost.
    PHP: References Explained:

    Since references are more like hardlinks than pointers, it is not possible to change a reference to an object by using that same reference. For example: The following WILL NOT WORK as expected and may even crash the PHP interpreter:
    $object =& $object->getNext();
    However, by changing the previous statement to use a temporary reference, this WILL WORK:
    $temp =& $object;
    $object =& $temp->getNext();

    Face the reality: This is just the tip if the iceberg, a few samples of the many hard crashes caused by the half baked implementation of references in PHP, because it's such a horribly designed and deeply flawed language. Those crashes are actually caused by bugs in the programming language itself, even though the programmers were following the rules -- but there's no way of counting the zillions of actual PHP and Perl programs that crash or produce incorrect results because the people who wrote them don't understand the subtleties and limitations of PHP and Perl references.

    References in Perl and PHP are unlike references in any other reasonably designed programming language: they totally suck. They're extremely hard to understand, but sometimes they still crash the interpreter, even if you do understand them perfectly and use them correctly.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
    1. Re:Perl and PHP references suck by brpr · · Score: 1

      References in Perl and PHP disingenuously try to LOOK like C++ references by using the same punctuation characte

      I don't know about PHP, but the ampersand character is not used for anything connected to references in Perl. Do you know any Perl?

      At least C++ references are well defined in terms of pointers, so there aren't so many horrible edge cases that cause the interpreter to core dum

      And there follows a long list of bugs...in PHP! We're talking about Perl here!

      References in Perl and PHP are unlike references in any other reasonably designed programming language: they totally suck. They're extremely hard to understand, but sometimes they still crash the interpreter, even if you do understand them perfectly and use them correctly.

      No, references in Perl do not crash the interpreter. Though they have a slightly weird syntax for dereferencing, there's nothing fundamentally complicated about them. If you can't grok references in Perl, your programs are going to crash whatever language you write them in.

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
  85. Haskell rocks! by SimHacker · · Score: 1

    That's quite true: Haskell's notion of pattern matching is much more powerful and extensible than mere regular expressions.

    Jim Clark's Haskell implementation of the derivative algorithm for validating Relax NG is a wonderful example of how powerful, elegant and concise Haskell is. Relax NG is all about tree structured regular expressions over "hedges" (mixed trees of XML elements and text). It's based on the same automata theory as regular expressions, extended to describe "hedges" (XML documents).

    An Algorithm for RELAX NG Validation By James Clark, January 07, 2001. Author's note to XML-DEV: 'I have written a paper describing one possible algorithm for implementing RELAX NG validation. This is the algorithm used by Jing, which I believe has also been adopted by MSV... If you try to use this to implement RELAX NG and something isn't clear, let me know and I'll try to improve the description.' From the introduction: "This document describes an algorithm for validating an XML document against a RELAX NG schema. This algorithm is based on the idea of what's called a derivative (sometimes called a residual). It is not the only possible algorithm for RELAX NG validation. This document does not describe any algorithms for transforming a RELAX NG schema into simplified form, nor for determining whether a RELAX NG schema is correct. We use Haskell to describe the algorithm. Do not worry if you don't know Haskell; we use only a tiny subset which should be easily understandable." Jing is a validator for RELAX NG implemented in Java;

    Another interesting Haskell library for XML is HaXml:

    Consider Haskell in lieu of DOM, SAX, or XSLT for processing XML data. The library HaXml creates representations of XML documents as native recursive data structures in the functional language Haskell. HaXml brings with it a set of powerful higher order functions for operating on these "datafied" XML documents. Many of the HaXml techniques are far more elegant, compact, and powerful than the ones found in familiar techniques like DOM, SAX, or XSLT. Code samples demonstrate the techniques.

    Here's some more stuff about Relax NG, comparing the Haskell implementation to the Java implementation (jing): Maximizing Composability and Relax NG Trivia:

    Here's some interesting stuff about the design and development of Relax NG:

    James Clark wrote about maximizing composability:

    First, a little digression. In general, I have made it a design principle in TREX to maximize "composability". It's a little bit hard to describe. The idea is that a language provides a number of different kinds of atomic thing, and a number different ways to compose new things out of other things. Maximizing composability means minimizing restrictions on which ways to compose things can be applied to which kinds of thing. Maximizing composability tends to improve the ratio between functionality on the one hand and simplicity/ease of use/ease of learning on the other.

    Clark describes the derivative algorithm's lazy approach to automaton construction:

    I don't agree that <interleave> makes automation-based implementations impossible; it just means you have to construct automatons lazily. (In fact, you can view the

    --
    Take a look and feel free: http://www.PieMenu.com
  86. What (or who) is Python good for? by oblivion95 · · Score: 1


    The language warriors miss the point: Some languages are better for some tasks than other languages.

    Python is a wonderful language for part-time programmers. Why? Because Python ...
    * is very easy to learn (no weird symbols or idioms)
    * enforces indentation
    * encourages legible code (few side-effects)
    * encourages useful documentation (in the comments)
    * encourages testing (esp. doctest)
    * encourages modularity (via directory structure)
    * encourages OOP (defining a class is trivial)
    * can be extremely productive (with great libraries)

    I work with people who need to do a lot of work in a "glue" language, but they are not professional programmers. When they use Tcl, I cannot easily re-use, maintain, or extend (via C++) their code. Perl is better, but only because the resulting code is much shorter. These people use Perl and Tcl because that's what they know. Whenever I convert someone like that to Python, they and the people who use their code become more productive.

    Ruby is a wonderful language for a programmer, but is it simply not as easy to learn. The block-syntax (with ||) is awkward. Unless you know Perl, regular expressions are too terse. Modularity and OOP are simple but not trivial (which they must be or they will be ignored). Testing is easy, but documentation is as ugly as Perl's.

    Also, because of its slow speed, Ruby should be considered a proto-typing language, unless the application simply does not require speed. I think Ruby is perfect for web development, because its flexibility (e.g. mixins) makes the incomprehensible almost manageable.

    For proto-typing,
    if the target is C++, use Ruby (or Python + Boost);
    if the target is C#, use Boo;
    if the target is Java, use Jython.

    For embedding, I like Lua. It's small, fast, and easy to learn.

    For serious, large-scale, mission-critical systems programming, there are better choices than Python and Ruby: Ocaml (or F#), Haskell, Eiffel, Scheme, Ada, etc. The experience and taste of the programmer count more here.

  87. Why no Python or Perl on cheap web hosts? by walterbyrd · · Score: 1

    The competition for cheap web-hosters must be off the scale. Yet, they all compete in the same way, offering more drive space, or more download amounts. It seems like somebody would try to differentiate themselves by adding products that are free anyway.

    They all seem to want to offer PHP/MySQL. Couldn't they just as easily offer Python or Perl? And maybe PostgreSQL while they're at it? Python, Perl, and PostgreSQL, are all free, so why not?

    Although my experience in PHP/MySQL is limited, I consider both to be inferior technologies. PHP syntax is inconsistant, and the developers of PHP seem hell-bent on constantly breaking backward compatibily. Unlike Perl, or Python, PHP seems to be limited to web development only. I don't like MySQL's goofy subset of SQL. I also don't like MySQL strange licensing scheme. I don't like MySQL's partnership with scox either.

  88. Mark Lutz book (Learning Python) by blais · · Score: 0

    I offer a professional on-site Python training course (http://furius.ca/training/).

    I recommend "Learning Python" (M. Lutz) to my students, over any other book. This book both offers a great introduction to the language and explains the unifying concepts much clearer than any other Python book I've seen. It also goes deep into the details if you need it. The book oozes of the many years of experience of the author in teaching the language.

    (That said, I haven't read the new book being reviewed in this article.)

  89. Re:Article summary blows it again. by whitroth · · Score: 1

    Thank you.

    I am *so* friggin' tired of "this *N*E*W* language is *so* much better/easier to use/faster than that old language, no one should be using that anymore. Fads, that's all it is.

    Then there's why should I learn this language, when I see language b, c, and d (say, Ruby and PHP) as being the New, Best-of-all?

                mark

    Objectionable Oriented Programming: enforcing 30 years of good programming style by compiler, for turkeys that still struggle to write spaghetti code.

  90. If you want to automate system tasks... by jotaeleemeese · · Score: 1

    .... then you need to learn a shell language and the OS utilities.

    I would suggest you learn sh (Bourne Shell) first, since it is the most basic of them, is found in all UNIX or UNIX like OSes, and many modern ones are derived from it (in some systems is the shell used by default when you try to start an script).

    Once you are comfortable with that try ksh or bash (but this one only if you have to). They are more versatile and adhere pretty much to sh's basic syntaxis.

    --
    IANAL but write like a drunk one.
  91. "written in WFL": 5 by jotaeleemeese · · Score: 1

    You are an old fart. Most people here have no idea what that is :-)

    --
    IANAL but write like a drunk one.
  92. Another interesting comparison by cortana · · Score: 1

    SLOCCount statistics for Debian 3.1 (sarge): http://libresoft.dat.escet.urjc.es/debian-counting /sarge/index.php?menu=Statistics

    120e6 lines of C. Perl is in 5th place with 6e6 lines, and Python is in 6th with 4e6 lines.

  93. Obligatory Fortran advocacy... by Manhigh · · Score: 1

    "written in fortran" 208,000

    Didnt bother specifying Fortran4, Fortran77, Fortran90, Fortran 95

    --
    "Open the pod by doors, Hal" > "I'm afraid I can't do that, Dave" sudo "Open the pod bay doors, Hal" > alright
  94. bash.org by Mr.+Jax · · Score: 1

    From bash.org http://www.bash.org/?400459:

    <Sonium> someone speak python here?
    <lucky> HHHHHSSSSSHSSS
    <lucky> SSSSS
    <Sonium> the programming language