Python

Hi,

I would like to know your opinion on the python.

Do you have any experience in that language?

On the web you can find a lot of information that the language python is better than php. Do you agree with this?

Is Django framework as good as Yii?

Thank you for your feedback.

Python is of the same nature as PHP. More consistency, a bit more types, stricter.

Have little experience.

No. No language can beat PHP when it comes to info.

Django is a good one but different from Yii conceptually.

if you want a language that can interface with devices or build an OS depend standalone softwares, then Python is a good option. but when it comes to web scripting, PHP has a upper hand because of the vast,deeper understanding and knowledge base.

Hi Sam,

Just curious… what projects would be preferred to be done using Django and not Yii?

And vice versa what projects are more suited to Yii over Django?

Insights here would be greatly appreciated.

Thanks,

I haven’t done any serious Django projects so I don’t know the answer.

From the business owner view it should be simple:

PHP is easier, more developers, more companies, works out the box, powers Facebook, Wikipedia etc. = reliable, cheaper, much more stable in terms of finding developers.

I think the differences can be boiled down to these points:

  1. PHP was ment to be used for the web. It is more or less a templating language on steroids while Python is a general purpose scripting language. You can build non-web applications with Python (The code editor Sublime Text 2 for example, even Battlefield 2 used Python for a lot of stuff as I’ve heard and Google is using it quite heavily). This is nearly impossible using PHP.

  2. PHP is ment to react to a request, handle it and serve a response (a web request scenario). It was not created to build long running scripts which is why it is known to be less efficient when used in that context (memory leakage etc.). But that also makes it very scalable.

  3. If you need realtime communication (server push like in a chat etc.) you would need to add something like NodeJs to your app (or use long polling if traffic is small). There is no production ready PHP version of Python’s Twisted framework for solving that at the moment (the closest being React https://github.com/reactphp/react).

  4. PHP has changed a lot the last couple of years. It has become a very solid object-oriented programming language. If you hear people ranting about it then it is probably because they’re referring to yesterday’s PHP. Yes, the API is inconsistent but hey: One can live with that.

  5. PHP developers are cheaper

  6. PHP is easier to start with

  7. PHP is very wide spread

And which one is better? Another question: Which language is better: German or French? :) It totally depends on your needs

Just for clarification: Sublime is written in C++ but exposes an API for Python

Haensel

Some of your points are a bit outdated ;)

  1. PHP nowadays is general purpose as well. Biased towards web, of course, but still. There’s GTK, some things to use PHP on mobile… even Delphi for PHP.

  2. Most of the leaks were fixed. The rest are handle by 5.3+ garbage collector. If you’ll check projects like http://reactphp.org/ I doubt you’ll keep saying that PHP is for request-response only.

  3. See #2 + https://github.com/kakserpom/phpdaemon

@Coksnuss: Thanks. Always thought it is pure Python. But that would explain its speed then ;)

@samdark: Let me correct that: Its MAIN purpose is/was the typical request/response scenario and you might very well be able to write your own web server or whatsoever in it :) To complete our collection of cool PHP projects: Ratchet - a PHP websocket library http://socketo.me/ :)

EDIT: @PHP and Delphi: WTF, nerds ;)

Python is a general purpose interpreted language. And people love it so much that they made it possible to use it even for web development.

PHP is a web development language, and people love it so much that they made it possible to use it even for general purpose programming, like shell scripting or even desktop GUI programming.

They are two very different things, in other words.

What really makes PHP shine, IMO, in contrast to Python, is that PHP applications lives and dies for each request.

That makes it safer and leaner than Python (which is a long running process).

Python integrates better with the OS on which it runs, simply because it’s a ‘full stack’ language.

PHP is special purpose, and (of course) works extremely well for web development. Simply because it was designed that way. :)

That you can write horrible code in PHP doesn’t make it a horrible language. ;)

I really like that you can be both quick and (really!) dirty in PHP.

Yet, at the same time, it’s possible to write some very beautiful code using it.

Other than that: whatever floats your boat.

It’s not really the language that matters. A great programmer knows several languages, and knows what language to choose when.

@jacmoe: Thanks for your comments but I wanted to know about any material differences between Django vs Yii. Does one platform lend itself more to a type of project.

E.g. If you were going to be develop an ERP SaaS vs Desktop Client vs Server.

Or maybe an online website scrapper?

Since the growth of PHP and Python as well as Django and Yii (esp 2.0), it seems (at least to a very non-technical person), that the decision will most be based on other factors like availability of developers etc.

Would like to hear your thoughts?

Thanks,

You can compare Django with Drupal, I think, more than you can compare Yii and Django.

Yii is definitely more flexible than Django.

I think Django lends itself to larger projects with involved back-ends - but I think you need to try Django yourself to see if it fits your needs.

Like Ruby On Rails, Django makes a lot of decisions on your behalf, and if you stray too far from the path, you usually end up with more work than worth. :)

If you are a DYI type of guy, and a PHP kind of guy, then Yii is able to accommodate any type of project.

Edit:

In terms of developers, Django have more than Yii - although that has begun to change in favor of Yii.

But I think that Drupal (which is more like a CMS-like framework) has even more developers/resources.

Also, come to think of it, Django really lends itself to CMS-like projects AFAIK than any other type of project. (But don’t quote me too much on that).

What I’m trying to say is, what really matters the most is what you like to work with the most. ;)

And no one can answer that question better than you.

There are a lot of articles about this versus that, but they are all highly subjective.

Have that in mind when (or even if) you read some of them.