Page 1 of 2

a general notice...

Posted: Thu Aug 03, 2006 10:20 am
by Charles256
no amtter how much you want it to be PHP is not c++...keep trying to code my classes like it was c++..it just ain't working..doh.. :-D

Posted: Thu Aug 03, 2006 10:42 am
by MrPotatoes
i know right? it's close tho. so it's not all bad

Posted: Thu Aug 03, 2006 10:59 am
by Charles256
can't tell you how many times i've went for(int i=0;i<10;i++) and then take a minute to figure out why it isn't working.lol

Posted: Thu Aug 03, 2006 12:39 pm
by thiscatis
:roll: not seeing it either

:wink: :wink:

Posted: Thu Aug 03, 2006 1:49 pm
by MrPotatoes
Charles256 wrote:can't tell you how many times i've went for(int i=0;i<10;i++) and then take a minute to figure out why it isn't working.lol
yeah, i'm not really a fan of the '$'. but i guess since i don't have to bothe with pointers and strings i guess it's ok.

but i would like pointers tho. it would be nice to be able to control memory but honestly, what can i expect/demand from a script language? lmao

Posted: Fri Aug 04, 2006 9:49 am
by Ollie Saunders
Yep, I don't really like the dollars either.

I did this for some reason.

Code: Select all

$a=1;$b='o';$j=5;$o=9;$c='b';$e=2;$u='c';$m=4;
echo $$$u; // what's the output?

Posted: Fri Aug 04, 2006 9:52 am
by Charles256
maybe 9? you and your damn variable variable variables. if it's 9 i say it should be a compiler error that you're a moron. : hugs for ole: no hard feelings, i know you were just making a point. :-D

Posted: Fri Aug 04, 2006 10:24 am
by Ollie Saunders
lol, yep it was supposed to be annoying. In fact the answer is 'o'

Posted: Fri Aug 04, 2006 10:25 am
by RobertGonzalez
You know, when I was looking at ColdFusion, VBScript, C#.NET an VB.NET (and C++) the only thing I could think of was...

"Man, this would be so much easier if there some freaking dollar signs..." Image

Posted: Fri Aug 04, 2006 10:28 am
by panic!
$ are very BASIC.

if PHP had pointers...wow that would be awesome, dunno how practical that would be on shared servers.

Posted: Fri Aug 04, 2006 11:05 am
by Ree
I'm wondering what's the point of having $ before variable names? What were they thinking??? :roll:

Posted: Fri Aug 04, 2006 11:12 am
by Charles256
actually. the $ sign does have benefits..it screams at you "hey! I'm a variable!" in c++ and other languages you have to know what the key words are to know what the variables are.that or have a descent IDE :-D

Posted: Fri Aug 04, 2006 11:14 am
by RobertGonzalez
Ree wrote:I'm wondering what's the point of having $ before variable names? What were they thinking??? :roll:
Rasmus developed PHP from Perl, which also uses '$'.

Posted: Fri Aug 04, 2006 11:17 am
by Ree
Yeah, I'm not sure about Perl but I think Ruby uses different prefixes for variable names ($, @ etc) and those have a meaning (such as global var, instance var etc). In php the prefix is not needed at all and I would be happy if it was removed (not that it's going to ever happen though).

Posted: Fri Aug 04, 2006 11:33 am
by Ollie Saunders
actually. the $ sign does have benefits..it screams at you "hey! I'm a variable!"
Yeah that is true which means you can do this:

Code: Select all

$array = array();
Which is a no no in many languages.

Thing that bothers me though is, if variables have a dollar and functions have (), what do constants have? what do class names have?
You could leave class names plain but it would be nice to have a % prefix for constants.

Code: Select all

%numMonkeys = 5;
echo %numMonkeys;
%numMonkeys = 10; // E_FATAL