The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 19, 2019, 05:23:03 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Python Vs PHP - Functionality  (Read 7987 times)
Caligula
Rookie
**
Offline Offline

Posts: 39



View Profile
« on: May 04, 2007, 12:46:33 AM »

Which is the more capable language? I understand that the language must fit the programmers way of thinking, and everyone has their fav, but what I am trying to get at here is the basic raw function of the languages in question.

Which one can do more? Can Python do things PHP can not and vice versa?
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: May 04, 2007, 08:51:51 AM »

Is Python more capable than PHP? Since Python is a programming language that supports both procedural coding and class definitions, and has the option to add all kinds of libraries to do whatever you need to do, and has all the basic program-flow constructs like most other languages, if you take this:

http://en.wikipedia.org/wiki/Python_(programming_language)

and do a search/replace with Python for PHP, you'd be looking at the same document. Well, almost - not quite but almost. A more important question is, is there a library specifically for Python that there is not for PHP that you require for your application? In both languages you can personally build language extensions in C - so it's really a question of which syntax makes more sense to you.

I find the PHP syntax a bit more friendly, but that is 100% personal opinion. The differences seem to be more at the core impetus for the language - but as each has grown they have both become full featured languages that moved away from their niche-y beginnings to the mainstream.

IMO I do not see a clear benefit of one over the other except in libraries and current knowledge. If you already know PHP, the only benefit to Python is personal growth and the possibility for work - woth of which are really valid, but don't necessarily increase your income *today* ...

/p
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Caligula
Rookie
**
Offline Offline

Posts: 39



View Profile
« Reply #2 on: May 04, 2007, 04:50:40 PM »

See thats what I was trying to get at.. does one have an advantage over the other... I want to learn both anyway, the more I know the better, but for the time being I am just   checking to see if maybe there is another language that can do what I need but have a more friendly syntax that goes along with my coding style.
Logged
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #3 on: May 04, 2007, 05:30:51 PM »

Quote
I find the PHP syntax a bit more friendly, but that is 100% personal opinion. The differences seem to be more at the core impetus for the language - but as each has grown they have both become full featured languages that moved away from their niche-y beginnings to the mainstream.
For a person coming from a C/C++/java/C# background probably 100% true. PHP syntax purposely made to mimic it Smiley

The inventor of python, first invented a "training language" called ABC.
From the mistakes problems in ABC he went on to make python.

One of the quirks of python is using indentation as a form of syntax.
This is one thing that pisses C/C++ guys off.
Ironically it forces you to make sure that all of your commands can fit on one line.
Also it makes your code look neat and tidy Smiley.
As u move on to other languages u will be a "neat freak"

In another thread it was stated that PHP has much larger following then python.
In the webworld this is true.
But how many full scale applications have been written in PHP ?
Anything from a complete email client suite with gui to NASA uses python for full scale apps.
Part of the bad rep that PHP suffered until recently has come from week-end coders throwing together stuff.
At one time PHP had a rep as being an insecure language, this was because of crappy coders not the language.
Anyway not 100% to compare the 2 directly.

Quote
IMO I do not see a clear benefit of one over the other except in libraries and current knowledge. If you already know PHP, the only benefit to Python is personal growth and the possibility for work - woth of which are really valid, but don't necessarily increase your income *today* ...
Ultimately that sums it up.
Irronically when i learned python, PHP barely existed, python at this time was already established and had a true OO system unlike perl which was an after thought.

At the time (python had just gone to version 1.5). All the arguments you hear against language X today where against python. It is a new language, no one is using it. Who knows where it will be in 10 years all that rubbish.
At the time I was a C/C++ programmer just out of college.
Anyway i was approached by 6 contractors they needed a huge database, one that spanned 100-200 tables (It had to be split into this many tables because of speed issues) contained over 20K entries and had to be updated daily with 2k+ entries being either updated, deleted, added etc.
From this database it would generate billings, orders etc.
Also this had to all run on a 586 pentium and be completed in 2 months.

A professional development company wanted them to put up $50K upfront with no product, for a VB solution.

Anyway me being an arrogant asshole told them give me 1 week, i will show u a prototype then we will talk. I had no idea what to so. I knew if i use C/C++,Delphi etc it would be 100k plus lines of code.

So i searched on the net, i found python and wxpython gui. Using 10 lines of code i could make an interface that would be 100 line of code in delphi.
Also u did not need to compile. Time that is lost in the compile cycle is lost.

Anyway in a week i make prototype/mockup (and learn python at same time Smiley).  I call all the contractors together.
I show them my proggie, (It is all point and click these guys are savy buisnessmen, but they are not puter experts).
I tell them what will take u 20 hours to do manually my system u can do in 2 hours. How much ur time worth ?
I wanted to force the deal. I tell them you have 24 hours for each of u to give me a cheque for $500, if you agree.
Then for 2 years you will pay me every month $100-200 per month for use of my proggie.  Devilish
4 of them on the spot pulled out thier cheque books. 2 of them within 24 hours send me cheque.

In 2 months i constructed the proggie it use 10-15k lines of python code.
Also because of the nature of python when crashes/errors occurred i could very quickly go in an fix the error without recompiling.

At the time i do not even think there was a book in print for python.
(Even if there was, this before days of amazon, would be impossible for me to get).
I make many mistake later on, but they where not programming mistake but buisness mistake Cheesy

Anyway point behind my story is don't choose a language just because "experts" say it good.
Or it popular or some shit like that.
Also don't sell urself short. I hate people who say that not possible.
Or they sugar coat it. "ohhh i am just being realistic".
No that just justification for being a failure.
Ironically most of my life i have been called smart, i am not smart. I suspect that in many area i have
learning problem (i am not saying this for sympathy or crap like that). Never sell urself short Smiley.

Anyway i kinda got sidetracked Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!