Shinyshell Community Forums > Coding >
A Question Regarding Frameworks


[1]


June 12 02009, 02:13 GMT
Peter*
A Pythonic One

Peter's avatar
Location: US
Post count: 99

What are they? What is their purpose? I've seen examples of several in Python, PHP, and Ruby, which led me to ask.

June 13 02009, 12:11 GMT
lec**
Supra stultitiam

lec's avatar
Location: Varaždin, Croatia
Post count: 173

They make it easier to develop a web application, for instance. Often, they provide feature-rich templating systems and various other tools that make developing a website quicker. Basically they help you arrange your code and start working on your content and site coding without having to code up the basic features like a template management system.

A common framework type is MVC (model-view-controller - it's actually a design pattern). It takes some getting used to, but it's really quite awesome for larger sites.

Two particularly good frameworks are Rails for Ruby, and Catalyst for Perl. The available PHP frameworks aren't so good (CakePHP is okay, but I wouldn't use it - besides PHP is well adapted for the web, so it's easy enough to use without a framework). Python has the Django framework, which is really great to work with but extremely inefficient and is a resource hog (so don't use it).

June 17 02009, 03:04 GMT
Peter*
A Pythonic One

Peter's avatar
Location: US
Post count: 99

So basically, they basically simplify things for you as a programmer. Does that mean JQuery (<3) is a framework for JavaScript?

What framework do you recommend for Python development? I've heard frameworks make GETting variables more simple.

June 17 02009, 09:01 GMT
lec**
Supra stultitiam

lec's avatar
Location: Varaždin, Croatia
Post count: 173

Indeed, you could call JQuery a framework, since it provides you functions and objects you can use to simplify your scripting, and it changes the way you write code.

I don't really like any of the available Python frameworks, though if I had to use one, I'd probably go with pylons. I wrote my own "framework" of sorts in Python when I was making this site; it borrows lots of ideas from Perl and PHP (all that which made my life simpler), so I just use that.

June 17 02009, 15:48 GMT
Peter*
A Pythonic One

Peter's avatar
Location: US
Post count: 99

Sorry to go off topic...

As a language, you say you like Python. Do you also like Perl and/or Ruby? I REALLY like how PHP is adapted for web use. Python ISN'T. D: I don't like that part of it. With PHP you can do like this:

 <html>
 <head>
 <title>hehe</title>
 </head>
 
 <body>
 <div id="content">
 <?php
 $id = $_GET['id'];
 
 if(!isset($id))
 {
 $page = "main.php";
 }
 
 elseif(!file_exists($id . ".php"))
 {
 $page = "error.php";
 }
 
 else
 {
 $page = $id . ".php";
 }
 
 include($page);
 ?>
 </div>
 </body>
 
<html>
<head>
<title>hehe</title>
</head>

<body>
<div id="content">
<?php
$id = $_GET['id'];

if(!isset($id))
{
$page = "main.php";
}

elseif(!file_exists($id . ".php"))
{
$page = "error.php";
}

else
{
$page = $id . ".php";
}

include($page);
?>
</div>
</body>
]]>


But in Python, wouldn't you have to print each part? =/

EDIT: Another question. It seems to me that FastCGI is the only option with Dreamhost and that Pylons is not available...? Can you further explain this in any way?

June 24 02009, 13:44 GMT
lec**
Supra stultitiam

lec's avatar
Location: Varaždin, Croatia
Post count: 173

I like Perl and Ruby about as much as Python, though I usually use Python because I know it the best (for now) and also because it's the cleanest and most readable. I'm learning Ruby now.

PHP was designed for use on the web (although not very well) while Python was not. Consequently, PHP pages are just HTML with embedded code that is handled by the interpreter, while Python can be used to make desktop apps as well.

In many web apps, templates are usually used which eliminate the need to jump in and out of PHP anyway, so Python makes up for not having that feature.

About Pylons, it works well with Apache and FascCGI, so I reckon you should be able to use it. I think I remember Dreamhost saying that Django was usually not allowed because of the resource use issues. Pylons should be alright, though.

June 25 02009, 16:31 GMT
Peter*
A Pythonic One

Peter's avatar
Location: US
Post count: 99

Do you know how to set it up for Dreamhost?

This is a link to a post I found by Googling "dreamhost pylons," and I was seriously confused by it. I'm not sure how to do this. XD

June 28 02009, 19:39 GMT
lec**
Supra stultitiam

lec's avatar
Location: Varaždin, Croatia
Post count: 173
hr
I kind of do, but it's rather complicated as you need to create your own installation of Python on the server via SSH, and it's not completely straightforward. I could tell you how to do it, but most of it is on the Dreamhost Wiki Python page.


[1]



Forum Information
  Currently Active Members [detailed] (0 members and ? guests)
-
Forum Statistics
Topics: 0, Posts: 0, Members: 108.
Welcome to our newest member, adamthephantump
Most members online was 5, on August 28 2009, at 21:49:28.
Legend
    Forums with unread topics in them are indicated by a strong yellow colouring around the forum icon.
    Forums with no unread topics have the standard pale yellow colouring around the forum icon.
    Forums with a blue arrow icon will redirect you to a non-forum page.
    Locked forums have a little padlock by their icon. You won't be able to post in these forums.
Shinyshell Home | Contact | Staff List | Archive | Top 

Conventional Login

Don't have an account? You may want to create one.

OpenID Login
OpenID login and registration is usable, but not finished.
What is OpenID?
Search

(advanced search)
Site Stats
  Total members: 108
  Latest member: adamthephantump
  Members currently online: 0
  Most online: 5 - Aug 28, 2009 (21:49)
  Front page hits: 88119
Developer info
  Site version: 3.5 Alpha
  16 queries - 9 templates
Under the Spotlight
Collide Site
Collide make fabulously dreamy electronic-industrial music, they're one of my favourite bands! Give them a chance to take control of your life - myspace | youtube - "Euphoria".

Collide Site - Hits: 4926

5/5 (2) | Rate this site?