IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Righteous PHP rant
http://me.veekun.com...al-of-bad-design/

And, someone actually made the hammer described in the article:

http://www.flickr.co...72157629492908038
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Quite nice. Thanks!
New Very righteous.
I'm glad he said he just wanted to rant at some length.

I remember posting on StatckOverflow a few years ago a rebuttal to a much distilled version of that. My answer boiled down to "nearly everything you're complaining about is just not a day-to-day problem for those using the language".

Wade.
Just Add Story http://justaddstory.wordpress.com/
New "Not a problem" is missing the point.
How long did it take to get to the point where you knew which parts to avoid?

Stepping into that morass as a newbie would be horrifying. The problem is that newbies step into it all the time. I'm currently on a 3 month project to rescue a failed PHP site (yes, I'm replacing it with Django): the pretend simplicity of PHP brings the amateurs like flies on poo, and the end result is a lot of really crap, unsafe code.

And I don't see lack of Unicode support to be "not a day-to-day problem". That's a deal breaker.

And, seriously:
== is useless.
It’s not transitive. "foo" == TRUE, and "foo" == 0… but, of course, TRUE != 0.
== converts to numbers when possible (123 == "123foo"… although "123" != "123foo"), which means it converts to floats when possible. So large hex strings (like, say, password hashes) may occasionally compare true when they’re not. Even JavaScript doesn’t do this.
For the same reason, "6" == " 6", "4.2" == "4.20", and "133" == "0133". But note that 133 != 0133, because 0133 is octal. But "0x10" == "16" and "1e3" == "1000"!
=== compares values and type… except with objects, where === is only true if both operands are actually the same object! For objects, == compares both value (of every attribute) and type, which is what === does for every other type. What.

bigberet:~ anderson$ php -r 'var_dump("61529519452809720693702583126814" == "61529519452809720000000000000000");'
bool(true)


That's messed up. And then looking at how fragile the parser is (references vs. parens, anyone?)... Life is too short for that kind of asshattery in a programming language. I don't care if it's useful after years of monk-like study. Python is useful and consistent after 5 minutes.

There are enough equally productive and simple web development environments out there that no one should seriously be considering PHP in this day and age.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
Expand Edited by malraux Feb. 13, 2013, 11:17:53 PM EST
New No, it's really not.
I don't recall how long it took me to avoid the potholes mentioned. Many of them I never discovered by myself for years. None of them I discovered in my first week of ever using the language.

I do not have a regular, daily or ongoing problem with *anything* in your post. Not string/number comparisons. Not Unicode support. Not integer sizes. None of it. That was *my* point. (Yes, I have code that handles Unicode between browser and database. With zero problems. In the PHP. All our Unicode problems are in Java, believe it or not!)

The bigger problem is not how un-orthogonal and inconsistent it is, but that so many programmers who will never *ever* be more than just barely mediocre are releasing code to the world at large. Which is the sole reason I Will Not Use PEAR: it is a big heap of shite. It's also the reason I dislike most PHP frameworks. The PHP "community" is just not self-policing.

OTOH, I'd love to have a PHP where a lot of that was repaired or discarded. I'm not really that much of a masochist! :-)

Wade.
Just Add Story http://justaddstory.wordpress.com/
New PHP is simply too mental to learn, for me.
I lost interest when my noddy programs were failing because the equality operator is completely and utterly batshit insane.

Python's completely annoying in lots of ways, but at least those lots of ways tend to make sense.
New Yep.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Yes it is. :-)
Because it was my point, not yours. Yours is, "yes it's cack, but I can use it just fine". Good. I'm glad. I don't care, though, because it's still a piece of cack. I'm not trying to convince you to stop using it: you have your reasons. But I am wholly recommending that people don't start using it. Life is too short to work with inferior tools whether they can be used or not.

And I wasn't saying those problems were necessarily affecting you. But they are absolutely, positively indications of the poor quality of PHP overall, whether you can work around the issues or not. The language is a mess.

You're supporting my point by talking about how unorthogonal and inconsistent it is, and how many bad PHP programmers there are, and how poor the community is with respect to quality. Those are all excellent reasons not to use PHP as well.

As far as a repaired and trimmed PHP, it's never going to happen. The attitude of Zend and the enormity of the task are such that PHP is always going to be pear shaped.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New I like pears :-P
--

Drew
New They're quite fine as things to eat, yes.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New I thought I did acknowledge that.
A lot of programming languages are broken, weird, cack, inconsistent, stupid, should-have-been-stillborn for any number of reasons. Many are successful despite these. Sometimes because of these problems. That's not a reason to single out PHP. And I remain unconvinced it's a reason to disrecommend it.

But we can agree to disagree, at least.

