« first day (2424 days earlier)      last day (2524 days later) » 

user6845426
1:00 PM
what frameworks do you guys use when making web apps? frontend/backend
 
user6845426
Theres so many
 
@dipper slim is kind of ok. But I use it with Auryn to make it nicer.
And React for the front end.
 
user6845426
What about Laravel?
 
no.
 
@dipper that's a bad word here
 
user6845426
1:03 PM
Glad you cleared that up
 
user6845426
Care to elaborate?
 
Here we go again...
 
Oct 11 '16 at 13:37, by Gordon
we dont do laravel in here
 
@dipper none. I use packages from composer and not a monolithic framework
 
Anonymous
2 days ago, by JayIsTooCommon
we neeeeed a canon laravel.
 
user6845426
1:04 PM
Have I started something here...
 
@dipper it's kind of okay for small projects with one or two people working on, for up to like a month. But after that it becomes a smelly mess of code.
 
^ and for projects that you do not intend to maintain
 
@dipper Here, here, here, here is just the beginning.
 
May 25 at 0:17, by Ocramius
lately, I have a good laugh at frameworks reproducing ZF1 with composer packages. Sometimes I also cry because of that.
 
user6845426
I've been playing around writing crappy websites using php mysql. I find all of my code is messy and has no structure at all (which is why i ask)
 
Anonymous
1:06 PM
A framework isn't the correct solution for that
 
@dipper yeah .. that's not something you can fix with a framework
 
user6845426
@Tiffany that looks interesting
 
user6845426
thanks
 
@Patrick speaking of... you should definitely have a "this is an autoload with spl_autoload_register, look how it maps classes to directories and files. Build one, then show how composer does it for you
 
1:11 PM
@Jimbo but that would only complicate things
 
@Patrick I like the blog post and for the sake of an example Color is fine, but if I wanted to be a pedant I'd complain about Color(r,g,b) leaving no name for Color(c,m,y,k)
also, I find the wording sometimes too prescriptive
 
@Gordon I had it named RgbColor in the beginning, but refactored to simplify. And I couldn't make my mind up between RGBColor and RgbColor ^^
what do you mean by too prescriptive?
 
Anonymous
> php-internals-subscribe at lists dot php dot net is not a valid address
 
Anonymous
@DaveRandom is that the right one? (obvs without worded punc)
 
user6845426
I know this isn't relavent to the room... but whats your views on AngularJS for front end dev?
 
1:14 PM
@Patrick it sometimes read to me like you are sitting there with your finger raised saying you should do it this way else kittens die or this is the best way instead of a less strict this is a good way
 
point taken. But think of those poor kittens...
 
I do, but they won't die if you don't use VOs :)
 
@JayIsTooCommon try dropping the php-
 
@dipper messed with it briefly last Friday. Maybe it was the tutorial I was using, but I found it to be overly complex for making something simple.
 
user6845426
I quite like the look of templating with php
 
user6845426
1:17 PM
I'd like to make my sites modula
 
@Tiffany It's not meant for simple things
 
Anonymous
@DaveRandom thanks
 
so it was just the tutorial I was doing, because it was giving simple examples that seemed pointless to do in Angular
 
It's meant for people who like frameworks doing technical choices for them, and people who like architecture dictated to them
 
@JayIsTooCommon relevant
 
1:19 PM
@Patrick you could make the ctor private and add static ctors to allow both cmyk and rgb. it shouldn't matter how they are handled internally.
 
Also, I hope you're not talking about Angular 1, @dipper, because it's quite broken.
 
@Patrick No.. many people getting into PHP have no idea what composer is or why they should use it
It's just a glorified autoloader, with a httpclient
 
@dipper it's suffering from same issue as JS development in general: it's changing too fast and documentation is either poor or outdated or both
 
@Jimbo but the tutorial was never meant for people just getting into PHP. it's meant to show that you can write an app without a framework
 
@dipper and unless you have extensive skills in JS, it's your best option
 
1:21 PM
@LeviMorrison Does Ruby's newer short lambda syntax work for PHP? $func = -> (int $x) { $x * 2 };?
 
@kelunik how will parse differentiate it from $foo->(string){$command}();
 
@tereško There's a $foo on the left.
 
@kelunik Not really, because effectively there is always a yield on function entry
So they also undergo the same process as other generators
@kelunik wot
 
ruby has another lamba syntax?
Didn't they already have 10 different ones before that?
 
1:25 PM
 
@Patrick Fair enough :)_
 
@kelunik I guess that is a way to avoid the parsing issues...
 
@Jimbo aaand I don't really want to touch it anymore. Blog + book is more than enough to keep me busy :)
 
@NikiC Not really sure whether I like it, especially not sure about the curly braces.
 
Anonymous
@DaveRandom thanks.. I've given up for now but will try again in a bit.
 
1:30 PM
@NikiC So the only way to optimize small generators would be function inlining and an even smaller start stack size?
 
user6845426
@tereško so is there benefits in using front end frameworks?
 
@kelunik generators don't have a stack anymore
are you testing this on 7.0 or 7.1?
 
@dipper yes, if you know how
 
user6845426
tbh I hate front-end and I just plan on using Bootstrap. I thought using some type of framework would help me keep my code modula
 
@NikiC 7.1.3
 
1:33 PM
@kelunik btw, try moving yields out of function calls
Yield during function calls has additional overhead
Doing $x = yield ($length + 2); $payload = \substr($x, 0, -2); instead of $payload = \substr(yield ($length + 2), 0, -2); may be faster
 
Results with OPCache now:
Kelunik\StreamingResp\IterativeRespParser: 0.502368 @ simple-string
Kelunik\StreamingResp\IterativeRespParser: 0.772683 @ bulk-string
Kelunik\StreamingResp\IterativeRespParser: 1.788251 @ simple-array
Kelunik\StreamingResp\RecursiveRespParser: 0.675349 @ simple-string
Kelunik\StreamingResp\RecursiveRespParser: 1.184438 @ bulk-string
Kelunik\StreamingResp\RecursiveRespParser: 2.927756 @ simple-array
 
higher/lower is better?
 
Lower is better, it's the parsing time of 1M responses.
 
I might run that through perf later
@kelunik So, looks like it#s not so bad as long as yield from is not involved
 
Yes, because it's not creating a subgen then I guess.
Previously it created one gen per response, but that's no longer the case with the inlined version now.
 
1:50 PM
> An axis of change is an axis of change only if the changes actually occur.
that's a smart quote by uncle bob
and it protects against needless complexity
unrelated to the streaming stuff… just wanted to leave it here in general
 
@JayIsTooCommon it is generally really flaky, always has been. I blame @PeeHaa
 
Fuck you too
Morning all fine people and @DaveRandom
 
morning
 
They are creating it from svgs now? O.o
 
1:57 PM
Seems to be
 
lol
Surely just rendering a png isn't an issue not even on the scale of SO
 
It's really annoying those fields aren't available from the Stack API user objects, there's no obvious reason that they are missing, there's plenty of other personally identifiable data in there and it's public on the profile pages
 
Yeah
 
@PeeHaa well, it does save an HTTP request I guess...
 
Just double checked in another room where job basically said the same
@DaveRandom Doesn't SO do http2 nowadays?
 
2:00 PM
Dunno, but even if it does, requests aren't free, I dunno how it stacks up but it seems like they wouldn't make a decision like that for no reason
dunno how embedded svg stacks up against embedded data: URI pngs either
 
You must be new on this site :D
 
oh right yes I forgot who I was dealing with for a minute
the problem with a site by devs for devs is that they feel like they can do what all devs want to do and just dick about with stuff and no-one will mind
which, to be fair, does actually seem to be the case. I don't see the userbase leaving any time soon...
 
Well he userbase did get a lot more dumb over time
Doubt the tweaking is the cause of it though :P
 
@PeeHaa They could also inline the PNG. ^^
 
Is there a post somewhere that I can read that breaks down how routing works?
 
2:08 PM
@Tiffany In simple terms it's just a mapping between url+method -> file (or class::method)
 
@Tiffany not really .. maybe this helps: stackoverflow.com/a/19309893/727208
 
@PeeHaa method as in class method, or method as in HTTP request method?
 
http method + url -> class::command (or file)
 
http method
A request comes in -> check the http method and the uri against a list of defined routes (could even be a simple switch case in it's simplest form) -> require a file / execute a class method
Obviously a switch case gets large and hard to maintain fast, but that's the gist of it
 
Morning.
 
2:13 PM
You know how to make all requests go through a single file @Tiffany?
Hey @LeviMorrison o/
 
@Wes looolll..... that douchebag :P
 
I'm trying to wrap my brain around how it interrupts the request. I'll see if I can explain this better. I'm used to building sites in a stereotypical beginner fashion, where the webpage is the folder name with index.php inside. When a request to a page is being made, how does the PHP application know to use the router to handle the request?
 
not sure if we're seeing environmental ideals gone wrong of just plain confused irish drunk dude
 
see if the linked post helps a bit
 
@PeeHaa that's what I'm trying to understand I guess
alright
 
I was reading it, then a ticket update came through that I need to take care of first :P
 
Oh wait. It's monday
 
3 messages moved to Trash
 
lawl, sneaky @Jay
 
user6845426
@Tiffany regarding that link you sent me earlier, I've failed at the first hurdle. I created a public directory and src directory within it holding Bootstrap.php. Now, inside the public directory (not the src) I've created my index.php and used require __DIR__ . '/../src/Bootstrap.php'; ... but its not finding the file :s
 
2:28 PM
> php-signal-handler extension uses signal syscall, so it will work even if blocking method was executed.
We can interrupt a blocking call? (Does he mean interruptible here?)
 
Depends what
some syscalls (e.g. most blocking I/O syscalls) are interruptable
That's determined by the underlying OS implementation
 
> Because amqp consume method is blocking, pcntl extension seems to be useless.
Just looking at the C implementation for PHP-amqp (rather than using the slower PHP implementation)
 
That's more likely due to a loop which is not checking for interrupts
 
So no declare ticks then
Easy addition :)
 
i.e. a "broken" implementation in the extension
 
2:32 PM
@dipper try maybe __DIR__ . '/src/Bootstrap.php'; If that doesn't work, I'm not sure. The post was written by someone who's much more experienced than I.
 
@Jimbo maybe, but possibly just an issue with the actual C function underlying the fcall
"ticks" are processed at the opcode layer, so if no new opcode is hit, the tick function won't be called
 
// Does this feel more "PHP-ish"
map({ return transform($0); }, $input);

// than this?
map([]() => transform($0), $input);
 
It's also possible that whoever wrote that post is just Doing It Wrong™
 
user6845426
I hope not... because that wouldn't fill me with confidence
 
/cc @bwoebi @NikiC @ircmaxell @JoeWatkins @DaveRandom @brzuchal @beberlei @kelunik @PeeHaa
 
Anonymous
2:34 PM
.. absence noted.
 
@Jimbo x/y: what are you doing that would require it to be interruptable?
 
@dipper he's talking about something else
 
user6845426
oh, good lol
 
@LeviMorrison both are somewhat weird if you ask me…
 
@LeviMorrison Not really to me
 
2:37 PM
@tereško what does "use" do in your autoloader example? function( $name ) use ( $path )
 
Doh, I messed up the example anyway.
// Does this feel more "PHP-ish"
map({ return transform($0); }, $input);

// than this?
map([]($x) => transform($x), $input);
 
@LeviMorrison Yes.
But I hate non-named arguments.
The first thing I do in bash functions is to alias them in local variables for proper names.
 
^ +1
 
@DaveRandom I'm not tbh, I was reading this, saw the signal-based stuff and as I've used that before thought I'd query :)
 
@Tiffany it means you can use $path within the function
 
2:46 PM
I thought {} would actually be difficult to disambiguate but it was actually easy (< 5 minutes)
 
@Rovak why not just pass it as an argument?
 
It didn't have any tricky cases laying around ^_^
 
@LeviMorrison yes, but I still want argument names, for clarity...
 
@LeviMorrison Isn't that a (weird edge case) bc break though?
 
@Tiffany because the function is being called by spl_autoload_register which only passes the $name parameter. if you want to pass any additional variables to the function scope then you need to add a use
 
2:48 PM
@PeeHaa Nope. Zero BC.
 
@Tiffany btw, did you check the mvc example i posted?
 
@Jimbo tbh it's mostly a thing you won't ever need to worry about. I think I've used it once, ever. The vast majority of the time in real world applications you (I) need actual data exchange rather than just signals, and unix domain sockets are generally more appropriate for that. Signals are mostly useful for stuff like sending restart/config reload instructions etc
 
It doesn't get in the way of being able to add random {{{{{ echo 'foo'; }}}}} blocks?
 
@PeeHaa Nope.
 
cool
 
2:48 PM
@Rovak yes, slowly going through the code to get an understanding of what's being done
 
You can only add arbitrary {} at the top-level.
 
i could add some more comments if that helps
 
That's why it was doable ^_^
 
that would help
 
kk \o/
 
2:49 PM
So all existing uses remain the same. But in an expr context which is not top-level it would become a closure.
@ircmaxell The difficulty is providing args in a familiar syntax because we use () for so many things.
 
@LeviMorrison Oh, I get that
what was the deal with fn($a, $b) { return 1; }? did that go anywheere?
and for the record, I dislike the C++ style [](){}
 
There has been decently strong opposition for every proposal, with some having more opposition than others.
Of those likely to pass fn is among the highest.
 
I could totally live with fn i think
 
@LeviMorrison That's what I'm repeating all the time :-)
 
Just because I think it might pass doesn't mean I'm happy with it ^_^
I think Hack style would pass as well.
 
2:53 PM
Either hack or JS is also fine by me
 
A few would vote no because of GLR parser change but I think a lot of people would vote yes.
 
@LeviMorrison The only other syntax that I've gotten largely positive comments on is |params| => expr.
 
@LeviMorrison I would vote no, for instance. Apart from the fact that I don't really like it anyway.
 
The syntax I actually like the best is Dart's, verbatim:
(parameter_list) { inner_statement_list }
(parameter_list) => expr
 
Works for me
 
2:57 PM
@Tiffany i've added a few comments
 
@LeviMorrison I'm afk right now but I can see you're doing something with braces. I was gonna propose creatibg closure from callables using braces and started some writing here gist.github.com/brzuchal/fcfba46c8e20b41a6a341f499c2b679d
 
I do like Hacks, but I don't think fn() is bad, as long as it auto-captures
 
So example with map would be just passing an function name in braces to map function in your example
 

« first day (2424 days earlier)      last day (2524 days later) »