Interview with Andrew Troelsen



  • "C# and the .NET platform" was finished in early 2001 when .NET was still in Beta1. MSDN Help pages for Beta1 were mostly empty. There were very few sources of concrete technical information about .NET at that time, most of which simply listed class members or made marketing slogans. Most importantly, it was very difficult to judge which parts of .NET would play more important role than others. How did you succeed in writing such a mature and complete book and to pick the right features of the platform that endured through the last 3 years?
    Thanks for the complement!
    I wrote the book by making a choice to avoid sleep for about a year and half and to reformat my computer nightly ;-)

    Honestly, when I started the first edition, .NET was termed NGWS (Next Generation Windows Services), and C# really was termed COOL. I received a bunch of alpha-bits from Microsoft, installed them, and just dove into the fire. Most of what I learned was through class browser tools, such as wincv.exe and ildasm.exe. Once I had a clue how something might work, I wrote some sample code (if I was lucky it even ran). I also had some contacts at Microsoft, whom I could bounce a question, when I was totally at the end of my rope. When it came to which topics to pick, I knew the syntax of C# would be critical, as would core aspects of the base class libraries (File IO, Windows Forms, etc), and the assembly concept. So I tried to stick close to these key atoms. Even so, it was a pain in the neck, as I had to constantly re-write chapters with each build I was sent (you would not believe all the changed the event model went through).
  • .NET 2.0 is currently in Beta 1, and a few developers are trying to find out how it works. With Microsoft's documentation almost nonexistent, what would you recommend as a good strategy to learn .NET 2.0?
    For those who like hard-copy, many existing .NET books are being upgraded for the third edition (including my own), but this will still take some time. Until then, I would recommend the MSDN web-site (www.msdn.com). Here you will find numerous links to related content, including Visual Studio.NET 2005, C# 2.0 and .NET 2.0. To get started, I'd recommend searching MSDN for the following articles:
    -A Sneak Preview of Visual C# Whidbey
    -An Introduction to C# Generics
  • There a few very interesting features in .NET 2.0. When are you planning to have a third edition of your book and what will it cover?
    All of the C# 2.0 language topics will be covered (generics, enumerators, partial types and so forth). As far as .NET topics, each chapter will be updated with 2.0-centric information. For example, the ASP.NET chapters will examine master pages, themes, etc. I am also planning new general topics such as code generation, dynamic assemblies, and a chapter on the syntax of CIL code.
  • The second edition is almost 200 pages thicker than the first. How thick will be the third? Won't you go over (hardbound) limit?
    To make way for this new content, I will (sadly) have to cut some existing chapters from the second edition. For example, I plan to 'crunch' the two chapters that covered System.Windows.Forms into a single updated chapter. This will save some room. Another plus is that Apress has a new binder, which is able to work with higher page counts. The book will be (eventually) in hard cover, but the first limited run of the third edition (which should cover the final beta) will be soft cover. Once 2.0 has gone gold, the book will be printed in hardcover (at least, that is the plan today!)
  • You are an instructor at Intertech and you are working side by side with Java instructors. Do you sometimes feel that many of .NET features have been known to Java community for a while?
    In a way, yes. Before I began working with the CLR and managed languages, I was a C++ /COM programmer. I remember watching my Java cohorts with envy as they leveraged a rich class library and lived in a pointer free world. It is true that C# and Java share many syntactical constructs, but that is because they are in the same language family. C++, Java, Objective C, and C# all look very similar. Syntax aside, the .NET platform does many things quite differently (and in many cases, more simply) than J2EE. One aspect of .NET, which I do think it very unique, is it's intrinsic support for attributes. In standard Java, the closest we can get to attributes would be the use of marker interfaces, which have their limitations. .NET attributes are extremely powerful, as they basically provide a way to build new keywords on the fly.
  • Do you have a blog? If not, when are you planning to get one?
    That is on my ToDo list, but I just have no time right now. I have started working on a blog twice, but I always hate what I created and never upload it! One day I'll get there...
  • Second edition of "C# and the .NET platform" features a big chapter on Remoting. How does Remoting performance compare to performance of a web service?
    Currently, .NET remoting does tend to produce zipper execution speeds than XML Web services simply because of the underlying wire format (assuming your remoting applications are use the TCP Channel). I think that the bigger issue for many developers is not necessary speed but reach. If you are building a distributed application, which needs to be reached by numerous platforms (.NET, J2EE, COM) and operating systems (Win32, Mac, Linux) then Web Services would be the simplest choice given that all of these systems and platforms can parse string data and get an HTTP connection. However, if you are building an distributed application where all machines are .NET aware, Remoting has many appealing features (Distributed objects, simple state management, customization of sinks / channels / formatters / etc).
  • What are your professional plans for the next few years?
    Currently, I have been writing a number of articles for MSDN online as well as for MacTech (talking about platform independent .NET development). I'm sure I'll be working with MSDN for the next two years as well. I have been working quite a bit on the platform agnostic nature of .NET. At my 'real' job at Intertech Training (www.intertechtraining.com), I am working with .NET programming on Macintosh, FreeBSD, and Linux using Mono and Portable .NET. This has been extremely interesting, especially when I was able to install Linux on my Playstation 2 and compile .NET code (ah, the life of a computer geek). Once my 3rd edition of the C# book is wrapped up, I am planning a new book, but I'll have to keep that under wraps for now ;-)
  • Mono project got a fairly late start but, finally, it is in 1.0, and it compares favorably to MS .NET 1.0. Andrew, what is your experience with Mono? Windows Forms library has not been released as part of Mono 1.0. Even though Mono lists Windows Forms as "under heavy development", it is not part of Mono roadmap either. Do you think it is a good time to start learning GTK# :-) ?
    For the reader who is not aware, the .NET platform is not tied to the Win32 OS. Two open source implementations of the Common Language Infrastructure (CLI) are gaining great support:
    - Mono 1.0 (www.mono-project.com)
    - Portable .NET (www.dotgnu.org)
    Mono is perhaps the most well known .NET implementation; however, both run under Unix, Linux, Mac OS X, and Win32 (among others). What does differ is their support for a widget toolkit. Mono's philosophy was to extend the GTK+ toolkit to become .NET-aware, hence the birth of GTK#. This toolkit will build rich GUI front ends using C#; however, the model looks little like System.Windows.Forms code. Mono is building a Microsoft .NET compatable Windows Forms assembly, but currently it dependes on WINE (which is a bummer, although rumor has it Mono's Win Forms may be rewritten to avoid WINE dependencies). As of Mono 1.0, the 'correct' answer is to start learning GTK# :-)
    Portable .NET took a much cleaner solution and build a MS .NET compatible Windows Forms assembly (also named System.Windows.Forms.dll), which is written using C# (thus, no WINE dependencies). In my view, Portable .NET is the 'correct' platform independent .NET GUI toolkit in that it really is 'portable'. Another cool aspect of PNet's WinForm implementation is its support for themes! You can build a C# Form and have it take the look and feel of the hosting windows manager (Mac, Gnome, KDE, Windows, Window Maker, etc). I would also like to mention that wxWidgets has also been made .NET-aware. The wx.NET toolkit is yet another GUI option, which also supports themes (http://wxnet.sourceforge.net/)








Copyright© 2004-2006 Aleksey Nudelman