Linked by Thom Holwerda on Sun 30th Sep 2012 20:15 UTC, submitted by MOS6510
General Development "The ObjectScript is a new programing language that mixes benefits of JavaScript, Lua, and PHP. The ObjectScript has syntax from JavaScript, multiple results from Lua, OOP from PHP and much more."
Thread beginning with comment 537126
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: Comment by YEPHENAS
by dikatlon on Mon 1st Oct 2012 07:04 UTC in reply to "Comment by YEPHENAS"
dikatlon
Member since:
2005-07-08

Point me out, please, fellow humans:
Why is PHP so evil?

Reply Parent Score: 2

RE[2]: Comment by YEPHENAS
by intangible on Mon 1st Oct 2012 07:27 in reply to "RE: Comment by YEPHENAS"
intangible Member since:
2005-07-06

Here is a good starting point:
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

I used PHP for years and still use it in some places where it makes sense (it's definitely one of the easiest languages to get working quickly and is super common on vhosts)... It could be worse, but it still pains me often enough :-)

Reply Parent Score: 5

RE[3]: Comment by YEPHENAS
by dikatlon on Mon 1st Oct 2012 07:32 in reply to "RE[2]: Comment by YEPHENAS"
dikatlon Member since:
2005-07-08

Thx man, gonna read it! I have been using PHP from time to time in 6 years.
And I found it useful, but also very difficult to debug, even touh it's an easy way to quick hack an cms of all those frameworks...

Reply Parent Score: 1

RE[3]: Comment by YEPHENAS
by Soulbender on Mon 1st Oct 2012 10:58 in reply to "RE[2]: Comment by YEPHENAS"
Soulbender Member since:
2005-08-18



This +1. It explains pretty much everything that's wrong with PHP, and there's a lot wrong with it.

Reply Parent Score: 2

RE[2]: Comment by YEPHENAS
by lucas_maximus on Mon 1st Oct 2012 08:19 in reply to "RE: Comment by YEPHENAS"
lucas_maximus Member since:
2009-08-18

Lets put it this way, between VB(.NET) and PHP. I will take VB over it anyday.

Reply Parent Score: 2

RE[3]: Comment by YEPHENAS
by Soulbender on Mon 1st Oct 2012 23:52 in reply to "RE[2]: Comment by YEPHENAS"
Soulbender Member since:
2005-08-18

Heck, using .cmd files would be better than using PHP ;)

Reply Parent Score: 2

RE[2]: Comment by YEPHENAS
by Alfman on Mon 1st Oct 2012 08:29 in reply to "RE: Comment by YEPHENAS"
Alfman Member since:
2011-01-28

dikatlon,

"Why is PHP so evil?"

s/evil/bad/

Well, having been a regular user since the beginning, I can say without a doubt PHP is superior in all ways to what it largely replaced: ASP. However that's where my praise ends. The language has suffered from inconsistency and poor SE decision making over the course of it's entire history such that the developer qualifications behind PHP are brought into question. PHP has a history of semantic flip flops creating code incompatibilities.

Ignoring the multitude of teething problems which PHP has been notorious for in the past. Here are current gripes that are often cited (in no particular order):

1. Namespace mess. This is all all the evidence one needs to officially declare the developers as certified amateurs. Also every programmer has their own opinions about whether function names should be camel case, abbreviated, underlined, etc, but at least we agree to pick one convention and stick to it. PHP is the only language I know of where standard functions have completely disregarded any kind of standard naming convention. One has to wonder whether they had any future direction at all.


2. Thread safety risks inhibit web hosts from being able to deploy multi-threaded versions of apache.

http://neosmart.net/blog/2008/dont-believe-the-lies-php-isnt-thread...
(I'd appreciate any information about whether they've finally fixed it, but it was still crashing in 2010/11)


3. Unicode.
I'm often called up by clients who find unicode glitches on a website caused by php bugs in handing unicode characters which may have been posted into the database, etc. I replace unicode characters with html equivalents, but unicode should just work these days.


4. Magic quotes.
Stupid, stupid, stupid, stupid...


5. Lack of session concurrency.
I uncovered this this year when I was trying to use concurrent ajax calls to monitor a long running process. One visitor can only have one running script per session. Apache will pass a predefined number of concurrent connections to PHP, but PHP will block them and run them serially. So, the long running process would block all further PHP pages for this visitor until the long running process was complete. This entirely defeated my intended purpose of employing concurrent ajax calls. I ended up writing a C daemon to work around the limitation.

6. Comparison operators
PHP diverges from other dynamically typed languages to use this proprietary syntax.

if (F(x)) {...}
vs
if (F(x)==true) {...}
vs
if (F(x)===true) {...}

PHP's equality personality disorder is a source of bugs and confusion. To make matters worse, we've got expressions like "x>==0".


7. PHP's documentation
Well, PHP documentation is a big plus. I thought it was superb, or so I did before php.net recently injected google search results ahead of it's own function search listings. Why did they do that?? Now I have to scroll through a screen full of irrelevant google listings before I can click on the php.net links I want.

Reply Parent Score: 5

RE[3]: Comment by YEPHENAS
by dikatlon on Mon 1st Oct 2012 08:35 in reply to "RE[2]: Comment by YEPHENAS"
dikatlon Member since:
2005-07-08

You have enlightend me and brought up a lot of things that I didnt think about, but I know them (just forgot), for example that "===" is certainly a very stupid nonstandard way.

So whats the language I should use then?

Reply Parent Score: 1

RE[3]: Comment by YEPHENAS
by Lennie on Mon 1st Oct 2012 12:15 in reply to "RE[2]: Comment by YEPHENAS"
Lennie Member since:
2007-09-22

5. is depends.

4. is gone in 5.4.

2. that isn't true.

Pretty much every extension that is support on Windows has threading support.

The problem is with all the other extensions which are not supported on Windows.

The cause is 2 fold:
1. the library the extension is using does not support threading
2. on Unix/Linux a large share of Apache users still uses pre-fork of FastCGI. Thus threaded PHP does not gets a lot of testing.

Edited 2012-10-01 12:25 UTC

Reply Parent Score: 3