Slashdot Mirror


Yahoo! Launches Python Developer Center

SimonW writes "Yahoo! has launched a Python Developer Center as part of their Developer Network. The new site explains how to access Yahoo!'s many web service APIs using Python, and includes tutorials on using Python with REST, JSON, XML and RSS. The site joins Yahoo!'s existing developer centers for PHP and JavaScript."

125 comments

  1. Javascript by kevin_conaway · · Score: 4, Insightful

    Python developer, I think this is great. I'm glad that Python is gaining more acceptance.

    If the quality is on par with their Javascript library, we're in for a real treat

    1. Re:Javascript by Anonymous Coward · · Score: 0

      I love how people who've never written a line of Python code feel the need to lie about it.

      Seriously, try writing Python and indenting with tabs. It works fine.

    2. Re:Javascript by EatHam · · Score: 1

      if you use the Python IDE it does; however, if you develop for Windows, and use Notepad++ or Notepad, it does not work fine.

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

      Yes, it does work fine.

      I'll bet any amount of money that your problem is that you are indenting with tabs on some lines and spaces on other lines, which is something that Python cannot compensate for because tabs aren't a fixed width.

      The reason you aren't seeing it in an IDE is because the IDE is automatically converting the tabs to spaces or the spaces to tabs.

      I'll repeat myself: Python works fine when you indent with tabs. Only people without any kind of clue about Python say otherwise.

    4. Re:Javascript by stuntpope · · Score: 1

      Wrong, and though I'm redundant, I'll repeat it so it's visible in the thread. You can write Python in DOS edit, notepad, TextPad, anything on windows that saves as plain text, and as long as you are consistent with what you use for indentation (all tabs, or all spaces), it will work.

    5. Re:Javascript by Vexorian · · Score: 1

      I would never understand python and making it indent-dependant ruined the language in my opinion, lack of block begin/close is just lame and makes the stuff harder to read besides it goes against one of the main principles of programming . Programs must have an start and an end.

      I actually think that if anything it makes things harder to read. For an scripting language that is supposed to be easy then specific begin and end blocks for different kinds of statements are always a good idea. So you know that "that while is finishing just after that if finishes" instead of "I see two }} , I'll have to scroll up to figure out what they are closing" or "I see that statements are not so on the right anymore I wonder what actually finished here".

      If the idea behind that was saving time then it probably has some credit but how much time is that anyways? I also thing that indenting wastes more time than that. If the idea was to make programs smaller I would wonder what were they smoking, an scripting language would never be good enough for big projects, and would be perfect for small ones. In other words the space saved by this idea is almost null.

      If the idea was to make python unique, congratulations! You just have a unique language that has one of the worst syntax designs ever!.

      Well I am not saying python sucks or anything I am just saying that I can't stand that kind of syntax - I am only talking for myself here.

      --

      Copyright infringement is "piracy" in the same way DRM is "consumer rape"
    6. Re:Javascript by Anonymous Coward · · Score: 1

      lack of block begin/close is just lame

      Why? It's the same amount of functionality in less code.

      and makes the stuff harder to read

      Have you ever tried to read a Python program? Python's one of the most readable programming languages around. Part of this is because it doesn't use entirely superfluous syntax like curly braces everywhere.

      it goes against one of the main principles of programming . Programs must have an start and an end.

      What are you talking about? You do realise that the beginning and end of a block is still there, even if there's no explicit syntax marker present?

      How can you possibly get the idea in your head that because Python uses whitespace to delineate blocks that it means Python programs have no beginning or end? Have you ever programmed - in any language? Or are you just making this up as you go along?

      So you know that "that while is finishing just after that if finishes" instead of "I see two }} , I'll have to scroll up to figure out what they are closing" or "I see that statements are not so on the right anymore I wonder what actually finished here".

      So your problem isn't the significant whitespace at all, it's the fact that you don't have to close blocks with a statement that's unique to the statement that began the block. Virtually all programming languages suffer from this problem, it's nothing unique to Python.

      Well I am not saying python sucks or anything I am just saying that I can't stand that kind of syntax

      Quick question: have you ever spent any significant amount of time writing Python?

    7. Re:Javascript by SirSlud · · Score: 1

      C/C++/Python/Perl/PHP/Javascript/ServersideJS/Java

      They're all good, they're all useful, and they're all readable (although Perl comes at the bottom of my list.)

      But your block-ending comment is inane. You can never know *what* block was ending (ie, what control or condition statement started the block) without scrolling up, indentation-dependant or curly-brace dependant. You must use *really* fancy closing brakets; the kind that actually contain meta-data on the block they're closing or something.

      I kinda like Python regarding intendation because nobody can check anything in if it isn't properly indented. C/C++ sources edited by teams of 10+ end up getting pretty messy and unreliable. The amusing thing is that you dont need *any* indentation in C/C++ et al, and yet people still do it because .... drum roll .. it makes the code easier to read.

      Spend some time with Python and stop outright dismissing languages. Its got its place in the world of languages. I'm immediately suspicious of programmers who dismiss languages outright. It suggests to me that you havn't worked in a programmer in many different fields where a wide variety of tools are useful, or even better, the kind of job where using a wide variety of tools, if intelligently selected and used, makes development easier to code and easier to maintain.

      But picking on indent-dependant or curly-brace dependant .. man, that is so esotaric, thats a programmer who is missing the point. Its a question of preference, not language superiority. Different people prefer different things, but no serious programmer would consider it a reason to tear down a language.

      --
      "Old man yells at systemd"
    8. Re:Javascript by bogado · · Score: 1

      Have you ever tried to read a Python program? Python's one of the most readable programming languages around. Part of this is because it doesn't use entirely superfluous syntax like curly braces everywhere.


      just because it is readable to you, that is used to it, don't mean is automaticly readable to everyone. Block delimiters, be they brackets like C derived languages or the "do" "end" from other languages like ruby do help reading. The lack of delimiters make it harder to understant when two blocks end at the same spot. For instance, when you get out of more then one block at the sametime there is no clue to how many blocks are ending. You have to scroll back to measure the identations.

      Also how do you measure identation? Is it the number of characters? Many editors insert space when you hit tab, while others have a diferent tab size then the standard. Sure it is bad style to mix tabs with space, but many people like to it anyway using for instance 4 spaces for the first ident mark and one tab to second. I'm not even sure how would python deal with this.

      Anyway I don't think that languages should force a style into the programer. Sure there should be a prefered style, but this should be a choice, mainly in such a point as identation styles.

      Just so you don't mod as down as I imagine I will get mod, :-), I don't use python myself, but I do like it. I think it is a good choice when doing interface bits.
      --
      []'s Victor Bogado da Silva Lins

      ^[:wq

    9. Re:Javascript by bogado · · Score: 1

      I am one of those programers, I tried python two or three times and there are other things that I don't like about it, like having to declare the "self" parameter for instance. But all of those things are minnor in relation to the "white space" is the block thingy. This makes it harder for me to read the code, make's it all ugly and seem wrong. It takes the fun out of the programing.

      I like ruby much better, too bad it is not as popular as python. But the main point here is that all of this is a matter of taste. Diferent people like diferent stuff, and as you had said yourself all languages are somewhat similar levels technicaly speaking, with some being slightly better in some particular cases.

      --
      []'s Victor Bogado da Silva Lins

      ^[:wq

    10. Re:Javascript by Anonymous Coward · · Score: 0

      For instance, when you get out of more then one block at the sametime there is no clue to how many blocks are ending. You have to scroll back to measure the identations.

      You know how many blocks are ending by how many indentation levels are dropped. You can't tell the difference between eight spaces and four spaces?

      Also how do you measure identation? Is it the number of characters?

      It's the level of indentation. Indent with as many characters as you like, as long as you are consistent it will be fine.

      Sure it is bad style to mix tabs with space, but many people like to it anyway using for instance 4 spaces for the first ident mark and one tab to second.

      I've never heard of this and can't even conceive of why somebody would want to do this. I suspect you're trying to come up with the most pathological case possible rather than what people actually do.

      I don't use python myself, but I do like it.

      Which is precisely my point - if you did use Python on a regular basis, you'd find that these things simply aren't important. I thought the same kinds of things as you before I started using it on a regular basis too, but I was wrong and so are you. It's an extremely common change in perspective. Read Eric S. Raymond's take on the matter, for example, where he admits that he thought significant whitespace was "like stepping in a steaming pile of dinosaur dung" until he started using it, where it stopped feeling unnatural after about twenty minutes of writing code.

    11. Re:Javascript by SirSlud · · Score: 1

      You lost me when you said that it takes the "fun" out of programming.

      --
      "Old man yells at systemd"
  2. Javascript The 'L' Word. by Anonymous Coward · · Score: 0

    "Python developer, I think this is great. I'm glad that Python is gaining more acceptance."

    Up next...Lisp! Oh, wait.

    BTW What do Yahoo API's provide?

    1. Re:Javascript The 'L' Word. by Reverend528 · · Score: 1
      Up next...Lisp! Oh, wait.

      The web already has a Lisp dialect. It's called XML.

    2. Re:Javascript The 'L' Word. by Anonymous Coward · · Score: 0

      XML isn't a Lisp dialect, it's a crime against humanity.

    3. Re:Javascript The 'L' Word. by Anonymous Coward · · Score: 0

      Precisely the reason why it's a dialect of lisp.

    4. Re:Javascript The 'L' Word. by bhaberman · · Score: 1

      No, XML is fine. DSSSL is a crime against humanity.

  3. Whython by CopaceticOpus · · Score: 3, Interesting

    It's pretty cool of Yahoo to provide so much to the dev community. It's definitely improved my feelings about the company.

    I wonder why they've made this foray into the Python world? I know they decided to focus on PHP a few years back. Did they find some tasks were easier to accomplish in Python? Or are they simply trying to reach out to another developer community?

    1. Re:Whython by carlivar · · Score: 2, Informative

      yp.yahoo.com uses Python.

      --
      Vote Libertarian
    2. Re:Whython by maxume · · Score: 1

      It wasn't a 'corporate' effort. See:

      http://simon.incutio.com/archive/2006/08/08/ydn

      --
      Nerd rage is the funniest rage.
  4. How refreshing! by y5 · · Score: 1, Interesting

    Every time I see a story about Yahoo concerning developers, it's exactly what I want to hear. While their competitors are saying "do no evil", Yahoo seems to be living it.

    I don't know if I'm quite there yet, but my hard-to-break habit of Googling everything might be worth breaking if this kind of developer-focused attitude from Yahoo continues like it has. It's at least very tempting.

    1. Re:How refreshing! by Daytona955i · · Score: 3, Funny

      Yes, because it's not like google has anything like this available.

    2. Re:How refreshing! by LnxAddct · · Score: 3, Insightful

      Because Google's Summer of Code, or code.google.com or, more importantly, code.google.com/hosting weren't enough? The hundred patches that Google gave back to Wine after getting Wine to work with Picasa, or the many other libraries and APIs that Google provides. What Yahoo is doing is great, but you're not giving Google nearly enough credit.
      Regards,
      Steve

    3. Re:How refreshing! by y5 · · Score: 5, Interesting

      What Yahoo is doing is great, but you're not giving Google nearly enough credit.

      You might be right. But I've had the chance to use the Web API's for Yahoo, Google, and MSN. Yahoo's Web Search API has been much easier to use than Google's or MSN's. I know there are many other API's to use than just web search, but I've been impressed with what I've seen from Yahoo, more so than from the others.

      Direction is everything, and you have to admit Yahoo has been moving in the right direction lately. Here's to hoping they don't lose focus of what's giving them such good publicity! =)

    4. Re:How refreshing! by rainman_bc · · Score: 1

      While their competitors are saying "do no evil", Yahoo seems to be living it.

      Need I remind you about the X10 popups? That caused me to switch my home page over to Google and have never, ever looked back.

      Perhaps Yahoo is just playing catchup to google with crap like search.yahoo.com and now this. Seems like they are no longer innovating but they are just copying.

      Seen their new Mail client? Fully Ajax driven. Hmmm. Gmail anyone?

      --
      09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
  5. Now Ruby! by BigTunaCan · · Score: 0, Interesting

    I think this very cool. I hope that this means that a Ruby version is on the horizon!

    1. Re:Now Ruby! by Slaimus · · Score: 1

      The whole point of a web service is that it is language-neutral. There is nothing preventing you from using Ruby or any other language that can take advantage of web services. Just look at the WSDL and make use of it.

  6. Yawn. by JoeyLemur · · Score: 2, Funny

    Wake me when they create a Ruby/Rails section.

    Guido! Let my whitespace go!

    1. Re:Yawn. by Anonymous Coward · · Score: 3, Funny
      > Wake me when they create a Ruby/Rails section.

      Snakes and a Train?

    2. Re:Yawn. by thryllkill · · Score: 1, Funny

      I think you might be in for a looooooong sleep there buddy.

      --

      Note to self: No more arguing with the faithful.

    3. Re:Yawn. by Anonymous Coward · · Score: 0
      Ruby is smalltalk without the JIT, many people like ruby. Rails is a crappy web development framework that lets people build dull cookie-cutter apps. Frameworks are just a fad, eventually the few worthwhile functions will become part of the std lib for every web development language. Pick one of the following:

      Abstraction || Versatility
    4. Re:Yawn. by twocents · · Score: 1

      Ughhh, so you're touting a model-view-controller type of Web development framework and yet you need a tutorial from Yahoo in order to tie into neutral services?

      Why don't you write a Rails/Yahoo API tutorial?

    5. Re:Yawn. by Anonymous Coward · · Score: 0

      We got motherfuckin snakes!

    6. Re:Yawn. by Black+Perl · · Score: 1

      Pick one of the following:

      Abstraction || Versatility

      That's what I thought too. I was very skeptical until I actually started learning rails. I now see why it is getting very popular, because it takes advantage of some of the unique aspects of Ruby to blur that dividing line. It actually provides both abstraction and versatility. You get a lot of help out of the box or through an increasing number of plugins, but there are also convenient hooks to customize apps in pretty much any way you want.

      --
      bp
    7. Re:Yawn. by Anonymous Coward · · Score: 0

      And I hope they burn in hell!

  7. RSS by Anonymous Coward · · Score: 0

    http://rsstool.berlios.de/ taught me everything I needed to know about taking advantage of RSS feeds.

  8. Howto by kevin_conaway · · Score: 3, Informative

    Furthermore, unlike their previous offerings, they have released little new code here. The only code they have released is an API to their search engine. The rest seem to be HOWTOs on how to python to access their services.

    Still good info though. Thanks

  9. OMG! by Anonymous Coward · · Score: 0

    Launch...?

    Python....?

    ....Snakes on a Plane!!!

  10. Value of their feeds? by halosfan · · Score: 3, Interesting

    While browsing through this, I noticed the following in ther Weather RSS feed page:

    The feeds are provided free of charge for use by individuals and non-profit organizations for personal, non-commercial uses.

    and then

    Yahoo! also reserves the right to require you to cease distributing these feeds at any time for any reason.

    So, while it's cool and all, is there any value to using their weather RSS feed (and I assume it's similar with other services), beyond my ability to play with them? I mean, even I'm not making any money off it, presumably, if I put the effort in accessing those feeds, I expect them to be available to me in the future? Or do they provide a paid-for version for this?

    --
    My only problem with Microsoft is the severity of bugs in their software.
    1. Re:Value of their feeds? by kevin_conaway · · Score: 1
      Yahoo! also reserves the right to require you to cease distributing these feeds at any time for any reason.
      So, while it's cool and all, is there any value to using their weather RSS feed (and I assume it's similar with other services), beyond my ability to play with them? I mean, even I'm not making any money off it, presumably, if I put the effort in accessing those feeds, I expect them to be available to me in the future? Or do they provide a paid-for version for this?

      I would imagine that its just cover-your-ass legalese on their part but I could be wrong. I wouldn't not use the feeds based on the extremely off chance that they would stop letting you use them.

    2. Re:Value of their feeds? by 0racle · · Score: 3, Insightful
      I expect them to be available to me in the future
      Why? It's their service, they could stop it or move it to a pay service at any time. Guess what, anyone providing a free service could do that even (gasp) Google. They could make GMail a pay service tomorrow if they felt like it.

      Your expectations seem to be ever so slightly unrealistic.
      --
      "I use a Mac because I'm just better than you are."
    3. Re:Value of their feeds? by halosfan · · Score: 1

      I didn't say anywhere I want them to provide their service to me for free. If it makes it easier to understand, assume I'm willing to pay money to subscribe to this service in exchange to the guarantee that it would be available to me for a year. Can I do that? Or all they provide is the free version that they can discontinue at any time for any reason?

      --
      My only problem with Microsoft is the severity of bugs in their software.
    4. Re:Value of their feeds? by Anonymous Coward · · Score: 0

      That's a question best posed to Yahoo! themselves, not on a public message board. I bet you could work out an arrangement with Yahoo! to use their services on a more guaranteed basis for a fee. Why not contact Yahoo! directly?

  11. Re:Is Python created by a religious person? by abigor · · Score: 2, Funny

    You're in luck! Here's a quote from Guido: "Maybe my spiritual beliefs shine through here -- I'm a convinced atheist."

    I don't know anything about Ruby's creator, but Larry Wall has always creeped me out too. I sure was happy when Python came along - a sensible language created by a logical Dutchman.

  12. Re:Here's to progress by Aladrin · · Score: 1

    Did you honestly just compare giving up the name of a journalist to the attempted genocide of Jewish people? You are one brave... Oh, you posted AC. I take that back.

    No, providing a few dev tools does not make past mistakes 'better'. But it does show they can actually care.

    --
    "If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
  13. FIXED by Anonymous Coward · · Score: 0

    Every time I see a story about Yahoo concerning Chinese bloggers, it's exactly what I want to hear. While their competitors are saying "do no evil", Yahoo seems to be handing dissidents over to the authorities without hesitation.

    I don't know if I'm quite there yet, but my hard-to-break habit of challenging the official line might be worth breaking if this kind of blogger-focused attitude from Yahoo continues like it has. It's at least very tempting with the war on terror and current levels of surveillance here in the west.

    --
    Reseed (sic) the astroturf!

    1. Re:FIXED by Chapter80 · · Score: 1
      While their competitors are saying "do no evil", Yahoo seems to be handing dissidents over to the authorities without hesitation.

      Uhh.. Not to nit-pick... ok, yes, to nit-pick (sorry!), I think Yahoo's competitors are saying "Don't be evil" not "Do no evil".

      You're not the only one making this mistake.

    2. Re:FIXED by Anonymous Coward · · Score: 0

      Did you ever try to understand what it means to a company when it gets such requests? Do you honestly think they just up and hand in any information that is requested?

      I think you are in need of a horizon broadening.

  14. Product Placement by RobertB-DC · · Score: 1

    The great and mighty Anonymous wrote:
    Launch...?
    Python....?
    Snakes on a Plane!!!


    Yep, it's another Product Placement deal. Pretty shameless -- all the searches shown in the movie start at yahoo.com, and yahoo.com plugs the movie right down to the programmer level. Pitiful.

    --
    Stressed? Me? Of course not. Stress is what a rubber band feels before it breaks, silly.
  15. Whitespace by Anonymous Coward · · Score: 5, Insightful

    I know everybody gets hung up on the whitespace thing when they look at Python. But you know what? Once you start actually coding in it for any significant amount of time, it's not a big deal. When you first start, I know you expect it to be really annoying, but that simply doesn't turn out to be the case. The supposed problem evaporates.

    Every time you hear anybody moan about Python's significant whitespace, ask them how long they've spent actually writing Python. You'll see the same thing as I do - that virtually everybody complaining has never given Python a chance, and that virtually everybody who has given Python a chance has realised that the significant whitespace isn't a big deal.

    1. Re:Whitespace by Anonymous Coward · · Score: 1, Funny

      That's true. Once you use Python for a significant amount of time, you find that there are far more annoying aspects of the language than significant whitespace.

    2. Re:Whitespace by Anonymous Coward · · Score: 0

      Uh ... reading down so far, no one even brought up the whitespace thing. It really doesn't need pre-emptive defense anymore.

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

      Er, read again. The comment I'm replying to said "Guido! Let my whitespace go!".

    4. Re:Whitespace by Peaker · · Score: 1

      Like what?

    5. Re:Whitespace by bhaberman · · Score: 2, Informative

      No lambdas, no ternary operator (yes I know, not pythonic), no switch statement (think Ruby, not C++), scoping rules are wrong (for example, list comprehensions leak variables - C++ for loops don't!).

      Underscores! __init__ __new__ __getattr__ __setattr__ __len__ __getitem__ . . . .

      range(1,5) = [1, 2, 3, 4]

      The list goes on and on and on and on and on. Python has an incredible number of infuriating misfeatures for such a useful language.

      Python sort of pretends to be a functional language, and you can do a lot of functional-style things in python, but even Perl is much better at doing these things than Python.

      My favorite part of Python is the whitespace rule! The way I see it, you're indenting your program anyways, so braces are just redundant. It makes Python code quite beautiful and virtually eliminates unreadable code. In fact, Python is just a wonderful language to write in in general because its design enforces good programming practices and makes it easy to produce incredibly maintainable programs. But sometimes these features (read limitations, and lots of them) are quite frustrating. Yes, Guido, map and filter suck, but only because Python lambdas suck. And nested list comprehensions look awful. And sometimes you really do want a one-liner.

      My three favorite languages now are Perl, Python, and Haskell. Perl because it is useful, even though it is a terrible language (Perl 6 is awesome though). Python because it is wonderfully easy to code in. Haskell because it is beautiful and makes my head hurt. Incidentally, Haskell also relies on whitespace, which I guess means that meaningful whitespace is officially a Good Thing, as defined by leading computer scientists.

      The interesting thing I think is that Ruby, though much cleaner than Python and much more expressive, is much much harder for me to read. I don't like the mix of pure OO and functional style so much either. It seems like a wonderful language, but once Perl 6 comes out I can't really see it being so relevant.

    6. Re:Whitespace by idlemachine · · Score: 2
      No lambdas? Seriously? So the lambda keyword that my copy of Python 2.5 recognises is..what? A local patch? Or simply evidence that you don't have the slightest clue of what you're talking about?

      No ternary operator? Firstly, this isn't C, and secondly, you'll be happy to know that people who're unwilling to learn new approaches have bitched often and hard enough that it now exists in a pythonic form: http://www.python.org/dev/peps/pep-0308/ You'll find the PEP interesting for at least two reasons (hint: it includes an example that uses a lambda).

      No switch statement? What's wrong with using a dictionary dispatch method instead? It's faster.

      Confused by the performance of range? Try using the goddamn help:

      In [1]: help(range)
      Help on built-in function range in module __builtin__:
      range(...)
      range([start,] stop[, step]) -> list of integers
      Return a list containing an arithmetic progression of integers.
      range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0.
      When step is given, it specifies the increment (or decrement).
      For example, range(4) returns [0, 1, 2, 3]. The end point is omitted!
      These are exactly the valid indices for a list of 4 elements.
      It seems to be behaving exactly the way it's supposed to, assuming you put aside your preconceptions from other languages and actually take the time to understand how it works.

      And you hate the use of double-underscores to indicate an implementation detail, is that correct? I'm guessing that's what your point is, as it appears to be just petty aesthetic sniping.

      Yes, Guido, map and filter suck, but only because Python lambdas suck. And nested list comprehensions look awful. And sometimes you really do want a one-liner.

      I can imagine that allegedly non-existent lambdas would suck. And if you really hate, as you appear to, everything that makes Python pythonic apart from its use of significant whitespace, I just have to ask: why the hell don't you stick to a language that better fits the way you want to code?

      Or better yet, how about sticking to a language you actually seem to know something about? Because puffed up posturing of your multilinguistic abilities aside, you clearly don't know jackshit about Python.

    7. Re:Whitespace by Ian+Bicking · · Score: 1

      No lambdas Well, of course that isn't true. Lambda is syntactically limited in Python. Instead you have to use named functions if you are doing something complicated that can't fit in a lambda. That causes two changes: you have to come up with a name for the function (which I don't think is a substantial burden) and you have to declare the function before you use it (which can be a little annoying in some circumstances). But altogether, the lambda thing is way overused as a criticism; anonymous functions aren't all that important.
      no ternary operator (yes I know, not pythonic) Python 2.5 has it -- RC1 should be out very soon
      no switch statement (think Ruby, not C++) It can be nice sometimes, but I think it's overrated. Personally I usually use if/elif/else, which has some nice properties as the code evolves, but in other circumstances dictionary-based dispatch works well.
      scoping rules are wrong (for example, list comprehensions leak variables - C++ for loops don't!) This is an admitted design mistake. Generator comprehensions (implemented after list comprehensions) do not leak variables, and in Python 3 list comprehensions won't either. I don't think it's a big issue that for loops leak variables -- I think it's actually reasonably intuitive that the value of the loop variable sticks around.
      Underscores! __init__ __new__ __getattr__ __setattr__ __len__ __getitem__ . . . . Yes, these represent magic methods, something that has special significance to the system. Maybe other punctuation would be prettier in some circumstances, but not all. It also leaves all "normal" names to the application author; there aren't any non-magic methods that you have to worry about outside of your domain.
      range(1,5) = [1, 2, 3, 4] I don't know what your problem is here. Do you want it to return [1, 2, 3, 4, 5]? That would be horribly wrong. Python gets its ranges right, no question in my mind -- returning an inclusive range would simply be wrong. The way Python does ranges and slicing means that one-off errors are pretty uncommon. Having other kinds of ranges would mess that up.
      Yes, Guido, map and filter suck, but only because Python lambdas suck. And nested list comprehensions look awful. He's kind of conceded that, but has not seen any reasonable resolution in the scope of Python's existing design and syntax. There's compromises involved in language design, and not everything will look right given any particular syntax. In Python's case function expressions just don't work well. Instead Python offers a couple forms of syntax (list comprehensions most notably) that deal with some particularly common uses of function expressions in a way that does make sense. (And sure nested list comprehensions look awful -- don't use them! Use chained generator comprehensions or something more sane for the reader.) And hey, Python took it from Haskell, so it's gotta be pretty good.

  16. Re:Here's to progress by Anonymous Coward · · Score: 0
    Did you honestly just compare giving up the name of a journalist to the attempted genocide of Jewish people?

    No

    You are one brave... Oh, you posted AC. I take that back.

    In a world where people are imprisioned for expressing themselves, do you expect me to post onto a web forum using my real name?

    No, providing a few dev tools does not make past mistakes 'better'. But it does show they can actually care.

    It does? Does assisting in human rights violations shows that they care.. or not? You pretty much just confirmed my point.

  17. Great, and good packages by masklinn · · Score: 4, Informative

    Not only did they release a nice guide, but the guide is actually good: while the first XML library they talk about in XML parsing is xml.dom.minidom, they also explain how to use the XML API with effbot's ElementTree (and link to both ElementTree and cElementTree), which is more than likely the best Python XML library. And the recommend UFP (Universal Feed Parser) for RSS parsing.

    The worst thing you can say about them is that they did their homework, kudos to the Yahoo guys.

    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
    1. Re:Great, and good packages by ChowyChow · · Score: 1

      Not only that, but they chose to use simplejson which is superior and under a free-er license than the library json-py.

      *applaudes yahoo*

    2. Re:Great, and good packages by mshiltonj · · Score: 1

      Not only did they release a nice guide, but the guide is actually good:

      Not only is your sentence redundant, but your sentence is actually redundant.

    3. Re:Great, and good packages by masklinn · · Score: 1

      No, something can be "nice" (well written or easy to understand) and awfully bad technically (using crappy code, the wrong libs, bad style, ...)

      --
      "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  18. For us lesser mortals (non-developers?) by Anonymous Coward · · Score: 0

    Does this make Yahoo! a friend of Open Source?

    Or would it be premature of me to exclaim ...ahem...Yahoo!?

  19. You're not helping things. by Virak · · Score: 5, Insightful

    If you want people to switch to Scheme, explain why they should and how it would benefit them, don't just say "lol ur language is teh sux, use mine". That's exactly the kind of stupid shit that gives Lisp users a reputation as a bunch of arrogant assholes.

    And yes, Scheme is a great language, and I love it, but it's not the best thing for every situation. If you truly think one language is the best choice for everything, then you're a total idiot.

    Also, no even slightly popular browser supports client side scripting with Scheme, and most web hosts don't offer server-side scripting with it either.

    1. Re:You're not helping things. by computational+super · · Score: 0
      If you truly think one language is the best choice for everything, then you're a total idiot.

      That's right! If you write applications that require fewer than 5 different languages for ongoing maintenance, you're just fitting a square peg into a round hole! You're just one of the "I have a hammer so everything is a nail" people! Your custom JVM written in C should be interpreting java byte codes that have embedded Python scripts that build Javascript output that interpret TCL for maximum flexibility! Bah! One language!

      --
      Proud neuron in the Slashdot hivemind since 2002.
  20. Re:Here's to progress by Anonymous Coward · · Score: 0

    don't feed the trolls :)

  21. Having it both ways by amightywind · · Score: 0
    That's exactly the kind of stupid shit that gives Lisp users a reputation as a bunch of arrogant assholes. And yes, Scheme is a great language, and I love it, but it's not the best thing for every situation. If you truly think one language is the best choice for everything, then you're a total idiot.

    First to insult me as a Lisp bigot, then you try to associate yourself with it. Amusing! You Python bottom feeders shouldn't be so sensitive.

    --
    an ill wind that blows no good
    1. Re:Having it both ways by Anonymous Coward · · Score: 0

      Amusing! You Python bottom feeders shouldn't be so sensitive.

      And you Schemers shouldn't be so delusional.

      Scheme is just screwdriver looking for a nail to drive, in this context.

    2. Re:Having it both ways by Virak · · Score: 1

      And how exactly is this contradictory? I can be a Lisp user without being a stuck up ass who thinks that *their* language is the only one that anyone should ever use for anything.

    3. Re:Having it both ways by Anonymous Coward · · Score: 0

      One drives screws with a screwdriver, not nails.

  22. 2004 by booch · · Score: 2, Funny

    Python is so 2004. Everyone knows that Ruby is the current language du jour. Yahoo needs to catch up.

    --
    Software sucks. Open Source sucks less.
  23. Re:Is Python created by a religious person? by Anonymous Coward · · Score: 0

    The guy is joking, trolling, or an idiot. In any of these cases, his opinion has no bearing on atheism and it certainly does not transform atheism into a religion.

    I suspect he was joking, because honestly, who says things like the GP did?

    (also an atheist).

  24. Re:Is Python created by a religious person? by swartze · · Score: 3, Interesting
    As an atheist, I'd like to stick to a language created by an atheist
    Wow, That's quite a religious conviction you've got there.
    --
    Bleep
  25. Hard to do if you are a GNU user by amightywind · · Score: 4, Funny
    As an atheist, I'd like to stick to a language created by an atheist.

    You are narrowing your options considering who who developed the initial versions of GCC.

    --
    an ill wind that blows no good
  26. Snakes are naturally quiet by suitepotato · · Score: 2, Interesting

    I'm just glad they did this ahead of any Ruby foray. Online, all I hear anymore is loud rowdy Ruby peope and anti-Python people, some of whom are the same. At the bookstore, I easily see two times more Python books than Ruby. This tells me that despite the online hype, there's still a lot of quiet interest in Python and it isn't that Ruby or anything else is pushing us aside, it's that we're not very vociferous.

    Which is fine with me. As long as Yahoo and other outlets keep that in mind that is. Python is not dead no matter what some people want to believe from the SNR.

    --
    If my grammar and spelling are off, I am [distracted/tired/careless] (take your pick)
    1. Re:Snakes are naturally quiet by carlivar · · Score: 1

      Ruby on Rails is only at v1.1. Thus the lack of books. When browsing Amazon however it seems like there are several scheduled to be released this fall.

      --
      Vote Libertarian
    2. Re:Snakes are naturally quiet by abigor · · Score: 2, Informative

      Python is used commercially all over the place. My friend bought Civilization IV, and I was astounded to see it supports game modifications via Python. Meanwhile, I read an interview with the guy behind PyQt, the Python bindings for Trolltech's Qt library, and he said he has over 200 commercial users - including Disney, Pixar, and Industrial Light and Magic. All of these companies use Python and Qt, an extremely powerful app development environment if I've ever seen one. It seems like a natural match.

      So the reason you don't hear Python hype is because the language simply doesn't need it. Ruby hasn't "arrived" yet, so its supporters are more vocal. It's all very similar to desktop Linux.

    3. Re:Snakes are naturally quiet by DeathPenguin · · Score: 1

      No doubt there's still a lot of room for Python, but since you brought up the bookstore metric: http://radar.oreilly.com/archives/2005/12/ruby_boo k_sales_surpass_python.html

    4. Re:Snakes are naturally quiet by Senzei · · Score: 1
      In the interest of being fair, Ruby is the current hype language and hasn't had much in the way of books until recently, of course book sales are going to be way up. I would expect them to die down a bit as the language reaches whatever natural saturation level it is going to hit.

      I also am having a hard time recalling any good OReilly Python books that came out recently. That may have something to do with this as well.

      --
      Slashdot: Where anecdotes and generalizations can be freely substituted for facts, logic, or intelligence
  27. creator of Python works at Google by DrDitto · · Score: 1

    Its sort of ironic that Guido van Rossum, the creator of Python, now works at Yahoo's competitor (Google).

  28. Re:Rogues gallery of languages by Anonymous Coward · · Score: 0

    Ah yes, Lisp. The language where each programmer uses macros to try to reinvent their very own real object system, real language syntax, real containers, and real OS interface library; poorly.

  29. Re:Rogues gallery of languages by Millenniumman · · Score: 1

    Bah, Smalltalk is better than all of those.

    --
    Stupidity is like nuclear power, it can be used for good or evil. And you don't want to get any on you.
  30. Re:Is Python created by a religious person? by Anonymous Coward · · Score: 0

    OK, I'll bite. What about Larry Wall has creeped you out? He might have mentioned his religious beliefs, but I don't think he's been pushy about anything. As a matter of fact, it seems to me the philosophy behind perl seems to be avoiding pushiness even if it means going to questionable extremes. I guess people like you who think everyone should think like you creep me out, thus my putting this in as an anonymous coward.

  31. Re:Is Python created by a religious person? by Anonymous Coward · · Score: 0

    What the...? I didn't know English was created by an atheist. If not, I guess you'll just have to shut up.

    (Disclaimer: this is not aimed at atheists.)

  32. I could live with it by amightywind · · Score: 1

    I can't say I have specialized in it, but I have used it. If you are going to program with side effects (OO) it doesn't get any simpler. I could live with it. How can anyone explain the madness of Python's fashionability over smalltalk?

    --
    an ill wind that blows no good
    1. Re:I could live with it by haystor · · Score: 1

      1. The free version of Python is the standard version. So a new developer will get to use exactly what the best developers are using.

      2. Libraries.

      --
      t
    2. Re:I could live with it by Millenniumman · · Score: 1

      1. There is no "Smalltalk". There are different sets of libraries, e.g. Squeak, F-Script, all based around the syntax and paradigm. 2. Smalltalk never became very popular, partly because at the time the speed boost of a lower level language was more noticeable than it is now. Python is also less fast than lower level languages, but that isn't as important now and Python has gotten a lot of momentum.

      --
      Stupidity is like nuclear power, it can be used for good or evil. And you don't want to get any on you.
    3. Re:I could live with it by jma05 · · Score: 1

      Python reached critical mass, SmallTalk did not. A language is not everything, there is also the tools, libraries, community etc. Python is not best at any one of those. But it is good in every one of those.

      Let's take an example:
      I don't like C++ as a language. But I much rather develop a Win32 database front-end in C++ Builder rather than Python. Why? Because this specific tool was perfected for that specific task with a proper IDE and a great framework. Likewise, there are tasks for which Python is the best from *my* toolbox.

      One reason why Scheme and Lisp did not become popular is their lack of human friendly syntax. Regardless of how you *feel* about it, emperically we know that people do not like to read straight parse trees. While coding in parse trees make certain things possible, people are not looking for those features. I would like to see macros in Python at some point, but that is not on the top of the wish list.

      See this link for more differences between Scheme and Python
      http://web.archive.org/web/20040629200740/http://s unsite.bilkent.edu.tr/pub/languages/pub/doc/python VSscheme.html

  33. Re:Is Python created by a religious person? by abigor · · Score: 1

    Where precisely did I say I think everyone should think like me? I think you have some anger issues to work out. A reading comprehension class might help too, as would a sense of humour.

  34. Re:Here's to progress by Anonymous Coward · · Score: 0

    In a world where people are imprisioned for expressing themselves, do you expect me to post onto a web forum using my real name?

    Wow, get your head out of your ass.
    Like anybody cares about your posts at Slashdot

  35. Excellent news by DrGalaxy · · Score: 1

    This page mainly demonstrates how to take advantage of Yahoo's APIs with Python. I think that the engineers and managers at Yahoo must be paying attention to the competative edge in productivity that Python can offer. It really is an all purpose programming tool that works well in many niches.

  36. Is slashdot created by a religious person? by Anonymous Coward · · Score: 0

    He picks forums the same way.

  37. Re:Rogues gallery of languages by Peaker · · Score: 1

    The language is simpler than the others yet for more expressive and powerful. Learn something. Use it!

    Oh is it?

    Scheme with or without macros?

    Scheme without macros is a laughably weak language compared to Python.
    Scheme with macros can not be said to be simpler than Python.

    More expressive? Show me any good expressive Scheme program that can not be expressed with round-the-same-length Python program, that is also easier on the eyes?

  38. Actually try Python by Peaker · · Score: 1

    Many of us Pythoneers have been there. Exactly where you are, bitching about the "whitespace".
    Only after using it for a little while we understood that we can never go back.
    The way I resisted whitespace in the beginning now seems so stupid..

    There really is no real claim against significant whitespace except the knee-jerk reaction of ".. but .. but .. its just wrong!"

    If you actually try to use Python, you'll never want to go back to cluttering your visual space with unnecessary noise {}.

    There's always the obvious option of using #{ and #} around your indented blocks :-)

    1. Re:Actually try Python by kace · · Score: 1

      Amen. You've got to have whitespace in any program anyway just to make it readable -- why shouldn't it do some work?!

      And, please, I'd rather crawl through a ditch full of broken bottles than suffer through even one more "bracket audit."
      "... four, five, ... uhm, .... One, two, three, ...."

      In a large program, though, I do tend to use comments to identify the end of blocks.

      Python is a great language. People who get hung up on a piddling syntax thing like this are missing the point.

    2. Re:Actually try Python by Nevyn · · Score: 1
      Many of us Pythoneers have been there. Exactly where you are, bitching about the "whitespace". Only after using it for a little while we understood that we can never go back.

      When I first learnt python I assumed the whitespace thing would be no big deal, it's only after using it for a while that I saw how moronic it was.

      There really is no real claim against significant whitespace except the knee-jerk reaction of ".. but .. but .. its just wrong!"
      • 10 year old editor habits don't work anymore, Ie. copy & paste & reindent almost never "just works". This is with an editor (xemacs) that has a lot of python support.
      • it means you have to sprinkle "pass" warts everywhere, because it can't deal with empty blocks
      • writing code inside other languages (like html) is much harder
      • likewise getting code from multiple places is basically impossible (think html + SSI)
      • IT IS harder to read, you've removed the "ends block" visual marker. You can't easily line up the end of a block with the start of a block ... you can argue that all blocks should fit on a screen, but this isn't true in the core python code.
      • You can't create blocks on their own (without doing if True: before it), all other languages allow this that I know of
      • You can't break the indentation rules for a 1 line patch to add an if statement.
      • and the fact that tab is treated as 8 spaces means it can look "right" to any sane human but still be wrong ... have fun debugging that.
      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    3. Re:Actually try Python by Peaker · · Score: 1

      When I first learnt python I assumed the whitespace thing would be no big deal, it's only after using it for a while that I saw how moronic it was.

      No offence, but I believe you are lying here. I mean, I think that a little white lie of "yeah I used it a lot and then I thought so" is much easier on your keyboard and much more probable than you ACTUALLY USING PYTHON and disliking the whitespace. People who actually use Python for REAL work, really tend to become fans of the significant whitespace.

      10 year old editor habits don't work anymore, Ie. copy & paste & reindent almost never "just works". This is with an editor (xemacs) that has a lot of python support.

      Ofcourse copy&paste and reindent work. Just use the emacs python-mode shortcut: C-c,l and C-c,r to move the block left or right to where you want it.
      Sure, "reindent" may be easier, but only because you bothered to create those little empty lines containing just "{" or "}" that push REAL code out of the screen, and let you decide at what nest-level you want the code (before or after the "}"). Deciding via C-c,l and C-c,r is just as easy, and saves a lot of screen-space.

      it means you have to sprinkle "pass" warts everywhere, because it can't deal with empty blocks

      Huh? How many empty blocks do you have? What exactly are you writing?
      How much longer is "pass" than "{}"? (hint, if you measure in keystrokes its even less)

      writing code inside other languages (like html) is much harder

      I don't nest my code in HTML, and I'm not sure why that would be a problem, or why I would want to nest my code in HTML and not the other way around. Hell, I'd want to write higher-level descriptions of content and let the HTML be auto-generated, but that's another discussion altogether.

      likewise getting code from multiple places is basically impossible (think html + SSI)
      I'm not following you in this one.

      IT IS harder to read, you've removed the "ends block" visual marker. You can't easily line up the end of a block with the start of a block ... you can argue that all blocks should fit on a screen, but this isn't true in the core python code.

      This is simply untrue, and a silly claim.
      NOBODY, and I mean NOBODY reads the {} when they read C/C++/Java code. Everybody reads the indentation, and only the indentation. The ONLY one who reads {} is the compiler.
      Blocks larger than the screen are unreadable with or without {}. Why do you think the closer } makes anything easier to read if the opener is out of the screen?
      In fact, having no {} lines makes more things fit the screen, so if anything, blocks larger than the screen are easier with indentation-based languages.
      What do you make of the following C code:

      if(5 == x)
      a = 1;
      evil_stuff_here();

      How about:

      for(x=0; x<100; ++x);
      {
      printf("%d\n", x);
      }

      Python makes these kinds of somewhat-subtle mistakes impossible, by uniting the human-readable mark of nesting (indentation) with the compiler one, instead of having two, possibly incompatible marks.

      You can't create blocks on their own (without doing if True: before it), all other languages allow this that I know of
      Hmm, if it gets its own block, what's wrong with putting it in a function?
      I am not sure what you want here, exactly.

      You can't break the indentation rules for a 1 line patch to add an if statement.
      And that's a good thing.
      Special cases aren't special enough to break the rules.
      The trade-off between the fraction of a second indentation takes, and the potential for bugs due to mismatches of the visual indentation and the meaning of the code is clear.
      You really should be forced, for the good of the readers of that code (which are far more important than the writer, as reading code is much harder than writing it) to indent it properly.

    4. Re:Actually try Python by Nevyn · · Score: 1

      No offence, but I believe you are lying here

      None taken, python fan boys wishing reality were different is well documented.

      People who actually use Python for REAL work, really tend to become fans of the significant whitespace.

      See, you did it again.

      Ofcourse copy&paste and reindent work. Just use the emacs python-mode shortcut

      You mis-spelt "of course they don't work, you have to use this totally different editor feature", there you go wishing reality away again. I can see how you must get used to it after a while and forget you're doing it.

      Huh? How many empty blocks do you have? What exactly are you writing? How much longer is "pass" than "{}"? (hint, if you measure in keystrokes its even less)

      if (0) {}
      else if (x)
      {
      }
      else if (y)
      {
      }

      That's the most obvious use. It's also not so much about the keystrokes, as the meaning ... {} is an empty block, pass is a workaround because blocks can't be empty ... mentally everytime I do it instead of thinking I don't need to put anything in that block ... I have to actively think "I need to put pass there, because there isn't an invisible block".

      I don't nest my code in HTML, and I'm not sure why that would be a problem

      It's a problem because whitespace is significant, and I'm not surprised you don't do it with python ... because it sucks ... due to the whitespace being significant thing. Sometimes this is very nice to do when you have much more html than code, and it works fine with every other language. Think about putting code in xml processing instructions, for example.

      The SSI bit is basically an extension to this, you build a large xml/html document from many smaller ones (that, again, have code in them) this causes even bigger problems with python, because seperate blocks can magically merge together.

      IT IS harder to read, you've removed the "ends block" visual marker. You can't easily line up the end of a block with the start of a block ... you can argue that all blocks should fit on a screen, but this isn't true in the core python code.

      This is simply untrue, and a silly claim. NOBODY, and I mean NOBODY reads the {} when they read C/C++/Java code. Everybody reads the indentation, and only the indentation. The ONLY one who reads {} is the compiler.

      Yes, welcome to python party line reality again. People don't "read" the syntax, but they _sure as hell_ parse it and use it as visual indicators -- which sane people regard as "reading" the source. Yes, it's possible to come up with corner cases where the visual clues (including the indentation) lie to the reader ... but that _almost never happens in real life_ (and reindenting, note not running a special C only command, finds those problems 99.999% of times). Well done, python fixed a non-problem and "only" caused constant pain and misery in return.

      Blocks larger than the screen are unreadable

      I responded to this in my original post ... core python code does not follow this rule, it's so obviously removed from reality I'm finding it hard to respond at all.

      And that's a good thing (to not be able to break the indentation).

      No, it's a limitation. Obviously you don't want to do it all the time, but being able to do it sometimes (for quick, short term, changes) is useful. It's like a knife that doesn't cut human skin ... sure most of the time that's nice and useful (I'd happily enable indentation _warnings_ in GCC for example), but it _really sucks_ if you ever want to cut yo

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    5. Re:Actually try Python by Peaker · · Score: 1

      None taken, python fan boys wishing reality were different is well documented.
      See, you did it again.


      I can take your becoming offensive as strong evidence that you indeed lied there. :-)
      Ofcourse my belief that was a lie is simply based on experience arguing with several real-life developers who lie that they used Python because they know that otherwise their whitespace knee-jerk reaction is silly and they are portrayed as dumb.

      You mis-spelt "of course they don't work, you have to use this totally different editor feature", there you go wishing reality away again. I can see how you must get used to it after a while and forget you're doing it.
      Wow. Use a totally different editor feature
      So you mean that if I want to learn Python.. there are two extra key shortcuts I have to remember in my editor?
      It is really so efficient of C and C++ to share the "indent this code" key because that way I really don't have to specifically remember that extra one key.
      You realize how ridiculous it is to claim that requiring an editor feature for efficient copy and paste makes a language unusable?
      You are using copy&paste, and indent-this-code and other features which are already specialized for each specific language.

      if (0) {}
      else if (x)
      {
      }
      else if (y)
      {
      }


      What's wrong with the straight-forward if ((!0) && (x)) ? It makes it quite a lot more clear what you're trying to test.

      That's the most obvious use.
      I don't think I've ever seen use of "if(..) {} else .." blocks except in macros that don't want their lexical parser to steal an "else" from after the macro (when it includes an "if").

      It's also not so much about the keystrokes, as the meaning ... {} is an empty block, pass is a workaround because blocks can't be empty ... mentally everytime I do it instead of thinking I don't need to put anything in that block ... I have to actively think "I need to put pass there, because there isn't an invisible block".

      "pass" is syntax for empty-block. The two are equivalent and if you indeed used Python and required a lot of it, then "empty" and "pass" would become synonomous in your brain. They haven't, which is further evidence that you did not really use Python a lot.
      Also, the only cases where I really find myself using "pass" is to define little exception classes, or when I create a lot of singletons via subclassing. In those cases, it looks like:

      class MyException(Exception): pass

      in which the pass has little to no overhead.

      It's a problem because whitespace is significant, and I'm not surprised you don't do it with python ... because it sucks ... due to the whitespace being significant thing. Sometimes this is very nice to do when you have much more html than code, and it works fine with every other language. Think about putting code in xml processing instructions, for example.
      Actually I don't do it in Python because I don't do it in any language.
      I am not a web developer, and have not much experience in that area. Perhaps a more experienced web Python developer could respond better about Python and HTML mixing.

      The SSI bit is basically an extension to this, you build a large xml/html document from many smaller ones (that, again, have code in them) this causes even bigger problems with python, because seperate blocks can magically merge together.
      Again, web programming is not my thing.

      Yes, welcome to python party line reality again. People don't "read" the syntax, but they _sure as hell_ parse it and use it as visual indicators -- which sane people regard as "reading" the source.

      No, people don't read the syntax, they read the indentation. Sometimes they check the {} too for consistency with the indentation, but they are not the source of information. Ask a lot of C developers what

    6. Re:Actually try Python by Nevyn · · Score: 1
      I can take your becoming offensive as strong evidence that you indeed lied there. :-)

      You called me a liar, without knowing anything about me ... and presumably without even looking at my website. I'm pretty bored arguing with you, as you're just giving the party line of "Oh, that opinion's not really a problem ... you just think it is, but you're wrong" combined with offensivly suggesting I'm just stupid for not realizing this on my own. So allow me to just say: Your opinion is wrong, you ignorant python fan boy.

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    7. Re:Actually try Python by Peaker · · Score: 1

      Almost everybody lies.

      By that definition, almost everyone is a liar.

      So don't be too hard on yourself. You only lied a little white lie about using a lot of Python.

      Its really no big deal.

  39. Matz said to be LDS by iggymanz · · Score: 1

    supposedly Matz is a real rarity, a Japanese mormon. Not that surprising, since Japan is all about weird fusions

  40. Misconceptions about scheme by amightywind · · Score: 1
    The language where each programmer uses macros to try to reinvent their very own real object system,

    Some do. I use yasos which is part of slib. You must be a C++ person who doesn't like macros because one of the priests of strong typing told you not to. A pity. Macros are an irreplacable feature being forgotten now in dumbed down languages. Read Paul Graham's On Lisp someday and get clued in.

    real language syntax,

    ???

    real containers,

    Scheme supports Lists, vectors, and alists and iteration natively. Libstdc++ has spent the last 10 years trying to catch up, and doing so poorly. Python doesn't even have these. You don't know what you are talking about.

    and real OS interface library

    What slackjawed Python programmer doesn't spend every waking hour "wrapping" existing C API's. My Gentoo system is rotten with them. It saddens me that there is not a full scheme system yet. In the meantime scheme shell is pleasant way to interact with a GNU/Linux system.

    --
    an ill wind that blows no good
    1. Re:Misconceptions about scheme by Anonymous Coward · · Score: 1
      You must be a C++ person
      I am very experienced in C++, and it totally sucks. Yet you go ahead and make the assumption that I would advocate usage of such an RSI-inducing language. I was also using Lisp decades ago when you were probably still in grade school, and I am very familiar a couple of dozen other languages. Sorry to break your bubble, but Scheme isn't the panacea that you make it out to be. It's a good language for writing compilers or implementing other languages, but beyond that niche it's not so hot.
      Read Paul Graham's On Lisp someday and get clued in.
      I have implemented a version of scheme, including macros. So you can whip up extremely powerful constructs that are non-standard and incompatible with other people's powerful constructs. Sounds great on paper, but in the real world, you don't really get anywhere with it. 50 years after Lisp was invented, it's still on the fringes, and that's one reason why: no standardized powerful constructs. Just a Balkanized world of hundreds of little clever individual setups.
      ???
      Yes, that about sums up your comprehension of the fact that syntax is important. And Lisp has almost no syntax. It's all semantics. That's great for a computer to read, but most peoples' brains don't work that way (except for a few ivory tower eggheads, the same tiny group that's been harping on how great Lisp's lack of syntax is for the past 50 years). So what if your programs can operate on programs? Self-modifying code is almost always too clever for its own good, and as I pointed out, the work of macros is better done by putting real features into the language in the first place.
      Scheme supports Lists, vectors, and alists and iteration natively. Python doesn't even have these.
      Vectors: yes it does. S-Lists: not needed because vectors are more efficient and versatile anyway. Alists: hashes are more versatile and efficient. Iteration: sure. And for all of these things: Python (as well as most every other language on the planet) uses much more concise and easy-to-read forms for containers than Lisp. Bottom line: you don't have any clue what you're talking about.
      What slackjawed Python programmer doesn't spend every waking hour "wrapping" existing C API's.
      The Python libraries are absolutely vast compared to Scheme's sad excuse for standard libraries.

      If there's anything worse than a single-language bigot, it's a single language bigot who has no grip on reality.

    2. Re:Misconceptions about scheme by amightywind · · Score: 1
      I was also using Lisp decades ago when you were probably still in grade school, and I am very familiar a couple of dozen other languages.

      To display such ignorance after these long decades doesn't speak well of you.

      Sounds great on paper, but in the real world, you don't really get anywhere with it. 50 years after Lisp was invented, it's still on the fringes, and that's one reason why: no standardized powerful constructs.

      This is an argument? Any language goes through this period of balkanization. How many times have you written your own a linked list code in C? The organisation you tout that Python enjoys results from it ridding the coattails of C. I like C just fine. C++ less. But it is sad that such flint tools are still in vogue.

      uses much more concise and easy-to-read forms for containers than Lisp

      Yes, constructs like this:

      (for-each process '(a b c))

      are indeed complex and intimidating.

      --
      an ill wind that blows no good
  41. Rogues gallery of arguments by Anonymous Coward · · Score: 0

    "More expressive? Show me any good expressive Scheme program that can not be expressed with round-the-same-length Python program, that is also easier on the eyes?"

    Funny how you wrote those specs. Someone could meet all the rest, and you could pull a subjective "but it hurts my eyes!". Fortunately the real world is more practical than that.

    1. Re:Rogues gallery of arguments by bhaberman · · Score: 1

      Hurting the eyes is an infinitely practical metric. The parentheses in Scheme make it truly painful to read and write, at least for me. Python is very easy to read and write. I use both Scheme and Python, and while I have never had trouble with Python indentation I always mess up the parentheses in Scheme, and I continually have to start counting to figure out where things begin and end. If you want a good functional language that's easy on the eyes, use Haskell.

    2. Re:Rogues gallery of arguments by Peaker · · Score: 1

      No no, what I meant was: Show me a Scheme program that takes less code than Python OR that the Python code is not more readable. That's EASIER to show than showing BOTH of the conditions.

      Can you do it? Saying "Scheme is more expressive" requires some backing up.

      And there was still no reply about Scheme with or without macros.

  42. You're not confusing things. by Anonymous Coward · · Score: 0

    "Also, no even slightly popular browser supports client side scripting with Scheme, and most web hosts don't offer server-side scripting with it either."

    JsScheme

    Scheme hosting...sort of

  43. Commercial use of Yahoo Developer components.. by Anonymous Coward · · Score: 0

    What is the point if these components cannot be re-used for building commercial applications.
    Would'nt be yahoo better off to have their components used by true application developers. Its rather
    unfortunate that they are entirely missing out on an opportunity to hookup developers use these
    for real, make the components stronger. And have thousands of apps having the look and feel of Yahoo.
    Iam sure they can easily have small hooks into their revenue generating services.
    http://developer.yahoo.com/usagePolicy/#uses

  44. Re:Is Python created by a religious person? by bhaberman · · Score: 1

    I don't know, maybe the fact that for Perl 6 he released a bunch of Apocalypses. Apparently these are "revelations" and not "the end of the world." I suppose Larry Wall is God. Or His Prophet.

    On the other hand, perhaps Larry IS God . . .

  45. Re:Is Python created by a religious person? by cerberusss · · Score: 1
    As an atheist, I'd like to stick to a language created by an atheist.
    Then Faith Based Programming must not be for you. Quote:
    When I begin to code, I stop trying to follow the rules and logic of my own experience over the years. Instead I allow the divine spirit take my hand and control the code that is written.
    --
    8 of 13 people found this answer helpful. Did you?
  46. Re:Is Python created by a religious person? by Anonymous Coward · · Score: 1, Insightful

    What does religion have to do with programming languages? As a _true_ atheist you should care about this particular point.
    I'm an atheist too, and the point is to keep our minds open and willing to accept and change our thoughts.
    You cannot ignore other people just because of their religion, that is not what an atheist stands for, we are against those lines of thinking.

    Would you not take your medication if you found it it was invented by a religious person?

  47. Re:Is Python created by a religious person? by sunweight · · Score: 1
    Every morning, before starting, I speak the Programmer's Prayer: "Lord: I begin today on your Great Work. Guide my hand, and bring forth the Code your Will desires. Give me your Strength to keep my Faith, and your Sensory Deprivation to ignore temptation right before my eyes. Goto Lord.

    So God writes in Forth, not Lisp, as many supposed.

  48. Minor question by Peaker · · Score: 1

    In a large program, though, I do tend to use comments to identify the end of blocks.

    To me, this implies that in a large program, you have very large blocks.

    Why don't you just divide them up into very small functions so that each function is trivial and very easy to verify for correctness, and incidentally very easy to follow the indentation of?

    1. Re:Minor question by kace · · Score: 1
      To me, this implies that in a large program, you have very large blocks.
      Why don't you just divide them up into very small functions ...?

      You're right in that the issue that I'm addressing is really large blocks, particularly when there are nested blocks of any size as well. My tendency is to use functions for code that will be repeated at some point. My concern with your suggestion is that arbitrarily dividing up a block of related code into functions would just cause other readability problems (having, maybe, to go back and forth between functions).

      But, it's a fair suggestion. In many cases, it starts off as a simple program that grows over time and could be cleaned up considerably with a judicious use of functions.

      Now that we've established that I'm a hack (thanks), I still maintain that you can't have too many comments. I would recommend commenting the end of any block, including a function block, that might often have the top of the block not on the same screen, just to make quick navigation easier.
  49. Division into functions by Peaker · · Score: 1

    My tendency is to use functions for code that will be repeated at some point.

    I strongly disagree with this method. I agree with the whole functions' section in the Linux kernel coding style.

    I think that you should divide functions such that each function is trivial and more importantly trivially verifiable. With good naming conventions and division of responsibilities, you don't need to "jump between functions" as you only read the functions for implementation details. The interface and what they do should be fairly obvious.

    A large function will most likely host bugs, while a tiny function that does exactly one thing (no more, and no less) will most likely be bug-free.

    Division into functions is not a simple matter though, there are many criterions for the division of functions (wrappers, chronological, implementation hiding, indirection, code repeatability, etc).

    I still maintain that you can't have too many comments. I would recommend commenting the end of any block, including a function block, that might often have the top of the block not on the same screen, just to make quick navigation easier.

    I disagree here too. The best documentation is self-documenting code, and bad documentation is worse than no documentation.
    The problem with redundant comments (such as "if X: end block" and such) is not just the time they take to write and the visual noise they add, but most importantly, it is that these comments are almost never up-to-date. Nobody bothers to update such redundant comments, and they become bad documentation.

    If you can replace a comment with a descriptive variable assignment, e.g instead of:

    # We blit the image into the center position:
    image.blit((WIDTH/2, HEIGHT/2))

    Use:
    center_position = (WIDTH/2, HEIGHT/2)
    image.blit(center_position)

    The variable assignment will remain correct and kept up-to-date. The comment is likely to grow out of sync with the code, and even if it doesn't - the reader is not sure whether to trust the comments. Remember that the code is the most accurate documentation.

  50. Re:Rogues gallery of languages by Anonymous Coward · · Score: 0

    It's funny, because JavaScript has everything you would want from Scheme except macros and continuations, and I don't think most script kiddies will be (or should be) using those features...

    (Well, okay, JavaScript isn't properly tail-recursive either. But what does it matter if you use map or foreach?)

  51. Re:Is Python created by a religious person? by Lord+Kano · · Score: 1

    Atheism IS a religion.

    A religion is a belief system.

    LK

    --
    "Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano