« first day (1992 days earlier)      last day (2970 days later) » 

10:03 PM
Didn't PHP7 add a more sane syntax for invoking a callable in an object property? Doing ($this->foo)() is a syntax error according to phpstorm...
Hm, works at the CLI
Guess it's a phpstorm bug. Joy.
 
@Charles yes
 
phpstorms isn't that great at some things...
 
@Danack like … catching up with new features
 
do any of you use __invoke ?
 
function foo($bar) {
    return $bar .= "blah"; // unused variable warning.
}
 
10:05 PM
Yeah, I was hoping they got 7 support more correct in the current version... it's mostly there.
@RonniSkansing I haven't found a place where that level of magic is an advantage.
 
@Danack technically true
 
Wes
@Danack ARE YOU A GOD?
 
When someone asks you if you're a god, you say yes!
@bwoebi not so sure, as:
function foo($bar) {
    return concat($bar, "blah");
}
even if technically....
 
@Danack well, why do you assign concat instead of simply concat?
 
@bwoebi Did I tell you I just started a new job?
 
10:12 PM
@Danack not just once
 
So probably not my code...
 
Wes
@RonniSkansing yes. all my factories are made with __invoke
 
=) Why, atm I bind most shit to a interface, even the factories
 
Wes
why not? :P
 
If you inject your factory into something, do you hint the concrete?
like AwesomeService { private $fooFactory; public function __construct(FooFactory ..
 
Wes
10:17 PM
interface SomeFactory{ function __invoke(int $a, float $b); }
class MyFactory implements SomeFactory{
    function __invoke(int $a, float $b){ return new Baz($a, $b); }
}
 
I didnt know you could use __invoke in a interface
hmm
thanks
 
Wes
with marcio's (future?) patch i can replace the class with a closure
function(int $a, float $b){ return new Baz($a, $b); }
i think... right?
i've already forgot
 
Dunno havent read it =)
 
Wes
yeah i think it will be required to have the "typedef" thingy for that
 
@Charles yep. @NikiC's "Uniform Variable Syntax" made ($this->foo)() and the like always work
 
10:27 PM
@Andrea wasn't that a separate patch without RFC?
 
@bwoebi maybe? not sure
 
@Andrea eih, I mean the AST patch
 
IIRC AST changed very little syntactically, UVS was where the big changes happened
but my memory may have failed me
 
UVS is where the breaking changes happened
AST allowed some mid-rule expression removal
and thus enabled more possibilities with parens
 
ah, I checked the RFC, UVS enabled this
> // support operations on arbitrary (...) expressions
> ($obj->closure)()
 
10:32 PM
Indeedy.
 
oh … so… AST changed just yield parend requirement
fine…
 
> To ensure maximum possible inconsistency there exists an exception to this rule.
god, why didn't I read the UVS RFC more carefully
the old variable variable syntax is terrifying
jesus
thank you, @NikiC, for saving us
 
I somehow read that like @NikiC would be jesus, our savior…
 
that was semi-intentional :D
@NikiC, PHP Messiah
 
(And Dmitry is the PHP god :-D)
 
10:37 PM
@bwoebi OPcache was created in God's image?
 
yip
That's why none of us, except his son and God himself can understand it.
we can just try to, but usually will miserably fail to :-)
 
I'd say opcache is the creation of Lucifer
 
@FlorianMargaine Lucifer was also made in God's image
 
right … with Xinchen being Luzifer … :-D
 
Nah, Xinchen would be Luicfer :p
 
10:40 PM
@Andrea woops, typo … It's with z in German :-P
 
@bwoebi heh
yeah I notice that a lot, c becoming z
 
@Andrea or k. Depending on the sound.
 
@bwoebi yeah
 
Wes
11:07 PM
31:22 var will likely survive
@Andrea did you vote no for fun in null coalesce assign? i thought you wanted the feature too
 
@Wes the use case is stupid
$this->request->data['comments']['user_id'] = $this->request->data['comments']['user_id'] ?? 'value';
Who does this?
 
Wes
it's not stupid. the feature is not crucial but it's nice to have. you have no idea how many
return $this->cache = $this->cache ?? $this->make();
i have already
 
if (!$this->cache) {
    $this->cache = $this->make();
}

return $this->cache;
 
@Wes maybe for the same reason why I haven't voted at all: I'd like to see the actual semantics first (__get/__set? offsetGet/Set? Re-evaluation of some fetches? order of operations?)
@Danack that's not readable. (well, less readable than @Wes example)
 
We disagree.
consistently at least.
 
Wes
11:17 PM
@Danack okay, you can php :D yeah, clearly we are talking of shortcuts... sometimes doing that, especially in batch, is very annoying...
 
