PHP guy testing the waters

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

PHP guy testing the waters

Jed Wood-3
Hey all-

I'll put the questions first and save the background info for the end, in case anybody wants more context. For now, just know that I'm a PHP guy and don't know much about Python, so go easy on me. :)

1- amfast claims to have more speed, but PyAMF also uses a C-extension, right? So I'm inclined to think that PyAMF is still crazy fast- at some point I don't care of the response time on 10000 records is 250ms instead of 500ms. Most importantly PyAMF seems to have a solid community and strong team of maintainers (which poor AMFPHP has not had in recent years). Thoughts?

2- Does PyAMF handle the new Vector datatype coming from Flash Player 10?

3- Do any of you use Django? Is it worth learning and using, if my only intention is to expose the methods to Flash/Flex via PyAMF? 

4- What are the biggest hurdles/adjustments/complaints I'll have switching from PHP to Python?

5- What web server do you recommend? I'm most familiar with Apache, and a bit of Nginx. Should I just go with mod_python for now, or are there compelling reasons to run Tornado or Twisted?

Thanks!
-Jed

===
Quick bit of background. 10 years ago I was a usability guy who started playing with Flash, who then got pretty serious about RIA development right on through to Flex, and along the way I learned a lot about server-side development and hosting. AMFPHP has always been my tool of choice. Currently I run all my apps on Amazon's EC2. I've never gotten too excited about frameworks (Ruby on Rails, CakePHP, etc) because I'm almost always a solo developer, and it seems like more often than not I end up needing complex customized MySQL queries or other optimizations that don't benefit much from frameworks.

That being said, I would like to get cozy with one of the current frameworks, and Django seems appealing to me for some reason. I know just a wee bit of Python, mostly from trying to make use of the fantastic Boto library to interact with AWS. And picking up Django would mean using PyAMF, so that's why I'm here. :)  




_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: PHP guy testing the waters

Jesse Warden-2
Know half of 1, 3, and 4 so I'll attempt to take those.

1. I learned coding PHP.  Zend, however, was intimidating, whereas Django was not.  Thus, Python for the win!

3. See #1; it's PIMP!  ...however, there are a lot of programmers who are smart enough in Python/middle-tier dev that they don't need Django.  I'm not one of those, so even if my app is only a few tables, and 5 methods, I'll still use.  You certainly don't have too, though, and like I said there are a lot of people who use straight Python or their own library preferences.

4. white space.  If you grew up like I did coding ActionScript 1 in Flash (near exact same to JavaScript), then PHP was uber-easy to learn since they are very similar in almost all respects (PHP 4 & 5).  In learning Python with that background, the only challenging things were their Tuple type, the slicing syntax (used for Arrays/Lists, etc), and their need for whitespace assurance.



On Sat, Feb 20, 2010 at 10:38 PM, Jed Wood <[hidden email]> wrote:
Hey all-

I'll put the questions first and save the background info for the end, in case anybody wants more context. For now, just know that I'm a PHP guy and don't know much about Python, so go easy on me. :)

1- amfast claims to have more speed, but PyAMF also uses a C-extension, right? So I'm inclined to think that PyAMF is still crazy fast- at some point I don't care of the response time on 10000 records is 250ms instead of 500ms. Most importantly PyAMF seems to have a solid community and strong team of maintainers (which poor AMFPHP has not had in recent years). Thoughts?

2- Does PyAMF handle the new Vector datatype coming from Flash Player 10?

3- Do any of you use Django? Is it worth learning and using, if my only intention is to expose the methods to Flash/Flex via PyAMF? 

4- What are the biggest hurdles/adjustments/complaints I'll have switching from PHP to Python?

5- What web server do you recommend? I'm most familiar with Apache, and a bit of Nginx. Should I just go with mod_python for now, or are there compelling reasons to run Tornado or Twisted?

Thanks!
-Jed

===
Quick bit of background. 10 years ago I was a usability guy who started playing with Flash, who then got pretty serious about RIA development right on through to Flex, and along the way I learned a lot about server-side development and hosting. AMFPHP has always been my tool of choice. Currently I run all my apps on Amazon's EC2. I've never gotten too excited about frameworks (Ruby on Rails, CakePHP, etc) because I'm almost always a solo developer, and it seems like more often than not I end up needing complex customized MySQL queries or other optimizations that don't benefit much from frameworks.

That being said, I would like to get cozy with one of the current frameworks, and Django seems appealing to me for some reason. I know just a wee bit of Python, mostly from trying to make use of the fantastic Boto library to interact with AWS. And picking up Django would mean using PyAMF, so that's why I'm here. :)  




_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users



_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: PHP guy testing the waters

