Discussion on:

7
Comments

Join the conversation!

Follow via:
RSS
Email Alert
0 Votes
+ -
EL and J2SE 1.5
R.Jimenez 21st May 2003
I think we see this trend gaining force even within Sun. The Expression Language that complements the JSP Standard Tag Library (JSTL), albeit not a full-fledged scripting language, definitely shares many of the advantages outlined by the author. Also, some new features in the upcoming release of J2SE like primitive types autoboxing/unboxing are intended to lower the barrier for newbies and make expert developers more productive.

The increased acceptance of RAD and agile methodologies like Extreme Programming, plus the market pressure that Microsoft tools have always exerted based on their much-touted ease of use will definitely give us more and more development enhancements of the kind that scripting languages provide.
*None* of the "disadvantages of scripting languages" apply to Python/Jython:

* Comprehensive: not only are there database drivers written in Python, there's a full SQL RDB written entirely in Python (http://gadfly.sourceforge.net/), and a complete application server with object-oriented database (http://www.zope.org)

* Best practices: Python is fully object-oriented, but also allows use of functional and procedural models if those are more appropriate for the programming task. * General purpose: see item one

Python does have disadvantages, but a narrow range of applicability is not one of them.

Give it a shot - once you get over your addiction to braces, you'll like it a lot.
0 Votes
+ -
So what are the disadvantages of Python?

A Curious PHP Developer
0 Votes
+ -
White Space is one of the biggest disadvantages of Python.
0 Votes
+ -
Python/Jython
Starbuxman 31st May 2003
While Python/Jython is capable of higher level systems apps, Ive found it to be most able in small to middle sized apps -- especially in client development. What follows is a trivial peice of code that makes use of Swing, file i/o (this uses the Jython/python APIs, but you can use java.io.* classes, too.), sys.argv (the String [] args analog), inner classes , event handlers, and more. If you like Jython/see the possibilties check out jython.org / BruceEckel.com / artima.com (it seems all the really powerful (Java) programmers learn Java, get carpal tunnel, then embrace Python using Jython as a stopgap.. wonder why... ).

# run using
# C:/jythoninstalldir/jython file.py nameoffile.txt
from javax.swing import *
from java.awt import *
from java.awt.event import *
import sys

class MyWindow ( JFrame ):
class MyPanel ( JPanel):
def __close(p ,e):
JOptionPane.showMessageDialog( p.par ,'Goodbye')
sys.exit(1)
def __click (p,e): JOptionPane.showMessageDialog( p.par ,'Hello, world.' )
def __init__( p, parent ):
p.par =parent
p.add(JButton( text ='Click me' , actionPerformed= p.__click))
p.add( JButton( text ='Close' , actionPerformed = p.__close ))
def __init__(s) :
cp = s.contentPane
cp.layout = BorderLayout()
file = open(sys.argv [1] , 'r')
cp.add( JScrollPane(JTextArea( \
text= file.read() ,\ rows =8)) , BorderLayout.CENTER)
file.close()
cp.add( MyWindow.MyPanel( s) , BorderLayout.SOUTH)
s.defaultCloseOperation = JFrame.EXIT_ON_CLOSE
s.size = (400,400)
s.title = 'This is the title '
s.visible =1

MyWindow()
0 Votes
+ -
Hmm.. I posted the code above forgetting entirely that the filter might destroy the spacing (the _only_ thing you need to worry about when writing Python -- pointers, braces, semicolons, brackets, etc and more are all useless, but space.. oi.. anyway, http://www.starbuxman.com/articles/python/builder_com%20python.txt has the usable source.
You lost some of your whitespace,
breaking your code.
That is exactly why I won't use Python.
Various editors and transmission methods
and even typos and commenting while debugging
frequently mess up the leading whitespace.
In Python, unfortunately, that can result
in destroying your code.
I don't want the headache of having to
repeatedly go over my code trying to remember
what should be indented under what to fix bugs.
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.