« first day (4609 days earlier)      last day (329 days later) » 

11:29 AM
Morning everyone.
 
I've seen some people using dependency injection containers without autowiring because they think reflection is costly. I think that's an urban legend. Is reflection slow, after all? Does it make sense to use DI without autowiring at all? Considering that it's a not compiled DI. 3v4l.org/r5MAZ
More especifically, DI52 from this HTML benchmark (save to your computer it you'd like to see it) pastebin.com/raw/t5t0PnZ0
 
11:44 AM
@LucasBustamante DI can mean more than just single-use services, it's perfectly possible to inject dependencies into an instance class through means of a factory for example.
But most of the common DI configs can be compiled anyway
That compilation also provides other benefits like checking that there's' no circular dependencies at build time etc.
 
I prefer dynamic DIs because of scenarios like this:

if( is_admin() ) {
$container->bind(Template::class, AdminTemplate::class);
} else {
$container->bind(Template::class, FrontendTemplate::class};
}
How a compiled DI will resolve Template::class? I'd need to convert this to a factory, which adds complexity to the code
 
Those (in symfony at least) are called synthetic services, you define them in the container but inject them at runtime
That said, assuming is_admin() is based on the user, something such as a template is better suited for carrying alongside the request, rather than injecting into the container.
 
12:12 PM
@Danack I can only recommend you getting very high resolution screens.
 
@bwoebi I have a 3840 × 2160 monitor, and was using it in 2x scaled GUI with windows. The uneven colour of the fonts was still very distracting. The same monitor looks great on a mac.
 
@Danack Ah windows. Yes.
 
Windows should let you fiddle with the cleartype settings in control panel
 
@MarkR It does, but it just doesn't get as polished as on macos for whatever reason.
 
@MarkR I spent multiple hours trying that, and also installed some software to let me tweak even more font rendering settings....they still looked incredibly crap.
 
12:18 PM
In particular does windows have issues with scaled interfaces.
Like it seems they apply the subpixel rendering and then scale it up or such things (instead of the opposite). In early iterations it definitely was like that.
 
It wasn't great at the start but on anything built in recent years it seems pretty flawless on my 4k laptop
 
/me is looking forward to 8k becoming the standard and then using 2x scaling.
 
I doubt it will anytime soon outside of 70"+ TVs tbh, emphasis definitely seems to be on refresh rate for PC and the cabling solutions are becoming kinda nuts. HDMI 2.1 is what, 50Gbit/sec?
 
@MarkR I expect to see it by the end of the decade.
 
I've ran some benchmarks, and there indeed seems to be a considerable peformance hit with autowiring in DI 3v4l.org/BlngI#v8.2.6
I mean, completely unoptimized still
 
12:29 PM
@bwoebi 7 years from now maybe. I'm not sure tbh, in 7 years time I could imagine TVs starting to be phased out and replaced with ultra high definition augmented reality.
 
Scrape that, that's not a real benchmark
 
There's a VR headset now I can't remember the name of which does eye tracking and only fully renders the bit you're focused on iirc.
 
\o
 
o/
 
@LucasBustamante Does it actually add complexity? Or does it make the code be easier to reason about?
 
You mean it makes the code more friendly to static code analysis, and therefore is a win - it's a good argument
 
In this case, I'd probably say "making it more obvious to the developer, that the type of Template depends on some runtime data" is bigger thing than making it friendly to static analysis.
 
 
2 hours later…
2:41 PM
@LucasBustamante parroting what I've been told: DI containers that use caching help overcome the potential performance hurdle
 
 
3 hours later…
5:41 PM
I thought everyone was using Auryn anyway :)
 
5:56 PM
@FélixAdriyelGagnon-Grenier Didn't rdlowrey create that? Wow... his profile on Stack Overflow is no longer accessible. Anyway- that has really remained a staple for a long time... unless there is someone updating it... if needed.
Never mind... lots of contributors github.com/rdlowrey/auryn
Hmm... his twitter account is gone and Github private. Guess he has went off the grid.
 
 
3 hours later…
9:06 PM
@StatikStasis It's indeed one of the few and invaluable systems that Work™ in php, and we should cherish it.
 
 
1 hour later…
10:26 PM
Just wish the maintainers could be bothered to do a release.
 
 
1 hour later…
11:46 PM
I've been thinking about just using auryn until amphp/injector gets a release
There was an uncon talk about dependency injection containers at phptek... the speaker did a bit of an overview of some... he commented that auryn is his favorite, heh
 

« first day (4609 days earlier)      last day (329 days later) »