Re: Long-term direction for shortcuts

2009-08-02 Thread chairface

On Aug 2, 9:50 pm, Jacob Kaplan-Moss  wrote:
> On Sun, Aug 2, 2009 at 8:05 PM, Brent Hagany wrote:
> > But, just to be explicit, I don't want to
> > limit the discussion just to that patch, or to render_to_response or
> > any particular shortcut.  First, we should discuss the larger issue of
> > whether technically unnecessary code (which is what any shortcut is)
> > should be allowed into Django, in my opinion.
>
> Well, discuss away... but I'm not going to put my foot in that one.
> Wide sweeping philosophy discussions aren't really much fun,
> especially when we're all just hand-waving anyway.
>
> Let me suggestion something different:
>
> 1. Propose a new shortcut function. Bonus points for a patch.
> 2. If it's full of win, it'll go in.
> 3. Rinse and repeat.
>
> I don't think anybody's opposed to the idea of "helpers" or
> "shortcuts," so just start making some suggestions. Either they'll
> turn out to be a good idea, or they won't. We don't need any larger
> framing device than that.
>

I am willing to do that - it was my impression that this wouldn't be
well-received on this list, since discussion belongs in the ticket.
Apologies if I misunderstood.

The patch/idea I'm putting forward is #10588.  It was closed as a
duplicate of mine (#9081), but Chris Cahoon prefers #10588 to mine,
which is fine with me.  The idea is simple - let render_to_response
return a status code other than 200.  The primary advantage this has
in my mind is that it provides a consistent shortcut-y way to return
responses, rather than using render_to_response in one view and a raw
HttpResponse subclass in another.  It lowers your cognitive overhead.

I am particularly curious to hear from you Jacob, as you originally
set #9081 to 'Accepted', and being rather naive, I kind of thought
that was it.  The pushback I've gotten on such a simple change has
surprised me.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: Long-term direction for shortcuts

2009-08-02 Thread chairface

On Aug 2, 9:14 pm, Malcolm Tredinnick 
wrote:

> Simon has not justified why his particular preference for imports
> necessarily meets even the common case and why he, or somebody else,
> cannot put their own choices for common imports into a single that they
> import (pretty normal "reduce repetition" pattern in Python).

This is true.  This discussion is a chance for Simon or someone who
agrees with him to justify their position.  You are begging the
question.

> It's a source for ideas for further discussion with more details. A
> conference Q session lacks a *lot* of details.

Again, this discussion is a quest for more details.

> They are considered on a case-by-case basis, just like all proposed
> changes. This isn't new policy and I'm sure why it needs to be changed.

This is true as far as it goes, but it is not the whole story.  I am
certainly not asking for a change in policy.  This list discusses a
lot of things that have no code behind them yet, particularly in the
area of what features should be implemented.  This is the kind of
discussion I am asking for.  Is the feature of an expanded shortcuts
module worthwhile, and consistent with Django's goals?  I have seen
indications that opinion is split, and this is the place to discuss
such things.

> In the case of your proposed changes to render_to_response(), I see some
> added complexity that impacts everybody (maintainers, documentation
> readers and devs) for a small target userbase to do something that
> already only takes a single line (and if counting the imports really
> adds to your line count by a significant percentage, the code is so
> small that it's a tough push uphill to argue it's a common use-case --
> you import once and reuse often).

It is my contention that the added complexity is negligible such that
the word "complexity" does not even fit the situation.  But this is
the type of discussion that belongs in the ticket.  It's actually a
discussion we've already had.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: Long-term direction for shortcuts

2009-08-02 Thread chairface

On Aug 2, 8:36 pm, Malcolm Tredinnick 
wrote:
> On Sun, 2009-08-02 at 18:05 -0700, Brent Hagany wrote:
>
> Putting too much weight on more or less throwaway comments in a single
> video isn't going to be particularly useful.

They didn't seem to be "throwaway" to me - Simon had his requests
prepared beforehand.  Also, it is only a single video, but that video
is a pretty good resource for the topic of Django's future.  It was
the topic of the entire hour.  Are you implying that it's a poor
source for people wondering where Django is going?  It was explicitly
designed to be exactly that kind of source.

> Then there is no way the thread will ever result in a code change or
> even a resolution.

This thread, or the one in the ticket?

> No we shouldn't. This is entirely backwards. Under that logic, Django
> itself is pointless because it's already possible to do all that in
> Python. The point in that sentence is that a discussion without a target
> in mind is just an abstract philosophical discussion with no endgame in
> sight. It adds no value to the process of making a decision.

The target is to get a clear read on whether patches to shortcuts are
going to be considered, or dismissed by their nature.  The objections
I have received on my patches apply equally well to all shortcuts.  I
think that there is a difference in opinion and philosophy in the
community that has real effects on what goes into Django and what
doesn't.  Concretely, I have had the same ticket set to "Accepted" by
a core committer and then threatened to be wontfixed by another.  Is
it wrong for me to want clarification on this?

Futher, I simply do not understand how you can say that a question as
to what that philosophy is has no value in the decision making
process.  At the very least, it helps people to decide what they'll
submit patches for, and what they won't.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: Long-term direction for shortcuts

2009-08-02 Thread chairface

Thanks Alex, I should have explicitly mentioned that rather than
letting the video take care of it.  I'm rather ambivalent on the
common import location myself, but I am in very in favor of his stated
reason for it: reducing the number of imports.  I think good shortcuts
can get us a lot of the way there.

On Aug 2, 8:27 pm, Alex Gaynor  wrote:
> On Sun, Aug 2, 2009 at 8:05 PM, Brent Hagany wrote:
>
> > Hello Django devs,
>
> > The issue of making shortcuts better (and decreasing the number of
> > imports in views.py files) was brought up at DjangoCon, and now that
> > 1.1 is out the door, I would like to spark some discussion on what
> > direction (if any) Django should take on the subject.  (Relevant video
> > here:http://www.youtube.com/watch?v=M1Qr9rSBGBE=PlayList=D415FAF...)
>
> > If you watch the video, there was some disagreement with the idea
> > right from the start.  The ticket that grew out of that part of the
> > discussion is #8950, and has been marked Someday/Maybe.  You may also
> > want to reference #9081, where I have been discussing the issue with
> > Chris Cahoon and Malcolm.  But, just to be explicit, I don't want to
> > limit the discussion just to that patch, or to render_to_response or
> > any particular shortcut.  First, we should discuss the larger issue of
> > whether technically unnecessary code (which is what any shortcut is)
> > should be allowed into Django, in my opinion.
>
> > I am in favor of expanding shortcuts, if it's not obvious already.
> > Now, somebody disagree!
>
> I don't have a problem with putting shortcut functions in, like the
> redirect one Jacob added for 1.1.  However I'm a massive -1 on adding
> a place for common imports like Simon proposed.  All that does is
> obscure the location of the source code by adding an extra layer of
> indirection.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your
> right to say it." -- Voltaire
> "The people's good is the highest law." -- Cicero
> "Code can always be simpler than you think, but never as simple as you
> want" -- Me
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---