python vs php

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

python vs php

Petr Bena
Lot of people hate these discussions I <3 them.

Can someone tell me some pros and cons of using python over php? I
recently heard from several people that python is even better than php
for website developement so I am wondering if that is actually true.

Someone has experience with that?

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

Jeroen De Dauw-2
Hey,

Python has its nice things, and is generally considered more hip then php.
So are languages such as Ruby. Its true there are some stupid things in
php, such as inconsistencies in the base library, and the dozen lines
needed to do a map and a filter (vs one in python) in a readable way. If
one looks at the bigger picture, those are not deal breakers though.
Creating well crafted code is definitely possible in PHP. Unfortunately PHP
is one of those languages (as is JavaScript) where most participators do
not really know what they are doing. Copying some JS around and kicking it
into the shape you like, or writing a plugin for wordpress do not qualify
one as a good developer. So I think people that have the "You cannot do
nice things in PHP as the language is broken, in Python its so much nicer"
attitude are rather short sighted (or just trolling). (And I'm not implying
OP has this attitude.) Those who create messes in PHP are going to do the
same thing in Python.

To answer the question if python is better then PHP for website dev: it
depends on the situation. Do you have a legacy system in PHP and a team of
people familiar with PHP, then go with PHP. If you have never done Python,
and want to start a toy project, go play with Python.

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

George William Herbert
In reply to this post by Petr Bena

This is not exactly the best venue, as MediaWiki is somewhat firmly committed by now, but Python is more firmly committed to good OOP principles and cleaner as a result if you code pretty consistently in that mode.

There seem to be less complete Python web frameworks / toolkits in comparison, however.

You can write websites in anything from assembly to bash scripts to PHP to Python to C to C++ to Ruby to whitespace.

The question is, what are you doing, what do you want to use that already exists, and what do you want to write from scratch...


George William Herbert
Sent from my iPhone

On Jul 27, 2013, at 11:29 AM, Petr Bena <[hidden email]> wrote:

> Lot of people hate these discussions I <3 them.
>
> Can someone tell me some pros and cons of using python over php? I
> recently heard from several people that python is even better than php
> for website developement so I am wondering if that is actually true.
>
> Someone has experience with that?
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

Yuvi Panda
Can we all just agree that haskell, clojurescript and INTERCAL are the
best ever, and  move on?


--
Yuvi Panda T
http://yuvi.in/blog

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

George William Herbert
You forgot Erlang, for those programming flow management... 8-)

But yes, this is an open ended rathole...

Not good for this list, probably.


George William Herbert
Sent from my iPhone

On Jul 27, 2013, at 11:55 AM, Yuvi Panda <[hidden email]> wrote:

> Can we all just agree that haskell, clojurescript and INTERCAL are the
> best ever, and  move on?
>
>
> --
> Yuvi Panda T
> http://yuvi.in/blog

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

Tyler Romeo
Is there a specific context for this question? Are you considering PHP v.
Python for some MW tool? If so I would include that context, because it
makes answering the question much easier.

As for answering the question of Python v. PHP, I like to look at languages
more from the feature comparison than from the library comparison. In other
words, sure it's nice that PHP has array_ukey_uassoc (or whatever it's
called), but you could just implement that natively if you really wanted to.

From the feature perspective, as already mentioned, Python has a much
better OOP implementation than PHP. It supports operator overloading,
multiple inheritance, and metaclass programming. These are all extremely
useful in designing objects that behave like actual types. On the other
hand, Python doesn't support member protection (private/protected
properties), pure virtual functions (aka, abstract functions).

Aside from that, Python also supports named function parameters (as well as
named variadic function parameters) and decorators. Combining all of the
above, I've found Python to be a significantly more useful language for
creating applications that are sanely designed.

*-- *
*Tyler Romeo*
Stevens Institute of Technology, Class of 2016
Major in Computer Science
www.whizkidztech.com | [hidden email]


On Sat, Jul 27, 2013 at 3:20 PM, George Herbert <[hidden email]>wrote:

> You forgot Erlang, for those programming flow management... 8-)
>
> But yes, this is an open ended rathole...
>
> Not good for this list, probably.
>
>
> George William Herbert
> Sent from my iPhone
>
> On Jul 27, 2013, at 11:55 AM, Yuvi Panda <[hidden email]> wrote:
>
> > Can we all just agree that haskell, clojurescript and INTERCAL are the
> > best ever, and  move on?
> >
> >
> > --
> > Yuvi Panda T
> > http://yuvi.in/blog
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

