473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Should I learn Python?

Sam
Hi,
I have been developing sites and cms's for the past few years using
PHP and mysql. I've been interested in learning a new language and was
considering Python. I have a pretty decent grasp of OOP concepts (i
know, you're skeptical since I mentioned PHP). I don't have a formal
programming background, just learning as I go.

So, with that being said, here are some dumb questions.

1. What can I do with Python that I can't do with php?

2. Do you use both PHP and Python in conjunction with each other?

3. In what way could I utilize Python to compliment existing sites or
apps built with PHP?

Thanks for any help.
Jul 18 '05 #1
14 1699
Sam a écrit :
Hi,
I have been developing sites and cms's for the past few years using
PHP and mysql. I've been interested in learning a new language and was
considering Python. I have a pretty decent grasp of OOP concepts (i
know, you're skeptical since I mentioned PHP). I don't have a formal
programming background, just learning as I go.

So, with that being said, here are some dumb questions.

1. What can I do with Python that I can't do with php? <troll>
1/ Write clean, well structured, readable code,
2/ Have Fun
</troll>
3/ Use Zope
4/ Use Twisted
5/ etc...
2. Do you use both PHP and Python in conjunction with each other? No. I use PHP for legacy apps and really dumb scripting.
3. In what way could I utilize Python to compliment existing sites or
apps built with PHP? a cgi is a cgi, whatever the language (php, perl, python, bash, C,
COBOL, assembly....).
Thanks for any help.

HTH
Jul 18 '05 #2
bruno modulix <on***@xiludom.gro> wrote:
3. In what way could I utilize Python to compliment existing sites or
apps built with PHP?

a cgi is a cgi, whatever the language (php, perl, python, bash, C,
COBOL, assembly....).


But there's a lot more to web applications than CGI.
Jul 18 '05 #3
On 2 Nov 2004 13:28:22 -0800, Sam <sa*@three60.com> wrote:
Hi,
I have been developing sites and cms's for the past few years using
PHP and mysql. I've been interested in learning a new language and was
considering Python. I have a pretty decent grasp of OOP concepts (i
know, you're skeptical since I mentioned PHP). I don't have a formal
programming background, just learning as I go.

So, with that being said, here are some dumb questions.

1. What can I do with Python that I can't do with php?

2. Do you use both PHP and Python in conjunction with each other?

3. In what way could I utilize Python to compliment existing sites or
apps built with PHP?

Thanks for any help.
--
http://mail.python.org/mailman/listinfo/python-list


Learning Python would be an excellent next step in your development.
Most programming textbooks recommend you learn at least one new
language a year. Python is a clean, well designed language and should
be straightforward (and fun) for you to learn.

But to answer your questions:
1. PHP is a web scripting language and Python is a general purpose
scripting language. You can use PHP outside of a web environment but
that really isn't its strong point. You can use Python pretty much
anywhere.

2. No. Where I work we have one internal app written in PHP but are
moving towards developing exclusively in Python. We have thought about
potentially using PHP for the presentation layer and Python for the
business logic but haven't gotten that far yet.

3. Where do you need it? If PHP works for your site then Python may
not be a necessary addition.

HTH,
Melissa
Jul 18 '05 #4
> 1. What can I do with Python that I can't do with php?

Python is a much cleaner. Its design was well thought-out, with very
good support of OOP (something which has been problematic in PHP 4).
Also, several features in Python make sure you write clean code with it,
something that is very much lacking in PHP. Finally, the library in
Python is cleanly separated and easily extensible.
2. Do you use both PHP and Python in conjunction with each other?
I've used PHP a lot, but I'm currently moving all development effort to
Python. For some projects, I think combined use could be useful (e.g. to
setup a web service of which one side is easier to do in Python, while
the other side would be easier to do in PHP).
3. In what way could I utilize Python to compliment existing sites or
apps built with PHP?


This depends on the way your applications are written. My PHP
applications are always embedded in a framework I wrote myself, and this
would make it hard to effectively extend the application in Python.

Regards,

Dirkjan
Jul 18 '05 #5
Am Tue, 02 Nov 2004 13:28:22 -0800 schrieb Sam:
Hi,
I have been developing sites and cms's for the past few years using
PHP and mysql. I've been interested in learning a new language and was
considering Python. I have a pretty decent grasp of OOP concepts (i
know, you're skeptical since I mentioned PHP). I don't have a formal
programming background, just learning as I go.

So, with that being said, here are some dumb questions.

1. What can I do with Python that I can't do with php?
AFAIK there is no object database like ZODB (or Durus) for php.
2. Do you use both PHP and Python in conjunction with each other?


No. Only python, a little shell (bash) and calling external programms with
os.system or popen.

Thomas

Jul 18 '05 #6
Sam
So you're saying, in order to write smart, clean, well structured,
readable code, and have fun doing so, I'm going to have to drop PHP
and use Python?

I'm not really interested in finding a replacement for PHP, it works
just fine for me.

I apologize for not phrasing my questions clearly, I wasn't looking
for critisisms of PHP or why I shouldn't use it. What i'm really
after, is given that I use PHP to develop sites currently, what types
of situations would/could i use Python in web development? Is there a
point when learning Python, that I'll say to myself "why use php?".
Thanks
Jul 18 '05 #7
Sam wrote:
Should I learn Python?
I think learning a new langauge every once in while can be
extremely beneficial even if one does not actually
switch to it
1. What can I do with Python that I can't do with php?
You cannot write Python code in php.
2. Do you use both PHP and Python in conjunction with each other?
No and probably very few do.
3. In what way could I utilize Python to compliment existing sites or
apps built with PHP?


Implementing more complex algorithms is a lot easier with python.
You still need a way to interface between the two though.

Istvan.
Jul 18 '05 #8
Sam wrote:
So you're saying, in order to write smart, clean, well structured,
readable code, and have fun doing so, I'm going to have to drop PHP
and use Python?


well yeah,

but of course it all depends on the complexity of the problem that
you have to solve.

A simple functionality, can be made into a clean, well structured readable code even
in say C shell, (I recently had to use bash, I totally forgot how frustrating and
rigid language it is ...)

Istvan.
Jul 18 '05 #9
In article <62**************************@posting.google.com >,
Sam <sa*@three60.com> wrote:
So you're saying, in order to write smart, clean, well structured,
readable code, and have fun doing so, I'm going to have to drop PHP
and use Python?

I'm not really interested in finding a replacement for PHP, it works
just fine for me.

I apologize for not phrasing my questions clearly, I wasn't looking
for critisisms of PHP or why I shouldn't use it. What i'm really
after, is given that I use PHP to develop sites currently, what types
of situations would/could i use Python in web development? Is there a
point when learning Python, that I'll say to myself "why use php?".
Thanks


If you're happy with PHP, you'll likely stay with PHP, until you
run into an off-beat capability (Expect? scientific/numeric
programming? Does PHP build-in LDAPv3 awareness? UDP? SNMP?)
that you both need and that PHP makes painful.
Jul 18 '05 #10
I also learned PHP first, but have been very happy that I
moved to Python. The OOP capabilities are no comparison
(e.g. Python is better IMHO). It is the richness of the
standard library and add-ons that make Python a good choice.
Things like ReportLab, Python Imaging Library, SMTP, FTP,
URLlib, etc.

One of my recent sites used PHP for front-end UI and Python
for backend database processing. The combination worked well
for that client. I still think that if I did it today, I would
do it all in Python, but the combination worked well. The UI
was not complex so I did it in PHP very quickly.

One very big difference is that I can do more DIFFERENT things
in Python than PHP. I can write standalone programs with Python
using wxWindows, etc. I've written COM objects, Windows Services,
plain scripts, programs that manipulate the Windows Registry,
programs that modify the NT user database, you name it. These
types of programs just don't make sense in PHP. I find that I
am able to learn one language very well instead of VB for GUI
apps, C/C++ for services/COM objects, PHP for web applications, ...

Python just addresses a wider landscape over more different
platforms for me.

Larry Bates
Syscon, Inc.
Sam wrote:
Hi,
I have been developing sites and cms's for the past few years using
PHP and mysql. I've been interested in learning a new language and was
considering Python. I have a pretty decent grasp of OOP concepts (i
know, you're skeptical since I mentioned PHP). I don't have a formal
programming background, just learning as I go.

So, with that being said, here are some dumb questions.

1. What can I do with Python that I can't do with php?

2. Do you use both PHP and Python in conjunction with each other?

3. In what way could I utilize Python to compliment existing sites or
apps built with PHP?

Thanks for any help.

Jul 18 '05 #11
If you have not, I suggest that you spend about 2 hours reading through the
Python tutorial. The should be enough to experience whether Python grabs
you, the way it has some of us, or repels you, as it has others.

tjr

Jul 18 '05 #12
Sam wrote:
So you're saying, in order to write smart, clean, well structured,
readable code, and have fun doing so, I'm going to have to drop PHP
and use Python?
Err... You might not have notice, but this was enclosed in a <troll> tag !-)

You can of course write smart, clean, well structured, readable code in
PHP - it's just that's it's easier and more fun (IMVHO) to do so in Python.
I'm not really interested in finding a replacement for PHP, it works
just fine for me.

I apologize for not phrasing my questions clearly, I wasn't looking
for critisisms of PHP or why I shouldn't use it.
I apologize for being a troll.
What i'm really
after, is given that I use PHP to develop sites currently, what types
of situations would/could i use Python in web development?
Well, there's no exact answer to this question. It's not a matter of raw
functionnalities, PHP has it all (or almost, but well...). What Python
has to offer is :
- the language itself, which is IMHO cleaner, smarter and more fun
- frameworks or application servers like Zope, Twisted, Nevow etc

Zope is somewhat not easy to 'get into', but it's worth the effort, and
you can experience productivity gain even on the first project (well...
I did at least).

Is there a
point when learning Python, that I'll say to myself "why use php?".
Depends on you. I personnally still use PHP for quick&dumb stuffs like
includes, simple forms etc., cause Python itself would not buy me
anything for such things and using Zope would be overkill.

Thanks

You're welcome (and please forgive my trollness)
Bruno

Jul 18 '05 #13
Sam
Thanks Bruno,
No need to apologize, just thought maybe I wasn't being clear, thanks
for your insight
Jul 18 '05 #14
sa*@three60.com (Sam) wrote in message news:<62**************************@posting.google. com>...
So you're saying, in order to write smart, clean, well structured,
readable code, and have fun doing so, I'm going to have to drop PHP
and use Python?

I'm not really interested in finding a replacement for PHP, it works
just fine for me.

I apologize for not phrasing my questions clearly, I wasn't looking
for critisisms of PHP or why I shouldn't use it. What i'm really
after, is given that I use PHP to develop sites currently, what types
of situations would/could i use Python in web development? Is there a
point when learning Python, that I'll say to myself "why use php?".
Thanks


learn python and you will answer your own question, php is just about
1 rung above perl in maintainability
Jul 18 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

42
by: Bicho Verde | last post by:
I have now free time and money to do what I want :-) I have some basic skills in programming (C, Pascal, Macromedia Actionscript) but don't know exactly what to do in the world of programming. And...
13
by: Zeljko Vrba | last post by:
Now, why would I like to learn Python: because of IronPython port to CLR. Perl port to CLR doesn't seem to be coming soon. First Perl6 for Parrot has to be written, and then other backends.. ...
3
by: EnderLocke | last post by:
I have a friend who wants to learn python programming. I learned off the internet and have never used a book to learn it. What books do you recommend? Any suggestions would be appreciated.
7
by: fyleow | last post by:
Hi guys, I'm a student/hobbyist programmer interested in creating a web project. It's nothing too complicated, I would like to get data from an RSS feed and store that into a database. I want...
5
by: Brian Blais | last post by:
Hello, I was wondering what the approximate minimum age to learn python is. Has anyone had experience teaching middle school students, or elementary school students Python? What brought this up...
18
by: Amol | last post by:
Hi, I want to learn Python in less than a month which resources should I use. I prefer to read books . Please give me a list of *recognized* resources. Thank You all
28
by: windandwaves | last post by:
Can someone tell me why I should learn python? I am a webdeveloper, but I often see Python mentioned and I am curious to find out what I am missing out on. Thank you Nicolaas
2
by: kang jia | last post by:
hi i am very new to python and my final year project require me to do a Web application with Django web application framework( is only Python can work with this framework, are there any other...
2
by: Nathan McSween | last post by:
Hi I would like to learn python I have background in php, pawn, bash. I was wondering if anyone would like to show me the ropes or even just throw me some code that needs work and seeing what I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.