David Wolever-4
In reply to this post by Jed Wood-3
> 1- amfast claims to have more speed, but PyAMF also uses a C-
> extension, right? So I'm inclined to think that PyAMF is still crazy  
> fast- at some point I don't care of the response time on 10000  
> records is 250ms instead of 500ms. Most importantly PyAMF seems to  
> have a solid community and strong team of maintainers (which poor  
> AMFPHP has not had in recent years). Thoughts?

I can't speak to the details - Nick or someone else will know better -  
but they are both very fast. Or, in other words, unless really, really  
high speed is an important requirement, you'll be fine with whatever.

> 2- Does PyAMF handle the new Vector datatype coming from Flash  
> Player 10?

A quick grep though the source suggests that it doesn't.
I don't know if there is any plan to add it, though - someone smarter  
than me might be able to help.

> 3- Do any of you use Django? Is it worth learning and using, if my  
> only intention is to expose the methods to Flash/Flex via PyAMF?

I use Django, and it seems to be becoming the standard in the Python  
community.
So, yes - if you want to learn a Python web framework, Django is the  
way to go.

If your only intention is to expose Flash/Flex methods… Well, it might  
be a bit overkill - you could probably do with something simpler. I  
can't speak to that, though, because Django is simplest for me.

Also, if you want to see a small (but complete and working) example of  
Django + PyAMF, you can take a look at the example application on a  
small (very small) library I wrote, which makes PyAMF integrate more  
nicely with Django:

     http://bitbucket.org/wolever/django-amf-gateway/src/tip/django_example/

> 4- What are the biggest hurdles/adjustments/complaints I'll have  
> switching from PHP to Python?
It'll probably take a fairly fundamental shift in mentality. The  
average Python code is a lot more structured than the average PHP  
code… So depending on the kind of PHP code you're used to, you may  
find that it takes a bit more "framework" code to get Python going.

That makes it a bit more difficult to get a small app up (I still use  
PHP when I want to write small (one or two page) webapps)… But it  
makes larger apps a lot easier to maintain.

> 5- What web server do you recommend? I'm most familiar with Apache,  
> and a bit of Nginx. Should I just go with mod_python for now, or are  
> there compelling reasons to run Tornado or Twisted?
Don't worry about the server until you've got load… Then you can  
decide Nginx VS Apache. But until then, just whatever you know better.
I (and probably a million other people) have been haply using Apache  
for ages, and it has never been a problem for me.

Also, use mod_wsgi. It has become the standard in the Python community.

It's stupidly easy to use, too (at least form Apache). For example,  
here is my per-site Apache configuration:

     Alias /media .../path/to/application/media/
     WSGIScriptAlias / .../path/to/application/run.wsgi


_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: PHP guy testing the waters

Nick Joyce
In reply to this post by Jed Wood-3
On 20 Feb 2010, at 22:38, Jed Wood wrote:

> Hey all-

Welcome! :-)

> I'll put the questions first and save the background info for the end, in case anybody wants more context. For now, just know that I'm a PHP guy and don't know much about Python, so go easy on me. :)
>
> 1- amfast claims to have more speed, but PyAMF also uses a C-extension, right? So I'm inclined to think that PyAMF is still crazy fast- at some point I don't care of the response time on 10000 records is 250ms instead of 500ms. Most importantly PyAMF seems to have a solid community and strong team of maintainers (which poor AMFPHP has not had in recent years). Thoughts?

Lots of gory details, feel free to skip to the next comment :)

PyAMF has made some good strides towards performance in both the pure Python and the c-extension. It was pretty awful (if I do say so myself!) in the 0.3/0.4 versions but we weren't even looking at performance back then.

For example, encoding a 50000+ node, relatively complex object graph using pure python in 0.5.1 (latest release) takes ~10 seconds on my local box. The current trunk takes 6.7. By comparison 0.4.2 would take 48 seconds :-)

The next release of PyAMF will be 0.6. The bundled c-extension has up to this point been a second class citizen, but no more! The Encoder and Decoder in AMF3 have been translated into C code which makes them around a magnitude faster than their pure python counterparts. The same benchmark is around 1 second right now. AMF0 will also be translated into C for the release.

>
> 2- Does PyAMF handle the new Vector datatype coming from Flash Player 10?

The AMF specification has no direct equivalent for this, however using the ByteArray type, this *seems* to have been possible. Check http://dev.pyamf.org/ticket/697 for more details.

>
> 3- Do any of you use Django? Is it worth learning and using, if my only intention is to expose the methods to Flash/Flex via PyAMF?

Django (especially the ORM) is well supported by PyAMF and we want to continue to maintain the work we've put in to the integration and keep it as easy (and flexible) as possible for users.

>
> 4- What are the biggest hurdles/adjustments/complaints I'll have switching from PHP to Python?

