New Posts  All Forums:Forum Nav:

Python or PHP - Page 6

post #51 of 58
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.

post #52 of 58
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?
buka
(17 items)
 
  
Reply
buka
(17 items)
 
  
Reply
post #53 of 58
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.

post #54 of 58
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.
stuff
(7 items)
 
  
CPUMotherboardGraphicsRAM
4790k gigabyte z97x-ud5h gtx 980ti ddr3 
Hard DriveOSMonitor
samsung evo 840 coolermaster hyper 212 evo windows 8.1 64bit 
  hide details  
Reply
stuff
(7 items)
 
  
CPUMotherboardGraphicsRAM
4790k gigabyte z97x-ud5h gtx 980ti ddr3 
Hard DriveOSMonitor
samsung evo 840 coolermaster hyper 212 evo windows 8.1 64bit 
  hide details  
Reply
post #55 of 58
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
post #56 of 58
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
stuff
(7 items)
 
  
CPUMotherboardGraphicsRAM
4790k gigabyte z97x-ud5h gtx 980ti ddr3 
Hard DriveOSMonitor
samsung evo 840 coolermaster hyper 212 evo windows 8.1 64bit 
  hide details  
Reply
stuff
(7 items)
 
  
CPUMotherboardGraphicsRAM
4790k gigabyte z97x-ud5h gtx 980ti ddr3 
Hard DriveOSMonitor
samsung evo 840 coolermaster hyper 212 evo windows 8.1 64bit 
  hide details  
Reply
post #57 of 58
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.
post #58 of 58
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
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming