Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,726 members, 7,820,514 topics. Date: Tuesday, 07 May 2024 at 04:18 PM

Python Vs Php - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Python Vs Php (4177 Views)

Poll: Which is better in general usability?

PHP: 100% (3 votes)
Python: 0% (0 votes)
This poll has ended

Coldfusion Vs Php/asp / Dreamweaver Vs Php,javascript E.t.c / Asp Vs Php Vs Coldfusion Vs Jsp ''who's Da Best (2) (3) (4)

(1) (Reply) (Go Down)

Python Vs Php by OmniPotens(m): 3:25pm On Mar 23, 2009
I've really wondered which is a better option, Python or PHP. Can you guys help me out ascertain the big difference and pros and cons of the two.
Re: Python Vs Php by Nobody: 6:20pm On Mar 23, 2009
hmmm! am also waiting
Re: Python Vs Php by Nobody: 9:27pm On Mar 23, 2009
I am on the waiting list too. . .i only know a few codes in python, can not claim to be a python programmer yet. . .
Re: Python Vs Php by pie1ect(m): 10:47pm On Mar 23, 2009
This is interesting. Everybody seems to be stuck on the waiting list. Count me in.

My 2cents at this point is this (from a very limited experience of Python):

PHP is more robust and is more widely used (on the web) than Python. As a web development language I don't think Python has ever really managed to gain a foothold, due IMHO to its rigidity, it doesn't seem to like HTML very much. That said, I think Python works best as a normal programming language and PHP works best as a web programming language.

That's the extent of my great knowledge of Python.
Re: Python Vs Php by Seun(m): 11:11pm On Mar 23, 2009
I maintain a successful forum written in PHP and I've written a website based on Python.

PHP is the clear choice if you're building websites for clients, primarily because
(1) hosting PHP is effortless because every host supports PHP
(2) you can never be blamed for using popular languages like PHP and Java
(3) PHP is designed for building websites.  And so very good at that.
(4) There are lots of free PHP scripts on the web.  e.g. SMF.  Enough said.

But PHP is also an extremely ugly and primitive language. (Python is beautiful)

Python is beautiful, but the Python community has failed to come up with an acceptable replacement for PHP.  On one hand the WSGI standard doesn't have any support for cookies or sessions, which is stupid - have you ever designed a website that doesn't require cookies?  No.  Yet Python's only standard for web development has no support for cookies. All these little things. Fortunately, there's CherryPy.

If you are in control of your deployment environment, i.e. you have a VPS or dedicated server that can run CherryPy, and you are tired of the ugliness of PHP, then Python may be for you. With Python you can build web apps, windows GUI apps, command line programs, and even commercial games. With PHP, you can only build web applications, so you have to learn a second language, which sucks.

Go for PHP if you're building websites for clients.  Go for Python if you're building websites for yourself.
Re: Python Vs Php by SamMilla1(m): 11:18pm On Mar 23, 2009
Without much thinking, i believe php is widely accepted and used more than python.
Maybe python will come up someday with a way to take over the lead but for now,
I wont advice anyone to go through python.
But Like Seun said, Python Could be fun if you are working for yourself.
Re: Python Vs Php by Seun(m): 11:23pm On Mar 23, 2009
Re: Python Vs Php by Nobody: 6:49am On Mar 24, 2009
Interesting talk. . .in fact till now, i havent seen any website developer that uses python.
As a freelancer on the streets of lagos, i always try to master the languages used by most
developers in my environment so that i can sell scripts to them (which is what i do most). . .

Till now, i have never had a request along python. . .but i have been learning it little by little.
But i still believe that for websites, php is better to use. . .and that CherryPy, is it meant to be
a cookie/session replacement stuff?

Which even reminds me sef, there was a crazy technique i learnt to use long ago to replace
cookies / sessions when i first started using perl, i am not sure if it will work well in browsers
these days. . .it has to do with creating my own fake cookies in temporary folders. . .
I only tested it thoroughly with ms windows 2000 then. . .
Re: Python Vs Php by cyberomin(m): 9:40am On Mar 24, 2009
Seun:

With Python you can build web apps, windows GUI apps, command line programs, and even commercial games. With PHP, you can only build web applications, so you have to learn a second language, which sucks.

Go for PHP if you're building websites for clients.  Go for Python if you're building websites for yourself.

Seun i strongly disagree with you in this part, haven't you heard of PHP-Gtk, it's used for windows app, and mind you you can use PHP for the
aforemention things, who knows and even more.