Chad
In reply to this post by Jeroen De Dauw-2
On Sat, Jul 27, 2013 at 11:48 AM, Jeroen De Dauw <[hidden email]>wrote:

> Hey,
>
> Python has its nice things, and is generally considered more hip then php.
> So are languages such as Ruby. Its true there are some stupid things in
> php, such as inconsistencies in the base library, and the dozen lines
> needed to do a map and a filter (vs one in python) in a readable way. If
> one looks at the bigger picture, those are not deal breakers though.
> Creating well crafted code is definitely possible in PHP. Unfortunately PHP
> is one of those languages (as is JavaScript) where most participators do
> not really know what they are doing. Copying some JS around and kicking it
> into the shape you like, or writing a plugin for wordpress do not qualify
> one as a good developer. So I think people that have the "You cannot do
> nice things in PHP as the language is broken, in Python its so much nicer"
> attitude are rather short sighted (or just trolling). (And I'm not implying
> OP has this attitude.) Those who create messes in PHP are going to do the
> same thing in Python.
>
> To answer the question if python is better then PHP for website dev: it
> depends on the situation. Do you have a legacy system in PHP and a team of
> people familiar with PHP, then go with PHP. If you have never done Python,
> and want to start a toy project, go play with Python.
>

Everything said here. In lots of cases, you can pick the tool you feel most
comfortable with because for all practical purposes it won't matter at all.
That being said, there's some things that each language may excel at, so
picking the right tool for the task at hand is important.

And no matter the tool, you can always write bad code and look like a fool;
that is language independent ;-)

-Chad
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

Ori Livneh
In reply to this post by Petr Bena
On Sat, Jul 27, 2013 at 11:29 AM, Petr Bena <[hidden email]> wrote:

> Lot of people hate these discussions I <3 them.
>
> Can someone tell me some pros and cons of using python over php? I
> recently heard from several people that python is even better than php
> for website developement so I am wondering if that is actually true.
>
> Someone has experience with that?
>

Try it and see. Flask (<http://flask.pocoo.org/>) is the Python community's
darling, but I'd recommend starting with Bottle (<
http://bottlepy.org/docs/dev/>) instead. It's distributed as a single file
and has no dependencies outside the Python standard library, which means
you can get work done without having to grok Python packaging and
distribution.

Django (<https://www.djangoproject.com/>) is Python's answer to Ruby on
Rails. It's excellent, robust, well-documented and has a great community
but its scope is very large. If you start with it you'll have a hard time
separating its patterns and conventions from Python's, and thus it is not
ideally suited for a newcomer to the language.
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

Petr Bena
In reply to this post by Chad
Well I know I can write a website in c++ (you can always extend apache
with some nice module), but despite it would be probably very
effective (much faster than using interpreted language) it would
require a lot of work to do that.

I am no huge fan of python, in fact I don't like it very much, and
indeed this is rather generic question, not regarding anything
specific (although in fact I am considering creation of some webbased
simple interface for one of my tools on wmflabs and I was considering
trying python this time).

The reason why I ask is that php always seemed quite nice to me for
dynamic website development, and I am quite curious how it happened,
that something else is beating it in popularity (yes there are more
php sites ATM, but who knows how it's gonna look like in few years
given this python-epidemy :))

On Sat, Jul 27, 2013 at 10:43 PM, Chad <[hidden email]> wrote:

> On Sat, Jul 27, 2013 at 11:48 AM, Jeroen De Dauw <[hidden email]>wrote:
>
>> Hey,
>>
>> Python has its nice things, and is generally considered more hip then php.
>> So are languages such as Ruby. Its true there are some stupid things in
>> php, such as inconsistencies in the base library, and the dozen lines
>> needed to do a map and a filter (vs one in python) in a readable way. If
>> one looks at the bigger picture, those are not deal breakers though.
>> Creating well crafted code is definitely possible in PHP. Unfortunately PHP
>> is one of those languages (as is JavaScript) where most participators do
>> not really know what they are doing. Copying some JS around and kicking it
>> into the shape you like, or writing a plugin for wordpress do not qualify
>> one as a good developer. So I think people that have the "You cannot do
>> nice things in PHP as the language is broken, in Python its so much nicer"
>> attitude are rather short sighted (or just trolling). (And I'm not implying
>> OP has this attitude.) Those who create messes in PHP are going to do the
>> same thing in Python.
>>
>> To answer the question if python is better then PHP for website dev: it
>> depends on the situation. Do you have a legacy system in PHP and a team of
>> people familiar with PHP, then go with PHP. If you have never done Python,
>> and want to start a toy project, go play with Python.
>>
>
> Everything said here. In lots of cases, you can pick the tool you feel most
> comfortable with because for all practical purposes it won't matter at all.
> That being said, there's some things that each language may excel at, so
> picking the right tool for the task at hand is important.
>
> And no matter the tool, you can always write bad code and look like a fool;
> that is language independent ;-)
>
> -Chad
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

Chad
On Sat, Jul 27, 2013 at 2:14 PM, Petr Bena <[hidden email]> wrote:

> The reason why I ask is that php always seemed quite nice to me for
> dynamic website development, and I am quite curious how it happened,
> that something else is beating it in popularity (yes there are more
> php sites ATM, but who knows how it's gonna look like in few years
> given this python-epidemy :))
>
>
It was designed to do that from the get go. It's not Personal Home Page
for nothing ;-)

-Chad
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

Svip
May I recommend taking a look at Go?  I'd love to implement a Wiki in
Go, if I had the time or motivation (and not a million other things I
want to do).

Go captures my excitement.

Oh but, a word of warning; if you are using to one language, then Go
will be rather different.

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

Jay Ashworth-2
In reply to this post by Yuvi Panda
I will pass your approbation on to ESR  :_)

Cheers,
-- jra

----- Original Message -----

> From: "Yuvi Panda" <[hidden email]>
> To: "Wikimedia developers" <[hidden email]>
> Sent: Saturday, July 27, 2013 2:55:46 PM
> Subject: Re: [Wikitech-l] python vs php
> Can we all just agree that haskell, clojurescript and INTERCAL are the
> best ever, and move on?
>
>
> --
> Yuvi Panda T
> http://yuvi.in/blog
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

--
Jay R. Ashworth                  Baylink                       [hidden email]
Designer                     The Things I Think                       RFC 2100
Ashworth & Associates     http://baylink.pitas.com         2000 Land Rover DII
St Petersburg FL USA               #natog                      +1 727 647 1274

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

Steven Walling
In reply to this post by Yuvi Panda
On Saturday, July 27, 2013, Yuvi Panda wrote:

> Can we all just agree that haskell, clojurescript and INTERCAL are the
> best ever, and  move on?
>
>
> --
> Yuvi Panda T
> http://yuvi.in/blog


Apropos...

http://www.developerarguments.com/<http://www.developerarguments.com/sysv-vs-bsd/>



>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email] <javascript:;>
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

Dmitriy Sintsov

The problem is not awkward syntax of PHP. Main problem is that PHP is a specialized language. For example it does not have built-in threading. Posix threading is not universally available for PHP. Python and Java has it's own VM-backed threading everywhere. Java is suitable platform to build OS. PHP is not. Even web server backend itself is rarely implemented in PHP.
http://www.artima.com/insidejvm/ed2/jvm.html
"Complete feature" language should be suitable to build OS.
Perhaps Zend VM could be "beefed up" itself to make PHP the same class as Java.
Dmitriy
 
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: python vs php

Chad
On Sun, Jul 28, 2013 at 10:59 PM, Dmitriy Sintsov <[hidden email]>wrote:

>
> The problem is not awkward syntax of PHP. Main problem is that PHP is a
> specialized language. For example it does not have built-in threading.
> Posix threading is not universally available for PHP. Python and Java has
> it's own VM-backed threading everywhere. Java is suitable platform to build
> OS. PHP is not. Even web server backend itself is rarely implemented in PHP.
> http://www.artima.com/**insidejvm/ed2/jvm.html<http://www.artima.com/insidejvm/ed2/jvm.html>
> "Complete feature" language should be suitable to build OS.
> Perhaps Zend VM could be "beefed up" itself to make PHP the same class as
> Java.


And on that note, this thread (like the other one) has run its course.
Like that one, I recommend everyone going back to your silly cat
videos or whatever else you enjoy doing.

-Chad
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l