1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP vs Python

Discussion in 'Programming' started by EpicDesignGuy, Mar 2, 2013.

  1. #1
    i remember seeing somewhere that Python was kinda like the next stage of PHP but when i tried to learn it my mind was blown. Im looking to learn a programming language between these two so i was wondering is there a definite better one? or are they both for separate things?
     
    Solved! View solution.
    EpicDesignGuy, Mar 2, 2013 IP
  2. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #2
    I prefer PHP, for the sole reason I can't get used to the bracketless syntax (and haven't tried too hard). Which is strange considering the first languages I learned were VB6 and Ruby for RPG Maker - both bracketless languages.

    Python can also more easily be used for a wider variety of applications - desktop, web etc and there is even an implementation for .NET programming on Windows, though it doesn't see much use.

    PHP is easy to learn, use and for web applications will do everything that Python can. Plus its better documented and so very widely supported.
     
    blueparukia, Mar 2, 2013 IP
  3. #3
    The choice of language mostly depends on the purpose for which you will be using it. Some languages are better suited for some specialized purposes than other.

    Both PHP & Python are popular languages. If you are new to programming and you are asking for the easiest to learn among two of the languages, then i will say, both are easy to learn. I am not sure, but you might find learning Python a bit more easy though, if you are fine with indentation based syntax. Python codes are readable and syntax will feel like plain English than many of other languages. In python you use indentation instead of curly braces to define code block. On the other hand, if you have programmed with C like languages, then you will feel comfortable with PHP, because many of the PHP's syntax is borrowed from C and Java (specially OOP features).

    Both PHP & Python are scripting languages. Python is strictly Object Oriented, strictly typed and also dynamic language. On the other hand, PHP allows you to code in both procedural style and object oriented style, in fact many of the code you will find are written in procedural style, because it is the easiest way to get something done quickly, which turns out not bad every time, but for bigger projects, its become sometimes a great pain if the code is not written in proper way. In fact, one of the biggest complain about PHP is it's forgiveness about poorly written code, and thus a huge number of developers don't maintain coding convention and produce bad code. PHP is also loosely typed and dynamic. But if coding convention is maintained, then you can produce quality code.

    Python is a general purpose language, but PHP is specialized for web purposes. But python is also popular among web developers, the Django framework is one of the most popular web framework.

    Hope it gives you some idea, if you can ask some specific questions, then i will be happy to answer, i have been using both for many years.
     
    atik, Mar 2, 2013 IP
    bledian93 likes this.
  4. Siegfried

    Siegfried Greenhorn

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    Python is not next stage of PHP, just take a look at their syntax. If you learn PHP then you can easily (well, to the degree) program in all C-like languages like C/C++/C#/Java, even in Javacript
    it is not true for python
    best regards
     
    Siegfried, Mar 4, 2013 IP
  5. BradsFX

    BradsFX Active Member

    Messages:
    92
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    Digital Goods:
    2
    #5
    Like the post above, python is not a next version of php nor shall it be, python is used for robotics if I'm correct, where as PHP is for server side.
     
    BradsFX, Mar 4, 2013 IP
  6. f1ndm3h

    f1ndm3h Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #6
    Except from their syntax stuff, both languages are strong scripting languages. PHP is more known for web-development and has been used a lot over the years. On the other side, Python is so powerful language with a great community's support. You can do almost anything and you can find almost anything that you need. I would definitely go with python, even if its web-syntax and modules may seem weird in the begin.

    Also, php has been blamed for having lots of disadvantages on serious web development, I am not sure for that though.

    Currently, I am using both but I would rather doing everything in Python.
     
    f1ndm3h, Mar 20, 2013 IP
  7. VanessaMeacham

    VanessaMeacham Member

    Messages:
    112
    Likes Received:
    0
    Best Answers:
    3
    Trophy Points:
    36
    #7
    HI ! PHP is a language that's made for the web. You can make GTK and CLI applications with PHP, but it's mainly used for websites. Python is used for a lot of stuff like websites, webservers, game frameworks, desktop and CLI application, IDEs and a lot more.

    There's also a huge difference in the syntax. PHP has a syntax that's like C with curly braces for loops and whitespace is ignored. Python doesn't have curly braces, instead the level of indention of blocks of code are important.
    Both languages are easy to learn. It just depends on what you want to do.
     
    VanessaMeacham, Mar 21, 2013 IP
  8. robzdc

    robzdc Greenhorn

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    11
    #8
    I work as PHP Dev, but I like Ruby( with Rails), I have interest in Python ( with Django) but havnt had the time to learn it.
    Python is a great language, I think people would consider it better than PHP.
     
    robzdc, Mar 21, 2013 IP
  9. rypher21

    rypher21 Active Member

    Messages:
    914
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #9
    PHP is easier to learn than Python, I think. In addition to that, PHP is widely used for web programming which is what the industry needs nowadays. But as I've experienced, Python is a cute language. It's like Java which is object-oriented. I so like the turtles in Python.
     
    rypher21, Apr 23, 2013 IP
  10. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #10
    They use turtles in python now? Back in my day that was LOGO thing.
     
    blueparukia, Apr 23, 2013 IP
  11. rudrawadi

    rudrawadi Greenhorn

    Messages:
    22
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    13
    #11
    Python and PHP are bit different, PHP is web programming language where as with python you can develop webs, computer apps and even mobile apps for android. Well, php is very largely supported for web development but python is much use in computer app programming
     
    rudrawadi, Apr 24, 2013 IP
  12. caesar15

    caesar15 Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #12
    I would recommend you to go with python. It is better than PHP. Trust me. I experienced it. Python is faster than PHP and also it support re usability of codes. Recently I have read an article "How does a Python web development overcomes the PHP". Go through the article you'll get a better idea.

    Article: http://storify.com/rokesh/how-a-python-web-development-does-overcomes-the-ph
     
    caesar15, Nov 16, 2013 IP
  13. FCM

    FCM Well-Known Member

    Messages:
    669
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    155
    #13
    I actually made the switch from PHP to Python and I must say I love it, although it was a little bit hard to grasp as it most things at first, I quickly learnt
    and the transitions was actually smooth - I've been programming in python for about a year now, and I had about 4-5 years of experience with
    PHP so I must say it was rather easy with knowing logic as it is some what similar with a few exceptions. Most people don't like the fact that you have to indent your code i actually like it it helps keep the code clean.

    Look up hacked existence on Youtube django tutorials.
     
    FCM, Nov 18, 2013 IP
  14. Luca tall

    Luca tall Member

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #14
    I think both are good for web development. I have experience in PHP which is a server side language to develop web application.
    But Python is used for both web and desktop applications. Its also available on windows is added advantages.
     
    Luca tall, Dec 3, 2013 IP
  15. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #15
    While I don't argue that Python might be faster and "better" than PHP in a lot of cases, the article you linked to is a joke. It's not "discussing" anything, it's plainly pumping Python for everything, without looking at pros and cons, and the language is abysmally bad. I'm pretty sure there are a LOT better comparisons between Python and PHP out there, in actual English, instead of ... whatever that was.
     
    PoPSiCLe, Dec 3, 2013 IP
  16. SarahCollins

    SarahCollins Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #16
    I think the comparing of languages are not good because every language has its own positives and negatives also. So when comparing with php and others, php is very simple and just like c and cpp languages so even a laymen can work with php... i think its is very best...
     
    SarahCollins, Dec 6, 2013 IP
  17. ByteCoder

    ByteCoder Active Member

    Messages:
    239
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    65
    #17
    like sarah said - each of them has a different goal.
    PHP is preferred for web-server programming and Python is preferred for fast fixes, calculations, fast development (or PoC) etc.
     
    ByteCoder, Dec 6, 2013 IP
  18. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #18
    I think you mean pimping... though what you said is kinda funny.

    It does kinda read like a discussion between Yoda and Zathras...hell I've seen Google translate make less of a mess than that! ...and yeah, once you get past the broken moist goodry Engrish, it literally doesn't actually seem to say anything meaningful, and is instead doped to the gills with glittering generalities and card stacking... many of it's "Features of Python" also being true of PHP... It's like saying "Elect Harper, a real American" -- what makes Harper a real American? Born here, raised here, pays taxes -- same could be said for who he's running against. It's not a feature when everyone else has it too...

    I just don't get the appeal of Python... at all. while I'm a stickler for good indentation habits and as such should like formatting controlling flow, the entire language to me feels like the WORST of dead languages from the '70's and '80's -- like Fortran, line-numbered BASIC or even Prolog. The inclusion of an immediate mode reeks of ROM BASIC, the lack of assignment operators reeks of stack-style FORTRAN crap everyone hated 30 years ago, and it's vague flow control / logic reminds me of everything that was wrong with Prolog... and that's before talking about how anything written in it looks like the programming equivalent of 1337. It is needlessly and pointlessly cryptic for no reason I can fathom apart from wanting to appeal to the "WAH, WAH, WAH, I DON'T WANNA TYPE" wankers.

    Probably why the Raspberry Pi community and I got along like sodium and water... I can't believe they call that cryptic, "designed to make you make errors" language "ideal for beginners" -- ON WHAT PLANET!?!

    Though it could be worse, could be RUST -- the programming language for people who can't be bothered to type 'function' or 'else if' while at the same time want to drag 'LET' back from the dark ages of computing -- all while thinking C++ is a little too cryptic for it's own good; which is akin to saying the Spanish Inquisition and Nazi Holocaust is a little too warm and fuzzy for one's tastes. After some 35 years of programming languages like RUST and Python -- which make hand compiling machine language seem simple, clear and verbose -- just don't make any sense to me; I fail to see the appeal.

    But what do I know? I'm one of those Wirth language nutters.
     
    deathshadow, Dec 6, 2013 IP
  19. ByteCoder

    ByteCoder Active Member

    Messages:
    239
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    65
    #19
    @deathshadow -
    Wow. NEVER seen ANYONE crying THAT MUCH because of Python / RUST / even hand-programming machines..
    You took it way too far man. Maybe you should see someone!
     
    Last edited: Dec 6, 2013
    ByteCoder, Dec 6, 2013 IP
  20. FCM

    FCM Well-Known Member

    Messages:
    669
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    155
    #20
    @deathshadow - you have the worst analogy I have ever read in my entire life, it honestly made my head hurt.
     
    FCM, Dec 6, 2013 IP