defining Why you Use a Static Language with IronPython
Typically, you use a static language with IronPython to gain a specific advantage. For example,
IronPython doesn’t create graphical user interfaces very well, so using a static language to perform this
task could provide a significant advantage in development time. In addition, you could probably reuse
code that you already have on hand, which may reduce debugging time as well. Look for the advantages
that you can gain when using a static language with IronPython. If you have problems describing the
material benefit of an extension, then perhaps you really should look at another solution.
Make sure you consider the strengths of the static language when making your selections. For example,
C# is often the best choice for Win32 API interaction because it supports unsafe pointers — a require-
ment for certain specialized Win32 API tasks. Of course, you should make sure that the use of the
Win32 API is actually required. Perhaps a third-party library already has the solution you require and
with a lot less work. Visual Basic.NET is often the best choice for database work because it takes care
of so many tasks in the background for the developer. You don’t have to worry so much about coercing
data types because Visual Basic addresses the need for you in the background.
Sometimes the use of a static language is practical. For example, you might have an overwhelming
number of developers on your team who know C# or Visual Basic.NET, but know nothing about
IronPython. In general, this is one of the poorest reasons to use a static language with IronPython,
but the reality of development today is that you often use the tools you have on hand to accomplish
the task. No one can afford to have developers sitting on their hands simply because the dynamic
language is the best choice for a particular job.
Understanding Line Noise
There are good reasons to avoid using a static language with IronPython. You can write most code
in IronPython using far fewer lines than a static language requires. Fewer lines of code translate into
higher developer productivity and sometimes into fewer coding errors as well.
The additional code that a static code developer must write is often referred to as line noise. The
code doesn’t substantially translate into useful output, but the static language requires it. For
example, IronPython doesn’t require that you declare the type of a variable — you simply leave
this task to IronPython.
While the extra code in a static language does tend to reduce the potential for unintended output, it
can also make the code harder to read. With every benefit, there’s a corresponding negative. When
548592c16.indd 327
2/24/10 12:49:21 PM
www.finebook.ir
Do'stlaringiz bilan baham: |