[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IDE Support for Lightweight Languages (Re: "static" declaration)



On Sunday, August 4, 2002, dlw@smartleaf.com (Dan Weinreb) wrote:

>More broadly, the lack of declarations in Perl makes it a lot harder
>to read the code.  For example, the code I am reading is very clearly
>object-oriented programming with classes and instances of classes in
>the utterly classical Smalltalk sense of those words.  However, there
>is no place I can look to find the answer to the question "what are
>the instance variables of this class", since any imperative method
>anywhere is free to just add a new one at any time.  So I am forced to
>trace through all the imperative paths in order to be able to draw my
>nice little notes in my notebook that say what the classes are and
>what their instance variables are.  The need to do this is definitely
>making my job a lot harder and I am not enjoying it.  I really wish
>that all the code that I am currently working on had been written in
>Java instead of Perl (if those two alternatives be the only choices),
>"lightweight" be damned.

Hi Dan,

    I fear that you are confounding two distinct issues here -- that of language
design and development environment support thereof.

    The "lightweight" linguistic elements of Perl aren't the problem, its the
lack of support for their use in your IDE that is. 

    Permitting declarations to appear anywhere or take an implicit form *can* be
a good thing that enhances program comprehensibility, particularly in the
context of a Literate Programming methodology (see: "Literate Programming" by
Donald E. Knuth ISBN 0-9370-7370-6). But this assumes environmental support for
detecting them when they occur and then generate appropriate cross-references to
help you navigate through your code.

    Your example of having to manually trace through all "imperative paths" is a
rather trivial problem if delegated to an IDE.

    Ideally, your development environment should be able to build a visual
representation of the structure implicit in your code base and perhaps even
directly answer questions like "What are the instance variables in class foo?"
through a textual dialog.

    Take a look at DrScheme for an example of what a well crafted development
environment could do for you!

    I would contend that automatically generated cross-references and hypertext
links to related code could provide a lightweight alternative to formal
declarations packed together at the beginning of each file.

    In any case, I really think we need to explicitly factor out the layers of
syntax, semantics, and environment support when making cross-language
comparisons.



Regards,


Peter J. Wasilko