Datasheet

10
Part I: Design Strategies
Visual Basic provides a convenience item not found in C#. You receive automatic wire-up of events with
event handlers using the handlers construct. Although this is a small feature, it does improve developer
effi ciency and makes it possible to see the wire-up in the same place that the event handler appears.
Developing with Multiple Languages
Most applications you create use a single language because this tends to reduce the cost of updates later,
and using a single language makes the code signi cantly more manageable. However, your team may
consist of a mix of developers, in which case, using the languages that each developer knows will make
the development process faster. In addition, some languages do provide capabilities that are not robust
enough. For example, even though C# does provide great P/Invoke functionality, you may still fi nd an
occasion to use C++ for native code modules. The three languages commonly used with C# are:
Visual Basic.NET
Visual C++
F#
Of course, you can use any language you want with C#. Some developers use IronPython (see
http://
www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython
for details) with C# when they
need Python fl exibility matched with .NET capability. The following sections describe some of the
benefi ts of using additional languages.
Using Visual Basic.NET
Some organizations view Visual Basic.NET with disdain due to its naming similarity with the ancient
BASIC language. The two languages couldnt be more different. Visual Basic.NET provides signifi cant
capability and exceptional development performance. The fact that Visual Basic.NET often hides com-
plexity that C# developers must deal with as part of their development environment means that you
can use it to create code fast. Visual Basic.NET also tends to protect the programmer more from acci-
dents that C# developers must keep in mind, such as numeric over ows. It isnt a bad idea to require
less-profi cient developers to use Visual Basic.NET until they gain experience.
Using C++
It’s easy to think that C++ has seen better days and then relegate it to the dustbin alongside COBOL
and FORTRAN. Interesting as it may seem, companies today are actually looking for a few COBOL and
FORTRAN programmers to maintain the huge mass of code written in an earlier time for mainframes
that still work today. In fact, you can read an article about the need for COBOL programmers in
California at http://weblog.infoworld.com/tech-bottom-line/archives/2008/08/
calling_all_cob.html?source=NLC-DAILY&cgd=2008-08-07. C++ is an older language, but its also
a capable language that can help you bridge the gap between the managed programming environment
and Windows.
Using C++ is almost mandatory in some cases. For example, if you have a real-time application that
works with specialized equipment, such as factory automation, C++ is almost a required part of your
application development plans. C# does provide better capabilities than most .NET languages for work-
ing with low-level code, but it can’t fulfi ll every low-level need easily. The coding becomes quite messy
at some point with a host of unsafe code sections. You may as well use C++, a language designed to get
the low-level programming task done.
15962c01.indd 1015962c01.indd 10 1/23/09 5:45:00 AM1/23/09 5:45:00 AM