I have heard that the more you try to make Javascript behave like
Python, the more you end up hating Javascript -- but that says nothing
about Javascript itself.  Javascript is really a different language,
with different strengths.  Perhaps the best plan is to use Javascript
for its strongest points (for example instant-turnkey use of JSON,
totally anonymous objects, function mutability, etc.) and do your more
Pythonic tasks in Python.  Pylons makes it quite easy to leave as much
of your logic as you wish in your controllers and keep your client-
side view code very very thin.  Especially if you use a lightweight,
concise JS framework like jQuery to help keep things readable and
organized.

That still leaves the case of the programmer who says, "I want to keep
as much logic as possible on the client side to ease my server load,
but I hate Javascript".  In that case I don't have any good advice.

Intuition suggests to me that by the time you finish developing a user
interface in python compiled to javascript, this strategy could
backfire when it comes to the effort required for maintaining it, and/
or the potential for keeping it as lightweight as possible.  I could
certainly be wrong, having never put Pyjamas to the test.

Don't get me wrong; I think Pyjamas is a great idea, and if someone
weren't developing it, then someone else would have needed to invent
it too.  However, I want to quote the following from the pyjamas
website:

<quote>
 Why should I use it?

You can write web applications in python - a readable programming
language - instead of in HTML and Javascript, both of which become
quickly unreadable for even medium-sized applications. Your
application's design can benefit from encapsulating high level
concepts into classes and modules (instead of trying to fit as much
HTML as you can stand into one page); you can reuse - and import -
classes and modules.
</quote>

The claim that Javascript "become[s] quickly unreadable for even
medium-sized applications" really reflects only on the individual
programmer/developer and not on the language, honestly.  Javascript
does not deserve to be compared to (e.g.) php, an unruly beast that
literally encourages a mess.  Javascript is, at worst, neutral with
respect to organization; at best it embodies the heights of
abstraction, encapsulation, and readability.  It's all up to you.

But if you don't like Javascript, you have plenty of company.
Including myself somewhat recently before I studied it more thoroughly
and started trying harder with it ;-)

Good luck in any event.


On Dec 5, 3:15 am, Kless <[EMAIL PROTECTED]> wrote:
> I've looking for any bridge between python and JS to building easily
> the user interfaces (client side). --I dislike JS, and it's heavy to
> have to know and deal with HTML, CSS JS and the API of any JS
> framework--
>
> Ago time I had seen Pyjamas [1], "a stand-alone python to javascript
> compiler, an AJAX framework / library and a Widget set API." It
> already has been released a stable version (0.4)
>
> I found a great article [2] about it and in general about programming
> on client side. What do think about pyjamas? I think that would be
> fantastic developing all web application into a same language, in
> addition it could speed up enought the time on developing.
>
> I would to know if Pyjamas could be easily integrated on Pylons.
>
> [1]http://pyjamas.sourceforge.net/
> [2]http://advogato.org/article/993.html
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to