I was looking at the examples used in php.js library
http://phpjs.org/functions/index
and it struck me that is cleaner to read the functions and code without the
$ names in it
From what i understand $ in front of variables is an Perl legacy
--
developer flamerobin.org
marius popa wrote:
I was looking at the examples used in php.js library
http://phpjs.org/functions/index
and it struck me that is cleaner to read the functions and code without the
$ names in itFrom what i understand $ in front of variables is an Perl legacy
And how do you propose to do string interpolation?
echo "This is a $var in a string";
or:
echo <<<EOB
This is a $var in a heredoc
EOB;
This is the heart and soul of PHP which isn't possible without a way to
identify a variable. I suppose you could argue that you would have two
ways to indicate a variable, $var for interpolation and var without, but
that gets even messier. One consistent way is cleaner.
-Rasmus
And how do you propose to do string interpolation?
You could do it using an interpolation operator in String constants.
echo "This is a #{var} in a string."; /* Ruby does it using this */
But why break compatibility for a purely aesthetical problem?
Kris
--
Kristian Köhntopp
https://www.xing.com/profile/Kristian_Koehntopp
http://blog.koehntopp.de
I was looking at the examples used in php.js library
http://phpjs.org/functions/index
and it struck me that is cleaner to read the functions and code without the
$ names in itFrom what i understand $ in front of variables is an Perl legacy
This is an utterly horrible idea. No offense. Why would you change
the entire syntax of the language? I don't think any language has
-ever- changed it's syntax like that once it's been established...
Personally I love the $. It makes it so much easier to identify
variables. It's a single character. Can't see the need honestly to
even bring this up.
mike wrote:
Personally I love the $. It makes it so much easier to identify
variables. It's a single character. Can't see the need honestly to
even bring this up.
+1,000,000. Horrible idea. facepalm
--
Brian Moon
Senior Web Engineer
When you care enough to spend the very least.
http://dealnews.com/
mike wrote:
Personally I love the $. It makes it so much easier to identify
variables. It's a single character. Can't see the need honestly to
even bring this up.+1,000,000. Horrible idea. facepalm
--
Brian Moon
Senior Web EngineerWhen you care enough to spend the very least.
http://dealnews.com/--
I'm unsure how the parser works, so ignoring those potential issues,
this change would...
-
Break every single PHP script that is currently in existence.
-
Break syntax highlighting (and probably other tools/functions) for
every IDE that is currently in existence.
I'm not sure that much more needs to be said.
--
Jordan Ryan Moore
mike wrote:
Personally I love the $. It makes it so much easier to identify
variables. It's a single character. Can't see the need honestly to
even bring this up.+1,000,000. Horrible idea. facepalm
--
Brian Moon
Senior Web EngineerWhen you care enough to spend the very least.
http://dealnews.com/--
I'm unsure how the parser works, so ignoring those potential issues,
this change would...
Break every single PHP script that is currently in existence.
maybe an legacy mode can be included in iniBreak syntax highlighting (and probably other tools/functions) for
every IDE that is currently in existence.
this can be fixed by each ide , I talk about something likeI'm not sure that much more needs to be said.
I can give another practical example in wxjscript
from this javascript example that can be run on apache server you can see
that is simpler to read and to learn at least for an beginner
http://www.wxjavascript.net/mysql/index.html
What i want to say is that php must go forward and yes you can
change/break things in the engine
like in the php 4 to php 5 migration or php5 to php6
In time maybe an fast javascript engine could replace php if it
doesn't change in the right direction
or it goes to java bloatware way
--
Jordan Ryan Moore
--
developer flamerobin.org
marius popa wrote:
- Break every single PHP script that is currently in existence.
maybe an legacy mode can be included in ini
we want less of such legacy mode options, not more
plus this would have to be configured per application
and not just per server
- Break syntax highlighting (and probably other tools/functions) for
every IDE that is currently in existence.
this can be fixed by each ide , I talk about something like
sure it can be fixed, but you missed the every part
plus IDEs, editors, highlight tools etc. would have to support
both old and new for quite a while
I'm not sure that much more needs to be said.
I can give another practical example in wxjscript
from this javascript example that can be run on apache server you can see
that is simpler to read and to learn at least for an beginner
http://www.wxjavascript.net/mysql/index.html
so instead of clearly marking variables with $ as such
there they need to be declared with 'var' instead, and
'->' is replaced by '.' ...
... i don't see much of a difference there from a learning
point of view though
What i want to say is that php must go forward and yes you can
change/break things in the engine
like in the php 4 to php 5 migration or php5 to php6
sure we can break things if there is a compelling reason
to do so, i'm just totally missing the compelling part here ...
--
Hartmut Holzgraefe, MySQL Regional Support Manager EMEA
Sun Microsystems GmbH, Sonnenallee 1, 85551 Kirchheim-Heimstetten
Amtsgericht Muenchen: HRB161028
Geschaeftsfuehrer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Haering
sure we can break things if there is a compelling reason
to do so, i'm just totally missing the compelling part here ...
This is not going to happen. This thread is over.
--
Slan,
David
mike wrote:
^^^^
...
Would you mind using your full name or something else? Thanks :)
Not that I'd have a (tm) on mike, but anyway...
Cheers,
Mike
Thu, Sep 18, 2008 at 11:52 AM, Michael Wallner mike@php.net wrote:
Would you mind using your full name or something else? Thanks :)
Not that I'd have a (tm) on mike, but anyway...
i have to give props to you having mike@php.net, but as of right now i
am not ready to make the official change on my name yet :)
i don't really post to internals often so you probably won't see much
of me anyway :)
marius popa wrote:
I was looking at the examples used in php.js library
http://phpjs.org/functions/index
and it struck me that is cleaner to read the functions and code without the
$ names in itFrom what i understand $ in front of variables is an Perl legacy
This would also eliminate constants from PHP, as currently they are
T_STRING
and variables would become T_STRING. Not a good idea.
<?php
define('oops', 1);
$oops = 2;
echo $oops,' ',oops;
?>
Thanks,
Greg
Greg Beaver wrote:
marius popa wrote:
I was looking at the examples used in php.js library
http://phpjs.org/functions/index
and it struck me that is cleaner to read the functions and code without the
$ names in itFrom what i understand $ in front of variables is an Perl legacy
This would also eliminate constants from PHP, as currently they are
T_STRING
and variables would become T_STRING. Not a good idea.<?php
define('oops', 1);
$oops = 2;
echo $oops,' ',oops;
?>
From my point of view, it's not a good idea to have classes, functions,
constants and variables with the same "conflicting" names (PHP way).
Anyway, I'm not going to change it.
Thanks. Dmitry.
I was looking at the examples used in php.js library
http://phpjs.org/functions/index
and it struck me that is cleaner to read the functions and code without the
$ names in itFrom what i understand $ in front of variables is an Perl legacy
I totally agree. Its really annoying needing to type $ all the time,
not to mention how hard it is on Norwegian keyboards. Lets replace it
with £ !
There is even a "patch" available:
http://php.markmail.org/message/jsex75rowudeu2nr
-Hannes
On Fri, Sep 19, 2008 at 10:50 AM, Hannes Magnusson
hannes.magnusson@gmail.com wrote:
I totally agree. Its really annoying needing to type $ all the time,
not to mention how hard it is on Norwegian keyboards. Lets replace it
with £ !
There is even a "patch" available:
http://php.markmail.org/message/jsex75rowudeu2nr
£ is just as hard. Let's replace it with the international
currency-symbol ¤ (Yes, that's what that weird symbol for, in case
you've always wondered about it).
--
troels
On Fri, Sep 19, 2008 at 1:50 AM, Hannes Magnusson
hannes.magnusson@gmail.com wrote:
I totally agree. Its really annoying needing to type $ all the time,
not to mention how hard it is on Norwegian keyboards. Lets replace it
with £ !
can we make PHP whitespace dependent too? might as well. :)
note: i am absolutely NOT actually requesting this.
Please stop this useless thread, it's wasting everybody's time.
regards,
Derick
--
HEAD before 5_3!: http://tinyurl.com/6d2esb
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org