-cyberomin
Re: Python Vs Php by Seun(m): 9:43am On Mar 24, 2009
You're right about PHP-GTK, I guess.
Re: Python Vs Php by OmniPotens(m): 12:32pm On Mar 24, 2009
Does it mean there is just Seun here that loves and uses Python? Are there no more info and contributions coming up from these programming languages?

Re: Python Vs Php by nitation(m): 1:17pm On Mar 24, 2009
@Cyberomin

You beat me to this post. Thank you for pointing that out though. The fact is, python is an "underground P.language"

PHP -r0cks

- nitation
Re: Python Vs Php by Nobody: 6:11pm On Mar 24, 2009
i av never used python to build a web app, but i use it for desktop apps. i use php for web apps, but never used it for desktop apps
so my views about both languages will be limited

Python, the name sounds sexy to me and u feel u are playing with something dangerous, yet, it is simple
no semicolons, forces u to indent ur codes.

You start learning python today, in the 3rd week, you will find urself building complex multithreaded softwares, trust me, it is that simple
I use PyQT mostly for GUIs cos it has this real windows look and feel. and you can switch back to traditional python at anytime in ur code

PHP on the other end needs a closing semicolon at the end of each statement. it is also an easy language like python.
php can be annoying if u av to read codes not indented as opposed to python which naturally is tidy

another thing about python, a non programmer can read a traditional python code and almost tell what it does.
look at the codes below, they do the same thing

