Jump to content



Photo

php or python for web development?


  • Please log in to reply
37 replies to this topic

#16 The_Decryptor

The_Decryptor

    STEAL THE DECLARATION OF INDEPENDENCE

  • Tech Issues Solved: 3
  • Joined: 28-September 02
  • Location: Sol System
  • OS: iSymbian 9.2 SP24.8 Mars Bar

Posted 30 October 2012 - 04:03

PHP only runs in process with the server IF you are using Apache/Mod_PHP,,, otherwise you use PHP-FPM and it really isn't "a fair bit harder" to install or configure...


Yeah, I'm not entirely sure why I said it was hard, I actually have nginx+PHP-FPM setup on this very computer. And I'd say Apache+mod_php is a fairly common setup, every single web host I've ever used has done it that way.


#17 +Majesticmerc

Majesticmerc

    Resident Idealist

  • Tech Issues Solved: 5
  • Joined: 24-August 05
  • Location: United Kingdom
  • OS: Arch Linux / Win 7
  • Phone: HTC One X

Posted 01 November 2012 - 00:34

It's a bit of a tough call. Python is a good language, and infinitely better than PHP (faster too), but PHP is more common, so if you're looking for employability from your skillset, you're more likely to find work in PHP systems than Python systems (although both are pretty common).

Personally, I'd go the Python route. Be sure to check out ASP.NET (C#) and Ruby too, both nice languages and well supported for web development.

#18 n_K

n_K

    Neowinian Senior

  • Tech Issues Solved: 3
  • Joined: 19-March 06
  • Location: here.
  • OS: FreeDOS
  • Phone: Nokia 3315

Posted 01 November 2012 - 12:26

I'd dispute python being faster than PHP. Hiphop is by far the fastest PHP compiler/server, much faster than python, and out of all the world's largest/most visted sites, you've got google running whatever they use, MS using php and ASP.net, facebook using PHP, twitter using... jsp? I've yet to see a large scale site use python.

#19 SPEhosting

SPEhosting

    C++ n00b

  • Tech Issues Solved: 1
  • Joined: 15-July 08
  • Location: my room
  • OS: windows 7, backtrack 5, OSx 10.6

Posted 01 November 2012 - 17:33

my god so many people hate php .... I find it so useful :/

#20 Kami-

Kami-

    ♫ d(-_-)b ♫

  • Tech Issues Solved: 2
  • Joined: 28-July 08
  • Location: SandBox

Posted 01 November 2012 - 17:40

I'd dispute python being faster than PHP. Hiphop is by far the fastest PHP compiler/server, much faster than python, and out of all the world's largest/most visted sites, you've got google running whatever they use, MS using php and ASP.net, facebook using PHP, twitter using... jsp? I've yet to see a large scale site use python.

Last I checked Twitter uses Ruby on Rails for the UI and SCALA for the backend.

#21 threetonesun

threetonesun

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 26-February 02

Posted 01 November 2012 - 17:56

my god so many people hate php .... I find it so useful :/


It's popular to hate on it. There's also a lot of terrible PHP information out there, which propagates bad code. I'm sure if you Google you can find a few thousand guides on how to create a username / password system in PHP that relies on storing information in plain text with out checking for SQL injections.

On the other hand, PHP's documentation is stellar, and it runs basically anywhere.

#22 +astropheed

astropheed

    joO 4R3 73H L337!

  • Tech Issues Solved: 2
  • Joined: 08-December 11
  • Location: Sydney, AU
  • OS: W7, SLES(D)11, VMware, NW6, XP, Mint, Ubuntu11 and sometimes Redhat
  • Phone: Note 3

Posted 01 November 2012 - 21:55

Python Good:
Consistent, more respectable, better language overall and in practice. Teaches better ways to program almost purely by accident. usable outside of web development, decent documentation, excellent community. forced white spacing. Minimal 'boiler plating'. truly object oriented. Easy readability. "Google's language"

Python Bad:
Less documentation, less employable, can be argued that it's slower than PHP with some default configurations, my tests confirm this. Harder to implement on shared servers, even if its supported (which it isn't always). forced white spacing. Versions aren't backwards compatible from 3 to 2 (this can be a small or large issue)

PHP Good:
Huge documentation, easier to use for web development, widely supported, lives nicely side-by-side HTML, much more likely to get you a job, C style syntax is arguably more transferable. Can be very fast (hiphop). "Facebooks language (kind of)"

