Closely related to programmer efficiency is maintainer efficiency: the ability of a
maintainer (who may be the original developer, 12 months later) to read the code
and deduce what is going on. Perl is often criticized for being ???write-only???; it is easy
to write code that is nearly unreadable to future developers. Such code would have
high programmer efficiency at the cost of maintainer efficiency.*
Ruby wins on both fronts: most Ruby code is easy to write and read, once you know
the basic syntax and semantics.?? Still, diving into any large project such as Rails is
difficult. Here, we discuss ways to begin reading a codebase.
How to Locate Code
One disadvantage of the dynamic nature of Ruby is that there is little opportunity for
development-time reflection on Ruby code. When using a more static language, IDEs
can infer the type of variables, and from that deduce the methods available to those variables.
Thus, they can offer assistance in coding by suggesting variable and method
names. In Ruby, in principle the only way to know the methods available to an object is
to evaluate the expression returning that object??™s value. This is clearly impractical due to
side effects of evaluation or differences in development and execution environment. The
effect is that it is impossible to write a general code-completion-style IDE for Ruby.
In practice, this is usually not a problem.
Pages:
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86