Wade.
Just Add Story http://justaddstory.wordpress.com/
New Tail -f the apache log MFer
#1: No one who claims to be a web programmer of any sort should be allowed near the system if he does not understand the intrinsic differences between web server error messages and user generated error message, framework messages, and all the other things that you need to track. That's the 1st thing I do when starting in a new environment, and the preference to NEVER show errors to the web interface.

STDOUT is NOT STDERR, confuse the 2 at your own peril. Each level of abstraction has its own viewpoint of what these mean, and the programmer needs to understand all the levels. All abstractions still resolve to machine code and system calls. Don't want to test for that file open failure? Oh well.

Also, web servers are a shared programming and execution environment. Those core settings need to be set somewhere, and then the individual programmer needs to override them for his own program. Too bad if you don't like it, it needs to be there in several places.

#2: Since C was my baby chick language, the wrappers don't hurt my head. And I understand NJ programming VS perfection, and the tradeoffs that design entailed. Testing the return value was the core difference in programming philosophy that allowed programmers control and allowed the system to be small and fast enough, which allowed unix design to flourish everywhere. This was not a mistake, this was a decision.

#3: The original unix "test" program (aliased to '[') is a command line program used in shell scripting. No concepts of assigning value types on the command line, so programmer had to do something to tell the program which type for logic to use. There are MANY MORE operators to tell it to test things like file size, date, and all kinds of other stuff. I loved that command, and Perl's implementation of it. It became the core '==' vs EQ and all the other test variations, PHP stole it from there. Perl was able to be treated as a replacement for sed and tr and awk by also implementing those test and translation operators, add well the the built in command line desktop calculators. Each of these programs had the possibility for reading hex or octal or decimal or binary STRINGS (you get the point). So perl had to simply read these values and determine if they were just string or a number, on the fly, and "do the right thing". Which is impossible, so the the operators helped it.

You ever to bit twiddling in a "scripting" language fast enough to actually use it a network device driver? And then automate all the production scripts with the same language? hehe. PHP will never be Perl.

#4: When PHP grows up, it wants to be Perl. But Perl was/is an organic language, whipped up by 1 guy as an aggregation of his favorite tools, and it grew from there. And then PHP stole a bunch of stuff from Perl, and hacked it on to its already half-assed implementation, and kept going.

#5: Variables popping into existence when not declared if typed via typo. I FUCKING HATE THAT. THE PERSON WHO MADE THE DECISION TO ALLOW THAT SHOULD BE SHOT (not fatally), DRAWN AND QUARTERED, THEN FED HIS OWN INTESTINES.

Most of his rant is very good, accurate, and one of the reasons I've managed to avoid any serious PHP programming in my career, always offloading to others.

Not worth the stress.
Expand Edited by crazy Feb. 16, 2013, 07:50:40 AM EST
New Jeez.. if physics had settled for such sloppy misuses of
LOGIC: all the early steam engines would have exploded (because Carnot had said, "y'know in an odd dream I had: something called PHP killed off a whole civilization..")
Then he added: this conservation-of-energy stuff is just too hard to do Right; I'm going to practice the cornet, instead.

That youse guys can/have-to juggle idiot-tradeoffs as stupid as (examples given) Daily, causes me to admire a mental stamina I could never have managed. Unless at the point of a gun, maybe.

Given all the aggravations of a liff already rendered often unnecessarily complex, by random gadgetry never ever analyzed First:
for even Likely consequences, like fish-killing plastic-polluted seas and landfills of MTons of serviceable toys regularly junked for 'New',
for endlessly growing mountains of ~permanent stuff ... designed for half lives of 6 mos. to a few years..
(Not to mention dealing with inept PHBs + the constant drag of Redmond's even-worse? LOGIC-light, screwing up other machines..)

It's easy to conclude that yer all Nutz, or soon will be. Has anyone studied the particular stress variant which must derive from using tools that demonstrably Suck?
After all, increasing %pop IS already deteriorated. By much simpler daily obstacles, it seems.

I worry about y'all.

Carrion.
     Righteous PHP rant - (malraux) - (12)
         Quite nice. Thanks! -NT - (hnick)
         Very righteous. - (static) - (9)
             "Not a problem" is missing the point. - (malraux) - (8)
                 No, it's really not. - (static) - (6)
                     PHP is simply too mental to learn, for me. - (pwhysall) - (1)
                         Yep. -NT - (malraux)
                     Yes it is. :-) - (malraux) - (3)
                         I like pears :-P -NT - (drook) - (1)
                             They're quite fine as things to eat, yes. -NT - (malraux)
                         I thought I did acknowledge that. - (static)
                 Tail -f the apache log MFer - (crazy)
         Jeez.. if physics had settled for such sloppy misuses of - (Ashton)

I’d love to have either one win and then lose in a recount. Nice set-up for a faction fight.
68 ms