PHP Bad:
Huge documentation, reputation (which I think is not entirely PHP's fault), terribly inconsistent syntax and naming, many online tutorials teach you a bad way to do many things (which is where reputation gets ruined IMO), objects are a hack. Poor readability.


Overall: Although I'm almost primarily a Python developer, I usually use PHP for web development. It's fast, easy and gets the job done. It can be a little messy, and most 'code' that comes from it is hard to follow because it's all over the place. The choice is almost impossible for me, but I slightly recommend PHP. If you were to ever think about doing programming outside of web development I'd say to go with Python instead.

Hope this helps.

#23 DomZ

DomZ

    Neowinian Senior

  • Joined: 12-October 04
  • Location: Wales, UK
  • OS: OSX
  • Phone: Lumia 1020 / Nexus 4 / iPhone 4

Posted 01 November 2012 - 22:02

I'd say PHP for quick developments and simple projects. If you're just generally looping through results from a database and doing very basic stuff I think it fits the bill. Read the article someone else mentioned about all the language inconsistencies though - the good thing is a quick google for what you are trying to achieve usually yields some results.

Although I've never used Python for web development, you will get the benefits of a cleaner more structured language, compiled code, proper object orientation and unit testing

#24 +Majesticmerc

Majesticmerc

    Resident Idealist

  • Tech Issues Solved: 5
  • Joined: 24-August 05
  • Location: United Kingdom
  • OS: Arch Linux / Win 7
  • Phone: HTC One X

Posted 01 November 2012 - 22:09

I'd dispute python being faster than PHP. Hiphop is by far the fastest PHP compiler/server, much faster than python, and out of all the world's largest/most visted sites, you've got google running whatever they use, MS using php and ASP.net, facebook using PHP, twitter using... jsp? I've yet to see a large scale site use python.


Perhaps my knowledge is out of date then. Last time I checked benchmarks, Python spanked PHP and ruby in speed tests, but checking the interwebs it seems that may no longer be true. Trouble with determining languages used for the web is that it's hard to tell who uses what. I'd assume that Google use a lot of Python though, since the benevolent dictator works there. I had heard that Youtube used it at one point too, although I don't know if it still does.

IIRC, Twitter used to use JSP, but they've moved to Ruby now. I'm keen to start learning RoR, I love Ruby as a language, and it seems to be gaining some serious momentum in web development.

#25 LaP

LaP

    Forget about it

  • Tech Issues Solved: 1
  • Joined: 10-July 06
  • Location: Quebec City, Canada
  • OS: Windows 8.1 Pro Update 1

Posted 02 November 2012 - 01:53

Read the article someone else mentioned about all the language inconsistencies though - the good thing is a quick google for what you are trying to achieve usually yields some results.


A good part of this article has be debunked. I'm too lazy to post link but do a simple google search. Anyone who write such a long blog post to critize a language clearly has an agenda. You know i hate web forms with a passion. I don't waste my time writing a 20 pages blog about it. I just don't use it when i can avoid it.

#26 exotoxic

exotoxic

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 04-April 04
  • Location: England

Posted 02 November 2012 - 02:15

Whatever you chose to go with don't use a framework, take the time to learn and understand the language first. (Y)

#27 +astropheed

astropheed

    joO 4R3 73H L337!

  • Tech Issues Solved: 2
  • Joined: 08-December 11
  • Location: Sydney, AU
  • OS: W7, SLES(D)11, VMware, NW6, XP, Mint, Ubuntu11 and sometimes Redhat
  • Phone: Note 3

Posted 02 November 2012 - 02:17

Whatever you chose to go with don't use a framework, take the time to learn and understand the language first. (Y)


Agreed. You may think it's a good idea, but it will teach you bad (code) manners.

#28 The_Decryptor

The_Decryptor

    STEAL THE DECLARATION OF INDEPENDENCE

  • Tech Issues Solved: 3
  • Joined: 28-September 02
  • Location: Sol System
  • OS: iSymbian 9.2 SP24.8 Mars Bar

Posted 02 November 2012 - 10:57

A good part of this article has be debunked. I'm too lazy to post link but do a simple google search. Anyone who write such a long blog post to critize a language clearly has an agenda. You know i hate web forms with a passion. I don't waste my time writing a 20 pages blog about it. I just don't use it when i can avoid it.


Is it actual debunking or people just disagreeing with the points he raises?

And it's fairly obvious that he has an "agenda" by posting about something, if he didn't care he wouldn't post about it, good or bad.

#29 Haggis

Haggis

    Neowinian Senior

  • Tech Issues Solved: 8
  • Joined: 13-June 07
  • Location: Near Stirling, Scotland
  • OS: Debian 7
  • Phone: Samsung Galaxy S3 LTE (i9305)

Posted 02 November 2012 - 11:14

I self learned php and use it often

It was easy to pick up and as said before there are thousands of examples and tutorials etc online

#30 OP Tech Star

Tech Star

    Neowinian Senior

  • Joined: 24-November 04
  • Location: California, USA

Posted 28 November 2012 - 07:15

Sorry for the late reply, but I wanted to get all my information together before deciding. So I want to thank everyone of you for helping sway me towards the right language.


I decided to learn php. I have been reading there is the "right" way of learning it and the "wrong" way that makes you a bad php programmer. The more I search there is no consensus from people on what to do / what way / what to read to learn php the right way. Can anyone direct me in the right direction?

Thanks. :)



Click here to login or here to register to remove this ad, it's free!