PYTHON
f=open("test.txt","w"wink
f.write("this is a test file"wink
f.close()

those lines will create a file named test.txt and put "this is a test file" inside it
In both languages, u create variables on the fly, no need to declare it

php might look somthing like this.

$f=fopen("test.txt","w"wink;
fwrite($f, "this is a test file"wink;
fclose($f);

the dollar sign is one headache on its own, even with that, other languages like asp wont match,
In my ASP days, i remember writing codes getting close to 500 lines, i doubt i ever did that with php

@seun, so with cherrypy, can u use session?

@nitation, i see, u better start explaining
Re: Python Vs Php by yawatide(f): 6:50pm On Mar 24, 2009
Maybe this will help explain a thing or 2?

http://www.davidcramer.net/code/121/php-vs-python.html
Re: Python Vs Php by ztyle(m): 7:09pm On Mar 24, 2009
yawa-ti-de:

Maybe this will help explain a thing or 2?

http://www.davidcramer.net/code/121/php-vs-python.html
. . useful link, well dats said it all, Python Rules! smiley
Re: Python Vs Php by Nobody: 7:46pm On Mar 24, 2009
Read it. . .i have no comment on the article itself. . .except that, having good programming techniques too matter in the final output.
There was a time i was using perl, later asp, later php. . .i do not prefer one to the other, just try to use what
most people are using, so i can flow along.

There will alwayz be new programming languages till we die, and even after that sef, so dont kill yourself trying
to master one all your life, as for me, i have decided to just learn the one(s) in vogue, get my jobs done and move on.

By the way, i still know some few remarkable sites that offer web services and still use perl, many remarkable sites
still use the old asp. . .
Re: Python Vs Php by Nobody: 7:52pm On Mar 24, 2009
well, i think they both rule, each in it's world

@dhtml
sure, it depends on the coder
Re: Python Vs Php by yawatide(f): 8:26pm On Mar 24, 2009
I will use some quotes from a scene in the kung fu movie, "Fearless" to explain my stand. N100 to the person who can correctly guess the scene tongue

Each programming language is just that, a language. It could care less which is better than the other. It is us humans who assign the "good" or "bad" label to things including in this instance, programming languages. Each language has its flaws but it is such flaws that help us as programmers better ourselves.

Make sense? grin
Re: Python Vs Php by Seun(m): 7:33am On Mar 25, 2009
webdezzi:

@seun, so with cherrypy, can u use session?
It supports sessions and cookie manipulation. If you can dig through the wiki documentation, heh.
Re: Python Vs Php by antiguy: 8:28am On Mar 25, 2009
a language is defined by how simply it allows you build complex applications and still retain sanity. if it comes to that, i'd say Python is the "better" language. PHP's biggest "advantage" over Python is that it was designed for the web (sorry, PHP-GTK fanboys). Python was designed as a general-purpose programming language, and people who loved it decided to create frameworks that allow it be used on the web (CGI programming in C, anyone? or you're all too young to know that? grin). Python's syntax is cleaner and messes less with your brain. switching from procedural programming to OOP in Python is a no-brainer, but in PHP, it's horrible. then there's that PHP4/PHP5 backward-compatibility thing to deal with. little wonder most people just stick with procedural programming in PHP. like Seun said, PHP is a "great" language for the web - mostly because it has become so entrenched. use it anywhere else, and you begin to pay a price. i've used an AGI application written in PHP and everytime i try to read the code, it's like: witw??!??!?!? the most important thing is productivity, however. how quickly can you get things done with the tools you use? because a programming language, like Photoshop, the GIMP, Blender, 3ds max and so many other software packages - is merely a tool.
personally, i've found Python more relevant to my work than PHP in the last year or so. i've written a couple of small scripts in Python to accomplish small, important tasks like generate dummy data for me to test database-backed applications with, sort data like Asterisk CDRs. at first i was using C++, but since i started using Python, i've never looked back. decidedly, i've never written a "real" application in Python, but the things i've written in Python i'd be horrified if i was required to write in PHP/C#/C++/C/Java. that's my 2c.
Re: Python Vs Php by Nobody: 5:10pm On Mar 25, 2009
antiguy:

decidedly, i've never written a "real" application in Python, but the things i've written in Python i'd be horrified if i was required to write in PHP/C#/C++/C/Java. that's my 2c.

Try writing a solid app in python using QT, it has over 300 classes and over 6,000 methods, u will love QT

am planning to put up a portable ftp software, so, it will be 5MB in size and can be saved on ur flash.
There will be no need to install it. It will just run straight from ur flash disk. I will create a thread for it very soon
anyone with little or more knowledge of python can join in.
Re: Python Vs Php by OmniPotens(m): 2:39pm On Mar 26, 2009
I think Seun will be a better pal for you on that.
Re: Python Vs Php by cdeveloper(m): 1:53pm On Mar 30, 2009
If comparing PHP and Python is purely based in terms of web development and popularity then i give PHP the lead but when compared in terms of power and capabilities php is not in any where comparable to Python. Just like the name implies, Python is a powerful reptile and the language itself is subtly powerful. Python has always enjoyed a lot of advanced usage beyond simple web page design and it has shown great strength in munching text,glueing other programming languages as well as excel in performing system administration. have you ever wondered what sites like Google,Slasdot, are using? Well Python has been described as a language for prototyping application because of it easy to port to any programming language you can think.
In all i think the quest to find out what language is better off is a futile one rather one should consentrate on learning the strength and weakness of each of then and find out how to better utilize then.
Re: Python Vs Php by OmniPotens(m): 3:00pm On Mar 30, 2009
I think we had better tried a polling system to know the people's choice. Just a few are hitting strong at Python while others like me are going for the PHP. Let's pick at our choice with the poll above.
Re: Python Vs Php by cyberomin(m): 7:33pm On Mar 31, 2009
cdeveloper, what do u think facebook and Yahoo uses.
Re: Python Vs Php by Nobody: 8:59pm On Mar 31, 2009
guys, all these who is using what does not count, i think.

what u use should be based on what u want it for .
who knows, they may use php if they found out that php developers earn, say lesser (i am not saying so) and they feel like saving.

they may use php say they have a ready server for it and have loads of custom php classes from their past works they can use rather than rewrite
they can decide to use python if they realize it will be easier assuming they already have a complex backend software written in python and they feel like using same language online and offline.

many reasons u know! it sounds to me like kiddies talking
imagine me saying, i think php is better cos seun osewa is using it, as far as i see it, we have programmers here who are way better than an average programmer at google or yahoo.

php-gtk as far as i can see many havent tried it here, so u cant say, it is not good for desktops compared to python.
It will definitely do all GTK+ toolkit will let u do
Re: Python Vs Php by uvalued(m): 6:21am On Oct 18, 2016
dhtml18:
Read it. . .i have no comment on the article itself. . .except that, having good programming techniques too matter in the final output.
There was a time i was using perl, later asp, later php. . .i do not prefer one to the other, just try to use what
most people are using, so i can flow along.

There will alwayz be new programming languages till we die, and even after that sef, so dont kill yourself trying
to master one all your life, as for me, i have decided to just learn the one(s) in vogue, get my jobs done and move on.

By the way, i still know some few remarkable sites that offer web services and still use perl, many remarkable sites
still use the old asp. . .
same like me on a low scale now

(1) (Reply)

Why Shared Web Hosting Is Bad For Online Business / Introducing A Free Cheap Vpn Service / Please Rate My Ecommerce Store

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 63
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.