• Rob's side project: I recently started Gun-Forums.com and we currently have a $100 raffle - if you're into guns, join up and enter the raffle to win $100.00. Gun Forums

Language A vs. Language B

carlarogers

New Member
Over the last several years, I have noticed some programming languages are safer than others when it comes to expressing opinions. I think everyone knows Python is superior to php for example. I am looking for help seeing the plain truth of this, as opposed to taking someone's word for it. I have programmed in Python and djamgo, but not nearly as much as php. I did not see a meaningful difference between the two. I am not going to argue that php is better. I only want to understand the reasons that people have for determining Python is better or visa versa. I am going confess to some skepticism and then do my best to leave it out of the rest of this thread. My skepticsm tells me it is possible the pereceived suporiority of one language over another is based on narrow experience and perceived popularity, not technical considerations. I hope my skepticism is unfounded. I also hope no one finds a need to communicate as if I am stupid, fire snarks, or insults Tough arguments are great when respect is shown. I am not interersted harboring false information or opinions. I love finding out where I am wrong, because I know I am wrong a lot an correction is the only method for improving that.

My problem is I am unable to see for myself the superiority of Python over php. This morning, I took a few minutes to read some articles explaining the difference. That did not help. Here is an example:

Python is a high level object-oriented, programming language. It has built-in data structures, combined with dynamic typing & binding which makes it an ideal choice for rapid application development. Python also offers support for modules and packages, which allows system modularity and code reuse.

It is one of the fastest programming languages as it requires very few lines of code. Its emphasis is on readability and simplicity, which make it a great choice for beginners.
I have two problems with that quote:
  1. As far as I can tell, the word PHP could replace every spot where Python appears, and it I would not able to say which version of the is more true, the one touting Python or the one touting php. As far as I know, nothing in that quote does not apply strongly to php. Exception: I can see that some programming tasks might be easier and faster with python data structures. Given my workload, I can see saving an hour or two every few years as result of python data structuresl
  2. I was thinking side-by-side comparisons of programs doing the same tasks in different languages would make it easier to understand the advantages of Python. I admit, I tried only made a few search attempts to find samples. I did find any reference to comparisons like that.
Can you shed light on this?
 


captain-sensible

Well-Known Member
I guess there are two things here comparison of both used for the web.then from the angle what can both do if it's not for the web.the succinct answer for PHP is next to nothing.whereas with python you can do a lot.all my web stuff is PHP.i did though once write a small ap in python for Android phones using Kivu.its still on amazon
 

JasKinasis

Well-Known Member
Both are great languages to develop server-side, web-based applications with.

Both are mature and well documented. There are lots of different libraries and application frameworks available for them.

PHP's syntax is closer to something like C. It is a very low-level language. And it is extremely easy to end up with a horrible, messy, buggy codebase - which is why php gets a bad rap sometimes.

Whereas syntactically speaking, Python is a slightly higher level programming language. Python is a much more expressive language than php. The code looks a bit more like natural language. You can implement a lot of powerful functionality in very few lines of code. And the same can be said for Ruby!

I wouldn't say that one is necessarily better than the other - both languages are useful tools that have been used to create a lot of useful applications. Both have their own advantages and disadvantages, but it's entirely down to you to decide which is best to learn and use for your projects.

As a primarily C and C++ programmer, I found PHP quite easy and intuitive to learn. However, I do prefer Python or Ruby to PHP, purely because their syntax is more expressive and less verbose. But that's just me!
Also, python is great for client-side/desktop applications too!

This link has a pretty well written comparison between the two languages:
 

carlarogers

New Member
Both are great languages to develop server-side, web-based applications with.

Both are mature and well documented. There are lots of different libraries and application frameworks available for them.

PHP's syntax is closer to something like C. It is a very low-level language. And it is extremely easy to end up with a horrible, messy, buggy codebase - which is why php gets a bad rap sometimes.

Whereas syntactically speaking, Python is a slightly higher level programming language. Python is a much more expressive language than php. The code looks a bit more like natural language. You can implement a lot of powerful functionality in very few lines of code. And the same can be said for Ruby!

I wouldn't say that one is necessarily better than the other - both languages are useful tools that have been used to create a lot of useful applications. Both have their own advantages and disadvantages, but it's entirely down to you to decide which is best to learn and use for your projects.

As a primarily C and C++ programmer, I found PHP quite easy and intuitive to learn. However, I do prefer Python or Ruby to PHP, purely because their syntax is more expressive and less verbose. But that's just me!
Also, python is great for client-side/desktop applications too!

This link has a pretty well written comparison between the two languages:
Thank you for taking time to explain. Can you think of an example of how python is more expressive or less verbose?
 

carlarogers

New Member
Simple question, Pyhton is dynamic where PHP is not :cool:
I have read ten articles in the last three days explaining the difference between PHP and Python. Not less than half said python dynamic compared to php. I don't know what that means.

The main meaningful difference I know about is python is better adapted to non-webserver requirements, because it runs on a vm that provides app experience, whereas php running as a client app is going to confine your app to running in a browser window, which might light some people up, but would be weird to plenty.

I think that means if you want to make an app to run on a Linux desktop, Python can do that Probably same for Windows app. If you are making a web server Php has home field advantage.
 


Members online


Latest posts

Top