4 ms·
EDIT: Python is my favorite language. But I wish a LOT more very lazy people or people who can't apply algorithms to solve their own problems (and hopefully in
by its_so_on 14y ago
EDIT: Python is my favorite language. But I wish a LOT more very lazy people or people who can't apply algorithms to solve their own problems (and hopefully in all the same domains that I work in) used it, discussed and asked questions, etc.
It is in this vein that I write...
"Python is popular enough to have a critical mass of users" - on this point unfortunately I have to disagree.
Often the way I write a script is to put in a little extra effort up-front: I do three or four Google searches with the hard part of the task + Python, Perl, PHP, etc -- just to see if someone has already done this for me. I must say that if it's something hard and remotely web-related, the Python part is usually not even worth trying. Either I can do it off of the top of my head, or some fool is asking how to do this thing they can do in PHP in Python and, well, not really getting an answer. (It's not that it's wrong to code things up the long way, it's just that, like I said, it's not even worth doing the Google search).
In this sense there is not a 'critical mass' of users. Let me give you a simple example. Say you want to do fancy appointment-matching like people saying "next friday"...you want to try to pick up on that and offer to set an appointment. So, Google "appointment regular expression next friday php" "apppointment regular expression next friday python" "appointment regular expression next friday perl". You can go ahead and do it, I don't even have to check. If you don't find anything, play around for less than 15 seconds with alternate search terms (more general, more specific, or just different.)
I did the above search just now, and in my case I went off on this tangent and within a couple of minutes had an answer that was satisfactory for me.
I would say, well, there are simply lots of fast scripts that you KNOW can take you 2-3 days of head-scratching to get right OR that the community already has bumped their heads against. Which do you do? If you're NASA, of course you go through scratching your head and getting the RIGHT answer. If you're trying to get a demo out the door, then you go for the low-hanging fruit, with as much leaning on the community as possible. Of course, if its creation, trajectory calculations, whatever, involve a scripting language in any way, would I want a rocket to use Python over PHP. But if I need a script that creates a GIF file of a rocket blasting off off-screen, based on a static image of the rocket that I have? (Forget whether the gif is the correct solution, I just want to see what it looks like, maybe as part of investigating lots of possible ways to do this). Well, then I would do a couple of minutes of Googling first... (As above, though I didn't try this one). Usually, I'm sorry to say, Python doesn't win.
If this get smore downvotes I'll try the Python search on creating a gif file programmatically.
- scott_s 14y agoI am having difficulty figuring out your point. Is it that, when you Google for examples for how to do something in Python, you usually don't find satisfactory results? But that other languages (Perl, PHP) do provide such results? If that's the case, then what particular task you're asking about is going to impact how successful you are. People write much more than just "web-related" things in Python. And, personally, I don't consider that to be important for what I consider a critical mass of users. Rather, what I think is important is that there is enough of a community to provide good online documentation, plenty of technical books, maturity of the toolchain, and integration in most systems.
- its_so_on 14y agoI'm sorry my point was unclear. Often I place speed (i.e. time-until-I'm-not-doing-this-anymore) at an incredible premium to the point where I don't care what the language is! For example, say that you want to attach a process to monitor a logfile of your web-server(apache, say) and SEND YOU AN EMAIL when a string enters that logfile. Hopefully, you should be able to complete this task in every single programming language that appears on your resum, including javascript if you have put it there. In practice, if you are a one-man show trying to get a whole startup off the ground (including all of the biz dev, all of the back-end, all of the front-end, all of the customer e-mails, EVERY SINGLE THING YOUR COMPANY IS DOING) then you don't have the luxury to scratch every itch. There are itches that you can scratch if someone has done it and you can find this out in 15-20 seconds, otherwise, you just don't have the time. In this sense PHP wins where Python has not yet won.
- scott_s 14y agoI understand what you're saying, but I still don't feel that its relevant. Your example is the sort of thing that I would expect myself and other developers to be able to produce a more reliable solution on their own than what they could copy-and-paste from the web. In other words, I wouldn't do it myself because I felt like I "had to scratch that itch." I would do it myself because otherwise I would have no trust that it would work.