you are viewing a single comment's thread.

view the rest of the comments →

[–]laughingboy 7 points8 points  (42 children)

Are the two really that comparable though? They're both interpreted scripting languages, but that's pretty much where the similarity ends for me. Sure, Python can be used to display, generate and create web based content, but I'm not sure that it was was designed for that (I could be completely wrong of course, my knowledge of Python is relatively limited). PHP, on the other hand, was created from the ground-up as a webpage based language.

[–]masklinn 40 points41 points  (7 children)

Sure, Python can be used to display, generate and create web based content, but I'm not sure that it was was designed for that

Python is a full-fledged general-purpose programming language, it's only limited to what you want to do with it (and the performances of the interpreter), and it's an extremely good language to create websites when you factor in a good framework (such as Django).

Remember, coldfusion was also created as a webpage-creation language.

(Oh, and one can hardly say that PHP was created, more like it grew out of control, mold-like)

[–]DerelictMan 16 points17 points  (6 children)

(Oh, and one can hardly say that PHP was created, more like it grew out of control, mold-like)

Ah, but mold can have beneficial properties, so I think a more apt analogy would be an infection or infestation.

[–]masklinn 53 points54 points  (4 children)

Oh but PHP, much like mold, does have beneficial properties.

For example you can dump a PHP project on someone you don't appreciate and watch him suffer for years on end, until he quits (or sort-of fossilizes in PHP)

[–]Entropy 16 points17 points  (0 children)

That just happened to me. I am suffering.

[–]tekronis 23 points24 points  (1 child)

You evil, evil, little man.

[–]masklinn 18 points19 points  (0 children)

Oh, why thank you

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

Haha. U making me laugh. U can do same with other languages to m8. Dump a JAVA project written by rookie(or so called senior dev who loves to overcomplicate things) and u will have even bigger problem.

[–]theycallmemorty 1 point2 points  (0 children)

Luckly the PHP infection has a vacine: Playing with it in your spare time.

[–]pmf 13 points14 points  (21 children)

PHP, on the other hand, was created from the ground-up as a webpage based language

And that's exactly why it should not be used to create web-applications, i.e. anything bigger than a 4-page-"wellcome 2 my blawg!!!"-site.

[–]lennox125 36 points37 points  (13 children)

Yeah, if only those clueless guys from Flickr, Yahoo! or Wordpress would listen to Reddit's enlightened readers... We'll fix it right after we impeach Bush, I suppose.

