Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Feedback on my python framework I'm building.
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Steven D'Aprano  
View profile  
 More options Oct 13 2012, 11:37 pm
Newsgroups: comp.lang.python
From: Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info>
Date: 14 Oct 2012 03:37:09 GMT
Local: Sat, Oct 13 2012 11:37 pm
Subject: Re: Feedback on my python framework I'm building.

On Sun, 14 Oct 2012 05:33:40 +1100, Chris Angelico wrote:
> Forcing programmers to work in one particular style is usually not the
> job of the language/framework/library.

Have you actually programmed before?

*grin*

I've never come across a language/framework/library that DOESN'T force
programmers to work in a particular style, at least to some degree.

Every language encourages certain styles, discourages others, and makes
some impossible. Remember using PEEK and POKE commands with BASIC back in
1978? Pretty much impossible in Python. Perl probably has a way to do it
*wink* but few others do, and thank goodness we've moved on.

The sort of code you'll write in Fortran77 will be significantly
different from that you'll write in Lisp or Java or Forth or Ocaml.
Languages don't just differ in syntax, they differ in what they consider
good idioms, or even *possible* idioms. Hence:

http://dirtsimple.org/2004/12/python-is-not-java.html
http://dirtsimple.org/2004/12/java-is-not-python-either.html

Can you write "Java in Python"? Well, to some degree you can. Any Turing
complete language can be written in any other Turing complete language,
with sufficient layers of indirection, modulo things which are completely
impossible. You simply cannot do C-style pointer manipulations in Python,
not without breaking out of Python (e.g. with ctypes).

Libraries and frameworks are in a similar boat. Can you write CherryPy in
Django? Not easily. Generally the way to ignore a framework or library
and write in a different style is to, well, ignore the framework or
library and write in a different style :)

You can always step outside the bounds of the framework or library and
write something in the programming language level. Just because numpy
doesn't have some function I want, doesn't mean that I can't write it in
Python -- and just because numpy wants to work with arrays doesn't mean I
can't insist in using XML for my data, provided I convert it into an
array each time I pass it to a numpy function and back to XML when it
returns.

(For my next trick, watch as I eat three pounds of high-level radioactive
waste!)

Now clearly some frameworks are lighter than others, some impose their
style on your code like a big heavy weight on a rubber sheet, distorting
everything for miles around. Others not so much. But I really don't see
the problem here: if you don't like the "Twisted style" that it imposes,
don't use Twisted, use another framework, or no framework at all.

I think it is a *good* thing that different languages/frameworks/
libraries have their own styles. The alternative isn't "many styles" but
"one style": an unstylish mess.

--
Steven


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.