Feb 18 at 19:37, by Danack
That code means that you have to scan across the line, and 'push' functions onto the stack of things you're holding into your head.
 
Wes
it is nice to have one liner methods, especially considering that php doesn't have actual properties / get-set accessors
 
@Danack There are constructs which work like a single op in my head … but if you're going a big if … that's much more parsing.
 
Wes
and ternary stuff help a lot with that. imho
 
@bwoebi but it's linear....as opposed to having to push stuff onto a 'stack' in my head.
 
11:21 PM
@Danack Ehm … the if-nesting-stack?
 
Wes
ahahah
 
@bwoebi "If the cache is not set, set the cache to the result of make. Return the cache". There's no nesting there.
it's linear in my head...even if there is a brace-scope in the code.
 
@Danack there is a relative phrase
 
return $this->cache = $this->cache ?? $this->make();
"Return the cache if it's set, or set the cache to the result of make and return that if it's not set already."
 
$this->cache. Ifnotset assign it $this->make(). Return.
 
11:25 PM
Return ?
 
@Danack Yeah, working like with a single accumulator variable passed around
 
Polish notation like typing detected.
I just find it hard.
 
Different minds work differently :-)
 
Although you might find it easy....I think in general other people are a lot less good at parsing stuff than they imagine.....I like code to be boring to read, as then that means that it's hard to misunderstand (on line by line basis) rather than people thinking they can understand the code...but actually it's pushing them a bit beyond what they can remember...
 
Whereas with the if() it's more like: $this->cache. ifnot then { $this->cache assign with $this->make(). }. return $this->cache.
which feels much more complicated to me
 
11:31 PM
more complicated, but separated.
the return bit lives on its own, and isn't connected to the setting stuff...
 
$x ??= $y feels a bit ... "write only language" to me. There's more steps happening in fewer symbols.
 
A random slide appears! Simpler parts, more of them
 
@Danack I agree … I hate it too when I have to decipher code … But there are some common idioms which work in my head like a single operation (e.g. ifnot, ifnotset …)
and at that point, the way I read it, is the simplest way I can express that thing.
 
Does anyone know how to download everything on a linode server? I've tried FTP but it will not connect.
 
"there are some common idioms which work in my head like a single operation" You are CISC, I am RISC - lets call the whole thing off.
 
11:36 PM
@Danack A line gets hard to lex when there are too much symbols on them. A line gets hard to parse when it is tried to express something in an uncommon way with complex syntax nesting.
@Danack The RISC is just a cheap version of the CISC :-D
 
Who doesn't like cheap?
 
@Danack I like cheap high-quality.
but that's an oxymoron (usually).
 
Nah, not contradictory... It's only impossible if you try to do all three of cheap, high quality, and fast.
 
well, a slow RISC is anyway for the trashbin.
 
ATmegas are slow RISCs that are popping up all over the place.
 
11:41 PM
@Danack But well… you can nicely compare that to assembly… nobody knows the full instruction set. Experienced users know a lot of it by heart and are able to run these instructions immediately. Unexperienced users only know basic instructions and have to lookup instruction functions all the time, slowing them down.
There is - for me - the balance between making it easy for unexperienced users and very easy for experienced users.
At least that's my view on it @Danack … you may differ if you like. Your mind seems to be differently structured and different strategies work well for you. It's not quite possible to satisfy everyone here.
 
@Wes RFC is incomplete. I'm probably okay with the idea
 
Wes
incomplete how?
 
no details of semantics, handling of edge-cases, etc.
 
Wes
what bwoebi was mentioning basically? eg offsetSet/Get __isset() etc?
 
sure
Nikita had a good email on the subject
 
11:48 PM
I need to go to sleep soon but "Unexperienced users only know basic instructions and have to lookup instruction functions all the time, slowing them down." - that's the other way round ....which actually makes the CISC/RISC comparison be an interesting one. The code I preferred is more verbose, but more basic. The code you may prefer is a smaller number of 'instructions', but it's a more complicated one, as it can be decomposed to simpler instructions.
@Andrea I Couldn't see that email earlier - I was going to ask the RFC author to respond to it....but couldn't see where it was to quote it...
and sleepeeee.
 
Wes
yeah all that would be better to be defined @Andrea i agree
@Danack gn Ray \o
 
@Danack yeah, it's true. reading cmov, xchgl, etc. instructions wasn't fun until I really knew by heart what they meant … It's basically trading complicatedness for complexity. Your code is relatively seen more complex, my expression is more complicated. … And everyone has a different sense of where the ideal balance between complex and complicated lies.
 

« first day (1992 days earlier)      last day (2970 days later) »