Typical beginner gripes are the attention to indentation, lack of curly braces. There are plenty of PHP vs Python vs * flamewars on the interwebs, I don't want to start one here. :-)

>
> 5- What web server do you recommend? I'm most familiar with Apache, and a bit of Nginx. Should I just go with mod_python for now, or are there compelling reasons to run Tornado or Twisted?

Take the good advice from David on this one.

Cheers,

Nick
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: PHP guy testing the waters

Jed Wood-3
In reply to this post by David Wolever-4
Nick, David, and Jesse-

Thanks for all of your responses. I was pleasantly surprised to see Jesse hanging around here- we have a similar background being long-time pragmatic Flash hackers turned web app architects. Or something like that. Anyway, me a tuples are now immutable friends.

I'll try to send my general Python and Django questions to the appropriate lists. I've got two quick AMF items that I'll save for their own threads.

Thanks again,
-Jed


On Feb 21, 2010, at 8:59 AM, David Wolever wrote:

>> 1- amfast claims to have more speed, but PyAMF also uses a C-extension, right? So I'm inclined to think that PyAMF is still crazy fast- at some point I don't care of the response time on 10000 records is 250ms instead of 500ms. Most importantly PyAMF seems to have a solid community and strong team of maintainers (which poor AMFPHP has not had in recent years). Thoughts?
>
> I can't speak to the details - Nick or someone else will know better - but they are both very fast. Or, in other words, unless really, really high speed is an important requirement, you'll be fine with whatever.
>
>> 2- Does PyAMF handle the new Vector datatype coming from Flash Player 10?
>
> A quick grep though the source suggests that it doesn't.
> I don't know if there is any plan to add it, though - someone smarter than me might be able to help.
>
>> 3- Do any of you use Django? Is it worth learning and using, if my only intention is to expose the methods to Flash/Flex via PyAMF?
>
> I use Django, and it seems to be becoming the standard in the Python community.
> So, yes - if you want to learn a Python web framework, Django is the way to go.
>
> If your only intention is to expose Flash/Flex methods… Well, it might be a bit overkill - you could probably do with something simpler. I can't speak to that, though, because Django is simplest for me.
>
> Also, if you want to see a small (but complete and working) example of Django + PyAMF, you can take a look at the example application on a small (very small) library I wrote, which makes PyAMF integrate more nicely with Django:
>
>    http://bitbucket.org/wolever/django-amf-gateway/src/tip/django_example/
>
>> 4- What are the biggest hurdles/adjustments/complaints I'll have switching from PHP to Python?
> It'll probably take a fairly fundamental shift in mentality. The average Python code is a lot more structured than the average PHP code… So depending on the kind of PHP code you're used to, you may find that it takes a bit more "framework" code to get Python going.
>
> That makes it a bit more difficult to get a small app up (I still use PHP when I want to write small (one or two page) webapps)… But it makes larger apps a lot easier to maintain.
>
>> 5- What web server do you recommend? I'm most familiar with Apache, and a bit of Nginx. Should I just go with mod_python for now, or are there compelling reasons to run Tornado or Twisted?
> Don't worry about the server until you've got load… Then you can decide Nginx VS Apache. But until then, just whatever you know better.
> I (and probably a million other people) have been haply using Apache for ages, and it has never been a problem for me.
>
> Also, use mod_wsgi. It has become the standard in the Python community.
>
> It's stupidly easy to use, too (at least form Apache). For example, here is my per-site Apache configuration:
>
>    Alias /media .../path/to/application/media/
>    WSGIScriptAlias / .../path/to/application/run.wsgi
>
>
> _______________________________________________
> PyAMF users mailing list - [hidden email]
> http://lists.pyamf.org/mailman/listinfo/users

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: PHP guy testing the waters

Thijs Triemstra
In reply to this post by David Wolever-4
Hi David,

>> 5- What web server do you recommend? I'm most familiar with Apache, and a bit of Nginx. Should I just go with mod_python for now, or are there compelling reasons to run Tornado or Twisted?
> Don't worry about the server until you've got load… Then you can decide Nginx VS Apache. But until then, just whatever you know better.
> I (and probably a million other people) have been haply using Apache for ages, and it has never been a problem for me.
>
> Also, use mod_wsgi. It has become the standard in the Python community.
>
> It's stupidly easy to use, too (at least form Apache). For example, here is my per-site Apache configuration:
>
>    Alias /media .../path/to/application/media/
>    WSGIScriptAlias / .../path/to/application/run.wsgi

I prefer mod_wsgi but mod_python can be used as well. We have tutorials for both options:

http://pyamf.org/tutorials/apache/mod_wsgi.html
http://pyamf.org/tutorials/apache/mod_python.html

Cheers,

Thijs


_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users