Go Back   Velocity Reviews > Newsgroups > Python
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Python - Re: Web development with Python 3.1

 
Thread Tools Search this Thread
Old 10-27-2009, 02:17 PM   #1
Default Re: Web development with Python 3.1


Why the push to use a framework, and why the resistance from the OP?

Does the OP need to work with cookies or other http-specific features?
In fact, other than cookies, what http-specific features exist? Does
Python have a built-in framework for making available GET and POST
variables? Database queries should be no different than in other
Python apps.


--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il


Dotan Cohen
  Reply With Quote
Old 10-27-2009, 02:26 PM   #2
Diez B. Roggisch
 
Posts: n/a
Default Re: Web development with Python 3.1
Dotan Cohen wrote:

> Why the push to use a framework, and why the resistance from the OP?
>
> Does the OP need to work with cookies or other http-specific features?
> In fact, other than cookies, what http-specific features exist?


declarative mapping of urls to code, of code to templates, abstracting away
the details of GET and POST, validating and decoding parameters, especially
if these become larger repetitive structures like several addresses of a
user, re-rendering invalid form-data, working with HTML or JSON as output,
managing transactions, providing a error-reporting-infrastructure

The list continues.


> Does
> Python have a built-in framework for making available GET and POST
> variables? Database queries should be no different than in other
> Python apps.


Yes, in the end of the day, it's all python.

Diez


Diez B. Roggisch
  Reply With Quote
Old 10-27-2009, 06:36 PM   #3
Dotan Cohen
 
Posts: n/a
Default Re: Web development with Python 3.1
> declarative mapping of urls to code

Apache does this, unless I am misunderstanding you.


> of code to templates


Those who code in HTML don't need this. In any case it's not hard to
call a function in a class that writes the HTML before the content,
then write the content, then call another function that writes the
HTML after the content. This is how my sites are run, though in PHP
instead of Python. No prepackaged templates.

> abstracting away
> the details of GET and POST


GET is easy, just parse the HTTP request. I don't know how much of a
problem POST would be.


> validating and decoding parameters, especially
> if these become larger repetitive structures like several addresses of a
> user


This falls under database, cookies, or HTTP request parsing. Or am I
misunderstanding something again?


> re-rendering invalid form-data


Just add it into the HTML.


> working with HTML or JSON as output,


Same as writing to stdout, just output the HTTP headers first.


> managing transactions, providing a error-reporting-infrastructure
>


This does not differ from regular (non-web) Python coding.


> The list continues.
>


I would really like to know what else. So far, I am not convinced that
a framework offers anything that is not already easily accomplished in
Python.

--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il


Dotan Cohen
  Reply With Quote
Old 10-27-2009, 06:58 PM   #4
geremy condra
 
Posts: n/a
Default Re: Web development with Python 3.1
On Tue, Oct 27, 2009 at 2:36 PM, Dotan Cohen <> wrote:
>> declarative mapping of urls to code

>
> Apache does this, unless I am misunderstanding you.
>
>
>> of code to templates

>
> Those who code in HTML don't need this. In any case it's not hard to
> call a function in a class that writes the HTML before the content,
> then write the content, then call another function that writes the
> HTML after the content. This is how my sites are run, though in PHP
> instead of Python. No prepackaged templates.
>
>> abstracting away
>> the details of GET and POST

>
> GET is easy, just parse the HTTP request. I don't know how much of a
> problem POST would be.
>
>
>> validating and decoding parameters, especially
>> if these become larger repetitive structures like several addresses of a
>> user

>
> This falls under database, cookies, or HTTP request parsing. Or am I
> misunderstanding something again?
>
>
>> re-rendering invalid form-data

>
> Just add it into the HTML.
>
>
>> working with HTML or JSON as output,

>
> Same as writing to stdout, just output the HTTP headers first.
>
>
>> managing transactions, providing a error-reporting-infrastructure
>>

>
> This does not differ from regular (non-web) Python coding.
>
>
>> The list continues.
>>

>
> I would really like to know what else. So far, I am not convinced that
> a framework offers anything that is not already easily accomplished in
> Python.


Using a framework helps to ensure that your code is easy to maintain.
DRY isn't about saving time now, its about saving time six months
from now.

Geremy Condra


geremy condra
  Reply With Quote
Old 10-27-2009, 07:11 PM   #5
Dotan Cohen
 
Posts: n/a
Default Re: Web development with Python 3.1
> Using a framework helps to ensure that your code is easy to maintain.

I see, that is a good point. With someone else (the framework
maintainers) worrying about maintaining function such as HTTP request
parsers, a lot of work won't have to be [re]done.


> DRY isn't about saving time now, its about saving time six months
> from now.
>


I suppose in this case it's DRTW (don't reinvent the wheel) but the
same principle applies.


--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il


