![]() |
|
|
|||||||
![]() |
Python - Re: Web development with Python 3.1 |
|
|
Thread Tools | Search this Thread |
|
|
#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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
> 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 |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
|
|
#5 |
|
Posts: n/a
|
> 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 |
|
|
|
#6 |
|
Posts: n/a
|
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 |
|
|
|
#7 |
|
Posts: n/a
|
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 |
|
|
|
#8 |
|
Posts: n/a
|
> 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 |
|
|
|
#9 |
|
Posts: n/a
|
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 |
|
|
|
#10 |
|
Posts: n/a
|
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 |
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |