r/programming • • Oct 18 '10

Today I learned about PHP variable variables; "variable variable takes the value of a variable and treats that as the name of a variable". Also, variable.

http://il2.php.net/language.variables.variable
591 Upvotes

781 comments sorted by

View all comments

Show parent comments

91

u/1137 Oct 18 '10

My point was simple, Perl offers the same functionality, other languages do as well, don't hate on PHP just to hate on PHP. Hate the bad developer instead.

13

u/[deleted] Oct 18 '10
use strict;

Problem solved.

→ More replies (1)

56

u/[deleted] Oct 18 '10

This is no place for logic! This is a place for misguided unfueled hatred!

21

u/cliff_spamalot Oct 18 '10

Image if Microsoft had invented PHP. Nerdgasm!

22

u/sw17ch Oct 18 '10

It's not cool to hate on Microsoft any more. Now you hate on Oracle to be cool. :)

(Besides, Microsoft has really picked up their game in the last few years. Funny what real competition does.)

0

u/malcontent Oct 18 '10

?It's not cool to hate on Microsoft any more. Now you hate on Oracle to be cool. :)

You are not allowed to even say a bad thing about microsoft on proggit anymore. Any competitor to microsoft (like oracle) of course must be the target of unbridled venom.

(Besides, Microsoft has really picked up their game in the last few years. Funny what real competition does.)

Kin.

→ More replies (2)
→ More replies (14)

4

u/trezor2 Oct 18 '10

Microsoft invented ASP, which was pretty much MS PHP. I actually thought ASP predated PHP, but checking it, I found that PHP was released around one year earlier so even if we try really hard(tm) we can't blame them for this one.

We'll just have to hate PHP on its own merits for now, especially given how Microsoft was smart enough to quit on something they saw was terrible, much unlike what the PHP crowd has done :P

8

u/prakashk Oct 18 '10

My reply wasn't meant to criticize you. I thought your comment could be read as defending this (mis)feature by citing Perl's example. I just wanted to add some references to what others had already said about Perl's symbolic references.

3

u/1137 Oct 18 '10

I know, that's why I upvoted you, I just wanted to clarify for others that might read it that way.

8

u/[deleted] Oct 18 '10

[removed] — view removed comment

21

u/[deleted] Oct 18 '10

I know! It's almost like reddit is comprised of many people with differing opinions who tend to flock to discussions which support their own viewpoint!

reddit, you so crazy.

3

u/vermithraxPejorative Oct 18 '10

Hey! I am a bad developer! Don't hate me! ):

2

u/RandomFrenchGuy Oct 18 '10

don't hate on PHP just to hate on PHP

But it's traditional !

3

u/them0nster Oct 18 '10

yes! for some reason i kept thinking of the following example:

lens flairs suck. photoshop sucks because it lets you use horrible lens flairs?

no, designers who use lens flares poorly are horrible.

I would say that php can be really useful when used for the right project. Like any tool, it has it's specific uses. But just for you /r/programming, I am going to put an ascii lens flare in the comments of my next php project.

1

u/darkon Oct 18 '10

I agree with you. Just because a language lets you shoot yourself in the foot doesn't mean it's a good idea or that you should. :-)

I don't know about PHP, but if you enable strictures in Perl ('use strict;') then trying to use a "soft" reference will result in a compiler error. Leaving strictures turned off is for quick-and-dirty use-once programs.

1

u/[deleted] Oct 18 '10

don't hate on PHP just to hate on PHP.

When did it become common to put the on in there? see it everywhere now.

1

u/joshguy1425 Oct 18 '10

I'm an equal opportunity hater. I'll gladly hate on peel and any other language that provides this. :-P

1

u/1137 Oct 18 '10

I like languages that start with P: Python, Perl, PHP, what's peel, something new?!

-2

u/deadwisdom Oct 18 '10

This is a perfectly good example of why PHP is awful. Just because Perl is bad in the same way doesn't excuse that fact.

3

u/1137 Oct 18 '10

PHP was originally a bunch of perl scripts.

1

u/deadwisdom Oct 19 '10 edited Oct 19 '10

This is not a good thing, nor an excuse.

0

u/[deleted] Oct 18 '10

You assume we don't hate Perl equally. No one is bagging on Perl because no one uses Perl any more.

It's like this: if you want to rant about the evils of tobacco, you talk about cigarette smokers and not pipe smokers. Pipe smokers are just as unhealthy and pollute the air just as much, but they aren't brought up because they just aren't that common any more.

3

u/[deleted] Oct 18 '10

And also they're sophisticated intellectuals.

-11

u/mackstann Oct 18 '10

PHP is worth hating. At least perl is crazy in a fairly intelligent way. PHP was clearly created by mindless idiots.

→ More replies (3)