[Gllug] question about python/perl
Simon Wilcox
essuu at ourshack.com
Thu Feb 24 14:39:19 UTC 2011
On 24/02/2011 14:14, Martin wrote:
> OK, I've seen the term 'web development framework'. I know of CakePHP,
> Django, and Rails. Now comes my dumb question: what are they for? I
> understand that they speed up web development, but how? What exactly do
> they do? I looked at their websites but still fail to see the point in
> them - Obviously it's not because there's none, it's just I don't get
> it. Do they deal with HTML/CSS/Javascript? Do they insert some PHP
> functionality into the website?
Every web app has a lot of similar features, such as parsing the
incoming query parameters, authentication, connecting to databases etc.
The framework takes care of this so that you're less likely to get it
wrong (SQL injection is one of the common forms of cockup). You can then
concentrate on developing the business logic that is your actual
application.
On the front end, the framework (or rather it's associated templating
system) usually gives you a way to hand data to the HTML designer so
that it's easier for them to include it in their page designs without
becoming too full of code.
It's called separation of concerns
(http://en.wikipedia.org/wiki/Separation_of_concerns). You ideally want
to make it easy to update your HTML design without having to wade
through chunks of code, and vice versa. You'll also see this idea called
MVC (Model/View/Controller
http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller) but
that really applies more to desktop type applications and has been
co-opted for the web. Don't worry too much about trying to stick rigidly
to the MVC pattern but do try to keep the presentation separate from the
logic.
Although this may sound unnecessary if you're doing both html &
development, you'll find that it will make your own code more
maintainable as well as being a useful skill when you're working in
larger teams.
S.
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list