Yii Framework Forum: Python - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Python Rate Topic: -----

#1 User is offline   qwerty 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 290
  • Joined: 20-November 08

Posted 09 September 2012 - 04:50 AM

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.
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,428
  • Joined: 17-January 09
  • Location:Russia

Posted 09 September 2012 - 11:26 AM

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

Quote

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

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

Django is a good one but different from Yii conceptually.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
1

#3 User is offline   binkabir 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 194
  • Joined: 25-July 10
  • Location:Abuja,Nigeria

Posted 10 September 2012 - 04:07 AM

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.
0

#4 User is offline   bbxyz 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 25-February 13

Posted 25 March 2013 - 06:07 AM

View Postsamdark, on 09 September 2012 - 11:26 AM, said:

Django is a good one but different from Yii conceptually.


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,
0

#5 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,428
  • Joined: 17-January 09
  • Location:Russia

Posted 25 March 2013 - 06:32 AM

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.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#6 User is offline   Haensel 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 444
  • Joined: 14-January 11
  • Location:Vienna (Austria)

Posted 25 March 2013 - 08:30 AM

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
4

#7 User is offline   Coksnuss 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 140
  • Joined: 14-May 09

Posted 25 March 2013 - 01:16 PM

Just for clarification: Sublime is written in C++ but exposes an API for Python
https://mobile.twitt...962887904739329
0

#8 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,428
  • Joined: 17-January 09
  • Location:Russia

Posted 25 March 2013 - 01:39 PM

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
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#9 User is offline   Haensel 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 444
  • Joined: 14-January 11
  • Location:Vienna (Austria)

Posted 25 March 2013 - 02:14 PM

@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 ;)
0

#10 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 25 March 2013 - 07:12 PM

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.
"Less noise - more signal"
0

#11 User is offline   bbxyz 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 25-February 13

Posted 25 March 2013 - 09:00 PM

View Postjacmoe, on 25 March 2013 - 07:12 PM, said:

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,
0

#12 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 25 March 2013 - 09:16 PM

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).
"Less noise - more signal"
0

#13 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 25 March 2013 - 09:17 PM

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.
"Less noise - more signal"
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users