Python or PHP - Page 6 - Overclock.net - An Overclocking Community
Forum Jump: 

Python or PHP

Reply
 
Thread Tools
post #51 of 58 (permalink) Old 07-31-2013, 08:06 PM
New to Overclock.net
 
hajile's Avatar
 
Join Date: Jun 2008
Location: United States
Posts: 1,593
Rep: 278 (Unique: 214)
Quote:
Originally Posted by poroboszcz View Post


Ok, so that may somewhat explain PHP's popularity for small to mid-sized projects, but it's also being used by most of the major websites like Facebook, Yahoo, Wordpress, Wikipedia, Apple, Flickr and many more. They clearly have the resources to use whatever technologies they want. Python, while being used by Google and Youtube, is still much less popular.

The problem with most of those projects is inertia. They started when PHP was the thing and most frameworks were poor quality or non-existent (in the case of yahoo, wikipedia and apple) or were started by people without the industry experience to know that better languages and frameworks (wordpress and facebook in your example).
 For these companies, rewriting millions of lines of code isn't possible (in the case of Facebook, it was easier to write several million lines of code for a new PHP interpreter than it was to recode in a better, faster language).

 

A note on hip-hop (Facebook's php VM). It's very close to an attempt at making V8 for PHP (last time I looked, which was a while ago). PHP's type coercion and lack of real data structures matches very closely to javascript and is the antithesis of good performance. Hip-hop attempts to map these pseudo-structures into real, computer-usable structures and then JIT optimizations. For example, "arrays" in PHP can have any combination of strings, integers, and floats. To anyone who understands low-level datatypes it is apparent both that these types are different and that one of them (strings) isn't actually a type (for those who don't know, they're arrays of characters where the characters are simply unsigned integers with a specific coded interpretation). In order for V8 (or hip-hop) to make any real arrays from the data, it must be of the same basic type which can then be converted to a real array. Since this limitation doesn't exist in PHP, the programmers must be taught that this is what must be done and then must ALWAYS adhere to this (additionally, they must ensure that the arrays NEVER accidentally add data of the wrong type). ASM.js is a Firefox example where even more freedom is given up and even more convention must be established for greater performance. There's no free lunch in programming.

hajile is offline  
Sponsored Links
Advertisement
 
post #52 of 58 (permalink) Old 07-31-2013, 08:48 PM
New to Overclock.net
 
poroboszcz's Avatar
 
Join Date: May 2008
Location: UK
Posts: 1,602
Rep: 108 (Unique: 75)
After reading around for a while it looks like I've been in the stone age when it comes to web development. You don't even need to know SQL these days to create database driven apps! I'm really impressed.

Having looked at several frameworks I actually can't see a reason to not go with python. Anyone here has some experience with Django vs Pyramid vs Turbogears 2?

Currently playing: Civ 6, Gwent

Fractal Design Define R2 case review
poroboszcz is offline  
post #53 of 58 (permalink) Old 07-31-2013, 08:58 PM
New to Overclock.net
 
hajile's Avatar
 
Join Date: Jun 2008
Location: United States
Posts: 1,593
Rep: 278 (Unique: 214)
Quote:
Originally Posted by poroboszcz View Post

After reading around for a while it looks like I've been in the stone age when it comes to web development. You don't even need to know SQL these days to create database driven apps! I'm really impressed.

Having looked at several frameworks I actually can't see a reason to not go with python. Anyone here has some experience with Django vs Pyramid vs Turbogears 2?

Out of those, just go with django as the support's better. I recommend taking a look at flask instead.

hajile is offline  
Sponsored Links
Advertisement
 
post #54 of 58 (permalink) Old 07-31-2013, 09:18 PM
New to Overclock.net
 
biz1's Avatar
 
Join Date: May 2013
Posts: 246
Rep: 8 (Unique: 8)
Quote:
Originally Posted by Plan9 View Post

@biz1

Your points are all over the place (eg your comments about comcompiling) largely over romantisised (eg arguing that writing your own replacements for core PHP functions is practical) and in places down right wrong (eg C++ being a rigid language).

However its become quite clear that we're never going to see eye to eye so I'm not going risk dragging this discussion out any longer (plus things are still friendly at the moment and I don't really want to start an argument). However you never did answer my question; what other languages are you proficient in? It seems to me that you only know PHP, which is absolutely fine. I'm not in any way elitest about the languages people learn or how many they can code in. But it might explain some of the bias you have towards PHP (generally I find the biggest proponents for PHP are those who've never used Rails, modern Perl frameworks and such like)

I have done enough in C/Java/Python/PHP/C++/Ruby...

Ruby is linguistically sound... I just don't recommend it to veteran programmers because of the syntax.

Languages are just tools to accomplish tasks. I judge them based on how good they are at accomplishing them.

The core is really just good object-oriented programming which will look similar in almost any language, but PHP has things which make it a lot more productive. I find PHPs linguistic quirks to be solvable, whereas other languages' productivity issues are not.

biz1 is offline  
post #55 of 58 (permalink) Old 08-01-2013, 02:20 AM
New to Overclock.net
 
Plan9's Avatar
 
Join Date: Nov 2011
Location: Planet Vegeta
Posts: 8,040
Rep: 574 (Unique: 277)
Quote:
Originally Posted by biz1 View Post

I have done enough in C/Java/Python/PHP/C++/Ruby...
ahh fair enough. Sorry for the judgement earlier smile.gif
Quote:
Originally Posted by biz1 View Post

Ruby is linguistically sound... I just don't recommend it to veteran programmers because of the syntax.
Just out of interest, why is that? I've not had much exposure of Ruby before this thread so interested in hearing others experiences.
Quote:
Originally Posted by biz1 View Post

Languages are just tools to accomplish tasks. I judge them based on how good they are at accomplishing them.
Couldn't agree with you more there smile.gif
Quote:
Originally Posted by biz1 View Post

The core is really just good object-oriented programming which will look similar in almost any language, but PHP has things which make it a lot more productive. I find PHPs linguistic quirks to be solvable, whereas other languages' productivity issues are not.
While we're going to have to agree to disagree on PHP specifically, I do whole heartedly agree with your sentiment about picking a language based on what productivity and your points in the past about how development time is often more important than execution time (obviously to a point - with all things there's a balance and occasions when other criteria become a bigger priority). smile.gif
Plan9 is offline  
post #56 of 58 (permalink) Old 08-01-2013, 11:23 AM
New to Overclock.net
 
biz1's Avatar
 
Join Date: May 2013
Posts: 246
Rep: 8 (Unique: 8)
Quote:
Originally Posted by Plan9 View Post

Quote:
Originally Posted by biz1 View Post

Ruby is linguistically sound... I just don't recommend it to veteran programmers because of the syntax.
Just out of interest, why is that? I've not had much exposure of Ruby before this thread so interested in hearing others experiences.

the "Ruby way" of doing basic flow control and loops is different from older languages
It is generally "better" as it can more closely model the flow of data

just depends what you are used to. hard to explain the syntax differences... just look at code examples i guess

biz1 is offline  
post #57 of 58 (permalink) Old 08-01-2013, 03:27 PM
New to Overclock.net
 
Join Date: Oct 2008
Posts: 1,808
Rep: 120 (Unique: 113)
Quote:
Originally Posted by Plan9 View Post

mod_perl is a complete nightmare to set up because good mod_perl code isn't all that portable (ie you have bespoke vhost configs and apache handlers).
I see. I've only set it up for simple stuff and never had to port it, so I haven't had any issues.
MakubeX is offline  
post #58 of 58 (permalink) Old 08-02-2013, 02:37 AM
New to Overclock.net
 
Plan9's Avatar
 
Join Date: Nov 2011
Location: Planet Vegeta
Posts: 8,040
Rep: 574 (Unique: 277)
Quote:
Originally Posted by biz1 View Post

the "Ruby way" of doing basic flow control and loops is different from older languages
It is generally "better" as it can more closely model the flow of data

just depends what you are used to. hard to explain the syntax differences... just look at code examples i guess
I had done before and it just looked like the standard imperative OOP paradigm with a mixture of Perl and ALGOL-like syntax. The biggest difference I noticed was how variables and constants can be used as objects (eg "hello world".method)
Quote:
Originally Posted by MakubeX View Post

I see. I've only set it up for simple stuff and never had to port it, so I haven't had any issues.
You're not going to see a great performance boost from mod_perl from just doing simple stuff. mod_perl really comes into it's own when you're using an all PM interface with custom handlers in place of CGI and mod_perl's Apache libraries (which are written in C++ as opposed to the standard CGI Perl modules which are written in Perl so run slower and consume more RAM per Apache child).

Optimizing mod_perl infrastructures is a job in itself frown.gif
Plan9 is offline  
Reply

Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the Overclock.net - An Overclocking Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
If you do not want to register, fill this field only and the name will be used as user name for your post.
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off