Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran-dev] New refactorings for Fortran

On Tue, Dec 15, 2009 at 3:05 PM, Gustavo Rissetti
<gustavorissetti@xxxxxxxxx> wrote:

> The refactorings that I developed are:
>
> Standardize Statements: refactoring that rewrites variables declarations,
> transforming them into simple statements, always containing the two points
> (::) that are characteristic of Fortran, making the code more readable (we
> should probably find a better name for this refactoring :-) ). A small
> example can be seen in Figure 1 attached to this mail.

"Standardize variable declaration" would be a better name.

Does the example show everything this does?  For example, suppose you
declare the dimension of an array on a separate line from the type of
its elements.  Will it move all the information about the array to the
one line where the
array is declared?  Standardizing declarations is great, but are you
doing the whole job?

> Remove Unused Variables: refactoring that removes unused variables in
> Fortran code, making it more readable, and could generate gains of
> performance, depending on the compiler. A small example can be seen in
> Figure 2.

Useful.

> Data To Parameter: refactoring to transform variables declared as data in
> variables declared with parameter attribute, when these are intended to be
> constants in source code. Often, developers who want to use constants can
> confuse the data statement with the attribute parameter, which is the most
> suitable in these cases. Making the substitution can generate performance
> gains, because it decreases the access to variables. A small example can be
> seen in Figure 3.

I think this is the most important one of the three, since it is the
hardest to do by hand.

Thanks!

-Ralph Johnson


Back to the top