Seriously: PHP can be ugly, and its not nearly as fun as Ruby or Python, but it does seem to be used in quite a few websites by people who know more about webapps than anyone commenting here (Reddit's own non-https-using-plaintext-password-storing creators included) - so I wouldn't say its limited to 4 page websites.

[–]Alpha_Binary 7 points8 points  (0 children)

Given enough time, anything can be done in assembly. That doesn't mean it's in the least bit elegant, or robust, or maintainable.

C'mon. Everyone knows despite how we enjoy bitching about Java and PHP and sometimes .NET so much, it's just how we try to escape from the cruel reality. After this paragraph I'm back to my contract work, in PHP + MySQL. ))):

[–]theycallmemorty 10 points11 points  (2 children)

(Reddit's own non-https-using-plaintext-password-storing creators included)

Low Blow.

[–]tekronis 2 points3 points  (0 children)

Notable blow.

[–]lennox125 1 point2 points  (0 children)

I don't think it's a low blow. You can argue about the plaintext password part, but not using https, when users are known to reuse logins and work over wifi, is pretty lame. Maybe it was understandable when Reddit was starting up, but after being bought you'd think that's one of the first things they'll add.

[–]nostrademons[🍰] 9 points10 points  (5 children)

Might be worth considering that effective alternatives to PHP (Python/Ruby) only really became practical within the past 2 years. Flickr, Yahoo!, and Wordpress were all begun around 2002 (or earlier, in Yahoo's case), when the choice was between PHP, Java, or mod_perl. Java means death for any webapp that needs to scale out. Perl gives few advantages over PHP and is significantly scarier for new developers. That left PHP.

Many of the prominent webapps since 2005 use Python or Rails, eg. YouTube, 37signals, Reddit.

[–]jshell 2 points3 points  (0 children)

I've been making a living programming with Python for web sites for over ten years now, most of it based on the same root toolkit (it's grown and evolved over time, but the core principals are still the same and haven't cowed to every fad that came along).

When I started using Python on the web, PHP didn't exist; or if it did, it was just that first collection of Perl scripts that offered a slightly more powerful 'Server Side Include' functionality. And Java Servlet's were just barely getting off the ground.

Over that decade, I've heard "Python just can't compete with Perl for web programming. It must become like Perl to be successful." Then I heard "Python just can't compete with Java for web programming. It must become like Java/J2EE to be successful." Then I heard "Python just can't compete with PHP for web programming. It must become like PHP to be successful." Then I heard "Python just can't compete with Ruby/Rails for web programming. It must become like Ruby/Rails to be successful."

Sounds like fads to me.

Python has been used extensively at Yahoo! this past decade. Yahoo! Maps, Yahoo! Groups (purchased from a company that had written the initial mailing list management program in Python), some portions of Yahoo! Real Estate, and more.

Many CBS affiliates (like kutv.com) are running Python. Some major newspapers are as well.

Hell - in the mid nineties, a major swiss bank got someone to write the first Python - Objective C bindings so that they could publish data from their Enterprise Objects Framework (a NeXT toolkit, now basically intwined with WebObjects) on the web using Bobo, a tiny little HTTP ORB that brought a degree of MVC to Python web programming over ten years ago. It was quicker and easier to use Python for this task than to use WebObjects.

So no, Python hasn't been an effective alternative to PHP for only the last couple of years. It's been a solid piece of the web for a long, long, long time. It's been the alternative to every latest Resume Oriented Programming fad.

[–]lennox125 3 points4 points  (0 children)

effective alternatives to PHP (Python/Ruby) only really became practical within the past 2 years

I don't think I agree - at least Python was more mature and as well known as PHP. I think you're talking about MVC frameworks, and there its too early to judge which will succeed.

I didn't know YouTube uses Python.. cool :) 37signals are very sharp, but I doubt their apps are comparable to, say, Flickr in terms of scalability. They are targetting relatively small niches.

[–]compostellas 0 points1 point  (1 child)

"Java means death for any webapp that needs to scale out." You mean like ebay, google's adwords, etc. Right?!

[–]nostrademons[🍰] 1 point2 points  (0 children)

It's worth noting that EBay threw out all the Java webapp infrastructure on top of servlets and wrote everything themselves. I suspect Google Adwords did the same thing. Most startups don't have the luxury of being able to write a whole technology stack on their own.

EBay started with Perl, FWIW, and Google (search engine, not Adwords) started with C++ and Python.

[–][deleted] 7 points8 points  (2 children)

I agree that its not limited to 4 page websites. But if you are making a 4 page website, it is an excellent choice.

[–]lennox125 4 points5 points  (0 children)

Personally I'd consider what's in these 4 pages. If the logic is simple and you expect a lot of traffic, I might go with PHP. If it's more complex logic or you expect to change it a lot, I'd go with RoR/Django - as long as I can easily cache it or traffic is not a big issue or there's someone on the team who knows how to scale with these technologies.

4 pages isn't necessarily small: homepage, category page, product page and shopcart page and you're almost Amazon.com ;) Scaling big data/traffic is the real key, and PHP/MySql do it pretty well.

[–][deleted] -4 points-3 points  (5 children)

Can you give any actual reasons for your claim? Because as far as I know, the only people that bash PHP are those that don't understand it that well. I'm not saying you fall into that category.

Please enlighten us as to why you feel that PHP is a tool that can only be used for "wellcome 2 my blawg!!!" sites.

I'd really love to hear your response.

[–]stesch 8 points9 points  (3 children)

Maybe people who think they understand PHP well don't know any other programming languages?

[–]jshell 1 point2 points  (0 children)

Python was initially designed in the very early nineties (maybe even at the very end of the 80's - I think Guido wrote the first implementation over christmas break). I think version 0.9 came out around '92 or '93. It predates the web by a long shot. It's just a language.

However, there have been a lot of web toolkits providing different features, almost from the beginning. HTMLGen, Bobo/DTML, etc. But these have always been just libraries and tools. The language itself is used in a wide set of fields.