Dotan Cohen
  Reply With Quote
Old 10-27-2009, 07:27 PM   #6
Aaron Watters
 
Posts: n/a
Default Re: Web development with Python 3.1
On Oct 27, 10:26*am, "Diez B. Roggisch" <de...@nospam.web.de> wrote:
....
> Yes, in the end of the day, it's all python.


For me, in the end of the day, it's all java or PHP.
But I'm working on that. For my purposes the "frameworks"
don't really help much. That's why I built WHIFF .

http://aaron.oirt.rutgers.edu/myapp/..._2200.TreeView

-- Aaron Watters

===
If all you got is lemons, make lemonade.
-- anon.


Aaron Watters
  Reply With Quote
Old 10-27-2009, 07:45 PM   #7
geremy condra
 
Posts: n/a
Default Re: Web development with Python 3.1
On Tue, Oct 27, 2009 at 3:11 PM, Dotan Cohen <> wrote:
>> Using a framework helps to ensure that your code is easy to maintain.

>
> I see, that is a good point. With someone else (the framework
> maintainers) worrying about maintaining function such as HTTP request
> parsers, a lot of work won't have to be [re]done.
>
>
>> DRY isn't about saving time now, its about saving time six months
>> from now.
>>

>
> I suppose in this case it's DRTW (don't reinvent the wheel) but the
> same principle applies.


Well, yes- but it's also DRY, and while DRTW (like the acronym, btw)
helps to prevent your code from being unreadable to someone else,
DRY helps to ensure that when you have to change something you
don't have to worry about changing it in 37 and a half other places
at the same time. Especially given how notoriously difficult it is to
do automated testing for web development, that's essential.

Geremy Condra


geremy condra
  Reply With Quote
Old 10-27-2009, 08:52 PM   #8
Dotan Cohen
 
Posts: n/a
Default Re: Web development with Python 3.1
> Well, yes- but it's also DRY, and while DRTW (like the acronym, btw)
> helps to prevent your code from being unreadable to someone else,
> DRY helps to ensure that when you have to change something you
> don't have to worry about changing it in 37 and a half other places
> at the same time. Especially given how notoriously difficult it is to
> do automated testing for web development, that's essential.
>


That's what classes are for, no? Reuse code. I fail to see how using a
framework would reduce the need to use classes, provided that the need
exists.


--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il


Dotan Cohen
  Reply With Quote
Old 10-27-2009, 09:34 PM   #9
geremy condra
 
Posts: n/a
Default Re: Web development with Python 3.1
On Tue, Oct 27, 2009 at 4:52 PM, Dotan Cohen <> wrote:
>> Well, yes- but it's also DRY, and while DRTW (like the acronym, btw)
>> helps to prevent your code from being unreadable to someone else,
>> DRY helps to ensure that when you have to change something you
>> don't have to worry about changing it in 37 and a half other places
>> at the same time. Especially given how notoriously difficult it is to
>> do automated testing for web development, that's essential.
>>

>
> That's what classes are for, no? Reuse code. I fail to see how using a
> framework would reduce the need to use classes, provided that the need
> exists.


....frameworks use classes. They just don't make you write all of them.

Geremy Condra


geremy condra
  Reply With Quote
Old 10-27-2009, 09:34 PM   #10
Diez B. Roggisch
 
Posts: n/a
Default Re: Web development with Python 3.1
Dotan Cohen schrieb:
>> Well, yes- but it's also DRY, and while DRTW (like the acronym, btw)
>> helps to prevent your code from being unreadable to someone else,
>> DRY helps to ensure that when you have to change something you
>> don't have to worry about changing it in 37 and a half other places
>> at the same time. Especially given how notoriously difficult it is to
>> do automated testing for web development, that's essential.
>>

>
> That's what classes are for, no? Reuse code. I fail to see how using a
> framework would reduce the need to use classes, provided that the need
> exists.
>


A webframework is *written* in python. Your whole line of argumentation
boils down to "I can write things myself in python, why use
libraries/frameworks". Yes. You can also delete your standard-lib, and
code everything in there yourself - with the same argument.

Using a framework is about proven solutions for common problems, letting
you focus on working on your actual application code.

Diez


Diez B. Roggisch
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Software Development Company hanusoft Software 0 12-23-2007 06:52 AM
Regarding MSTS SharePoint 2007 and WSS 3.0 Application Development Shiva MCTS 6 12-06-2007 06:32 AM
Business Software Development hanusoft Software 0 11-16-2007 01:21 PM
DVD Verdict reviews: ARRESTED DEVELOPMENT: SEASON TWO and more! DVD Verdict DVD Video 0 10-11-2005 09:16 AM
The Practice Test Package Development: A New Service on the Certification Market David Johnson A+ Certification 0 01-19-2005 10:52 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46