View Single Post
Old 09-01-2007, 10:16 PM  
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by psili View Post
GA, what scripting language / framework would you use to build a website?
It really depends on the task at hand. I do use and support PHP, but I don't pretend that it always does things intelligently. For instance, PHP uses literals (as does C) for defines, such as:

TRUE = 1
FALSE = 0

This creates problems when it doesn't define (or care) about the data, wether it's a string, or a numeric. For instance: strpos.

If you have:

Code:
$data="hello";
$testfor="h";
$test=strpos($data, $testfor);
echo ($test) ? "'$testfor' found in '$data'.\n" : "'$testfor' not found in '$data'.\n";
It would say 'h' not found in 'hello', because the 'h' is at the beginning, or offset 0, which also means FALSE to PHP.

In C you get around this by declaring data types, but with PHP you have to use the '===' test directive, which is basically a really lame way of saying 'if this literally means the same as that'.

There's plenty of strange things with different functions as libraries, and PHP have grown over the years - sometimes a function is binary safe, so you can pass anything, other times, you can only use strings. It's messy, but it's getting better.
__________________

Last edited by GrouchyAdmin; 09-01-2007 at 10:18 PM.. Reason: Clarification.
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote