Skip Menu |

This queue is for tickets about the Poet CPAN distribution.

Report information
The Basics
Id: 77592
Status: resolved
Priority: 0/
Queue: Poet

People
Owner: Nobody in particular
Requestors: mst [...] shadowcat.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: $env is an utterly confusing name for PSGI users
Date: Sat, 2 Jun 2012 09:15:18 +0100
To: bugs-Poet [...] rt.cpan.org
From: Matt S Trout <mst [...] shadowcat.co.uk>
You might want to change it to something else before 1.0; that's an awful piece of API design for somebody coming from outside. -- Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue http://shadowcat.co.uk/blog/matt-s-trout/ http://twitter.com/shadowcat_mst/ Email me now on mst (at) shadowcat.co.uk and let's chat about how our Catalyst commercial support, training and consultancy packages could help your team.
Yes, it is unfortunate, and I certainly wouldn't have chosen it if starting from scratch. But Poet has been around internally for six years at Hearst (predating PSGI), and while this fact doesn't make a lick of difference for new users, it's really hard for me or any of the other Hearst contributors to get our heads around changing it now. In practice, there is little overlap between the kinds of classes that need to deal with a Poet environment versus a PSGI env.
Subject: Re: [rt.cpan.org #77592] $env is an utterly confusing name for PSGI users
Date: Mon, 4 Jun 2012 17:06:38 +0100
To: Jonathan Swartz via RT <bug-Poet [...] rt.cpan.org>
From: Matt S Trout <mst [...] shadowcat.co.uk>
On Mon, Jun 04, 2012 at 01:47:27AM -0400, Jonathan Swartz via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=77592 > > > Yes, it is unfortunate, and I certainly wouldn't have chosen it if > starting from scratch. But Poet has been around internally for six years > at Hearst (predating PSGI), and while this fact doesn't make a lick of > difference for new users, it's really hard for me or any of the other > Hearst contributors to get our heads around changing it now. > > In practice, there is little overlap between the kinds of classes that > need to deal with a Poet environment versus a PSGI env.
What I'd do is to make it $poet_env or $poet by default and have an *optional* export for $env - so your code doesn't have to change but new users don't get confused. Seem sane? -- Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue http://shadowcat.co.uk/blog/matt-s-trout/ http://twitter.com/shadowcat_mst/ Email me now on mst (at) shadowcat.co.uk and let's chat about how our Catalyst commercial support, training and consultancy packages could help your team.
Subject: Re: [rt.cpan.org #77592] $env is an utterly confusing name for PSGI users
Date: Mon, 4 Jun 2012 14:07:42 -0700
To: bug-Poet [...] rt.cpan.org
From: Jonathan Swartz <swartz [...] pobox.com>
On Jun 4, 2012, at 9:18 AM, Matt S Trout via RT wrote: Show quoted text
> Queue: Poet > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=77592 > > > On Mon, Jun 04, 2012 at 01:47:27AM -0400, Jonathan Swartz via RT wrote:
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=77592 > >> >> Yes, it is unfortunate, and I certainly wouldn't have chosen it if >> starting from scratch. But Poet has been around internally for six years >> at Hearst (predating PSGI), and while this fact doesn't make a lick of >> difference for new users, it's really hard for me or any of the other >> Hearst contributors to get our heads around changing it now. >> >> In practice, there is little overlap between the kinds of classes that >> need to deal with a Poet environment versus a PSGI env.
> > What I'd do is to make it $poet_env or $poet by default and have an *optional* > export for $env - so your code doesn't have to change but new users don't > get confused. > > Seem sane?
That's a totally reasonable solution, will ponder the best name to use. Unfortunately the other obvious non-Environment name, $app, has also been reserved by PSGI. :)
Subject: Re: [rt.cpan.org #77592] $env is an utterly confusing name for PSGI users
Date: Mon, 4 Jun 2012 22:15:49 +0100
To: Jonathan Swartz via RT <bug-Poet [...] rt.cpan.org>
From: Matt S Trout <mst [...] shadowcat.co.uk>
On Mon, Jun 04, 2012 at 05:07:54PM -0400, Jonathan Swartz via RT wrote: Show quoted text
> > What I'd do is to make it $poet_env or $poet by default and have an *optional* > > export for $env - so your code doesn't have to change but new users don't > > get confused. > > > > Seem sane?
> > That's a totally reasonable solution, will ponder the best name to use. Unfortunately the other obvious non-Environment name, $app, has also been reserved by PSGI. :)
That isn't obvious, a Poet::Environment object -isn't- the app. It's just a Poet specific type of service locator for a few services. I'd note that in Web::Simple I use $_[PSGI_ENV] for the PSGI $env and just don't have a $env, which is if anything nicer. But it's a little late to make everybody use $psgi_app and $psgi_env, whereas it's not too late for you. I think. I'm not saying this is your fault, only that it's easiest for you to fix it here to make your users' lives easier :) -- Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue http://shadowcat.co.uk/blog/matt-s-trout/ http://twitter.com/shadowcat_mst/ Email me now on mst (at) shadowcat.co.uk and let's chat about how our Catalyst commercial support, training and consultancy packages could help your team.
Changed to $poet in 0.11. Thanks for the push.