# substr/array_slice in []

- Thread: https://externals.io/message/32711
- Original archive: https://news-web.php.net/php.internals/32711
- Started by Ford on 2007-10-09T08:48:53+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #32711 — Ford — 2007-10-09T08:48:53+00:00

URL: https://externals.io/message/32711#32711

> 
> > […]
> 
> Yes, I see this quite often in the list: "let's invent a new thing
> instead of an old thing, that would make peoples' life easier".
> 
> But you forget that both the old and the new thing would co-exist
> and people would have to learn BOTH, which definitely doesn't make
> any life easier. 

You have to be joking!!!

People would only *have* to learn one -- whichever they prefer to use. You'd get some people routinely using one, and others routinely using the other -- but *all* of them would be happier using the version they prefer, instead of half of them being pissed off at having to use a crappy unreadable function call instead of a nice, readable alternative syntax. (Just MHO, of course.)

Variety is the spice of life, after all!

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
JG125, The Headingley Library,
James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 812 4730          Fax:  +44 113 812 3211 


To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm

---

## #32712 — Antony Dovgal — 2007-10-09T09:12:01+00:00

URL: https://externals.io/message/32711#32712 · In reply to: #32711

> > […]
> 
> You have to be joking!!!
> 
> People would only *have* to learn one -- whichever they prefer to use. 

Well, if you live in a hole and never come out of it - yes.
But when you start looking into other peoples' code.. bummer.
Then you discover that your hosting doesn't use bleeding edge PHP version.. bummer.
And then you open your old code and.. bummer.

> You'd get some people routinely using one, and others routinely using the other --
> but *all* of them would be happier using the version they prefer, instead of half of 
> them being pissed off at having to use a crappy unreadable function call instead 
> of a nice, readable alternative syntax. (Just MHO, of course.)

Right, so let's force other people to learn crappy unreadable syntax 
duplicating nice and clear function call.


I believe our resources are too limited to spend them so carelessly.
Instead of adding more and more new features, you'd better spend some time on debugging the ones we already have.

-- 
Wbr, 
Antony Dovgal

---

## #32713 — Stefan Walk — 2007-10-09T09:47:30+00:00

URL: https://externals.io/message/32711#32713 · In reply to: #32712

Antony Dovgal wrote:
> Right, so let's force other people to learn crappy unreadable syntax 
> duplicating nice and clear function call
Oddly, this "crappy unreadable syntax" doesn't lead to any confusion or
complaints for newbies of languages like python or ruby, judging from
the IRC channels. And it's also odd that ruby users, where String#[] is
just an alias for String#slice, prefer this "crappy unreadable syntax"
over a "nice and clear" method call. One starts to wonder ...

Regards,
Stefan

---

## #32714 — Scott MacVicar — 2007-10-09T10:27:20+00:00

URL: https://externals.io/message/32711#32714 · In reply to: #32713

Sure it works fine when it's been in the language for several years and
it's guaranteed to be available in the version provided by your hosting
company.

In reality this isn't the case with PHP so everyone will end up using
the older method to support backwards compatibility or mixing it and
causing confusion.

Scott

Stefan Walk wrote:
> Antony Dovgal wrote:
> > […]
> Oddly, this "crappy unreadable syntax" doesn't lead to any confusion or
> complaints for newbies of languages like python or ruby, judging from
> the IRC channels. And it's also odd that ruby users, where String#[] is
> just an alias for String#slice, prefer this "crappy unreadable syntax"
> over a "nice and clear" method call. One starts to wonder ...
> 
> Regards,
> Stefan

---

## #32715 — Richard Quadling — 2007-10-09T10:47:18+00:00

URL: https://externals.io/message/32711#32715 · In reply to: #32714

> Sure it works fine when it's been in the language for several years and
> it's guaranteed to be available in the version provided by your hosting
> company.
>
> In reality this isn't the case with PHP so everyone will end up using
> the older method to support backwards compatibility or mixing it and
> causing confusion.
>
> Scott

OOI. If the ISP is not on the version which would have this particular
"feature", how would I create a fallback solution for my clients?

Something like PEAR's PHP Compat library. Very useful for giving
support to newer functionality.

I think I wouldn't bother with the new feature for a while. Maybe if
it was major version only (V5 vs V6 is nice and clean, but V5.2.4 vs
V5.2.5 is not so easy for some clients to understand that new
functionality - rather than bug fixes - requires an upgrade).

But having a working method already seems redundant, simply for syntactic sugar.


>
> Stefan Walk wrote:
> > […]

-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
