Thoughts from the office by Ed Ball
Tuesday, August 29, 2006

I just finished skimming Pro C# 2005 and the .NET 2.0 Platform, Third Edition, by Andrew Troelsen. Since I didn’t read it properly, I can’t give it a fair review – I guess I’ve read one too many C# books. I didn’t notice anything too surprising, except for the chapter on developing dynamic assemblies with IL, at the end of which he apologizes for not having room to describe the more sane CodeDOM approach.

Overall, the breadth of this book is certainly impressive, but the depth is not there. A number of areas seemed to suffer from small misunderstandings. Furthermore, the attempt to include everything but the kitchen sink only makes more obvious the technologies that didn’t make the cut.

This book might be valuable for an experienced programmer that is approaching the C# world for the first time, but I’m afraid I didn’t find it very interesting.

8/29/2006 11:17:55 AM (Pacific Daylight Time, UTC-07:00) | Comments [0] | Books#
Monday, August 28, 2006

I made it through the 1,210 pages of Pro ASP.NET 2.0 in C# 2005 (by Matthew MacDonald and Mario Szpuszta) without nearly as much skimming as I thought I’d have to do. This book provides amazing breadth and depth in its description of ASP.NET and related technologies. Not only was it an interesting read from start to finish, but it will also serve as an excellent reference in the future. I highly recommend it to any intermediate ASP.NET developers.

Of course, the book is not without problems. Aside from various errors in the source code, there were other noteworthy confusions:

  • There is no static Page.IsPostBack method (page 78) or Page.FindControl method (page 88). The Control class has a Page property that can make it seem so.
  • The examples should always HtmlEncode to underscore the importance of escaping HTML markup.
  • They have a limited understanding of regular expressions, e.g. [\w| ]* should be [\w ]* (page 699).
  • Integrated Windows Authentication can work with Firefox (page 755).

The book does not make the mistake of focusing on Visual Studio to the detriment of understanding the actual technologies, but the authors are sometimes a little too fond of it. I hope they will understand if there are some readers who “still write HTML pages by hand” (page 25) and who “need the HTML view” (page 32).

I took a few notes as I read, so here are a few of the interesting things that I learned:

  • XHTML rendering can be disabled. (76)
  • The ASP.NET Development Helper looks interesting. (100)
  • HTML server controls support limited events (ServerClick, ServerChange) and don’t have to be inside a <form runat='server'>. (113, 119)
  • HttpRuntime.UnloadAppDomain restarts the Web app. (153)
  • global.asax supports lots of events. (156)
  • Custom configuration sections can be defined in App_Code. (174)
  • You can trim view state in a list control. (205)
  • Static properties are preferred to application state. (225)
  • $ expressions bind to app settings and connection strings. (298)
  • aspnet_compiler can be used to precompile a Web app. (653)
  • There’s a wizard interface for adding membership tables to a SQL database. (714)
  • The login user controls can be fully customized with layout templates. (729)
  • LoginView is interesting, and works with roles. (793)
  • Custom control prefixes can be reused, and can be defined in web.config. (902)
  • You can easily write your own templated controls! (930)
  • Request validation can be disabled in web.config. (989)
  • Web service method results can easily be cached. (1120)
  • Exceptions raised from Web services are rethrown as SoapExceptions. (1139)
  • Web service methods can be asynchronous “fire-and-forget.” (1185)
8/28/2006 9:21:37 AM (Pacific Daylight Time, UTC-07:00) | Comments [0] | Books#
Thursday, August 17, 2006

Programming Microsoft Windows Forms, by Charles Petzold, is a great book for programmers that want to learn about the cool new stuff in Windows Forms 2.0, but are already familiar with Windows development using the .NET Framework and C#. If you’re a complete newbie, you might want to start with the prequel to this book, the 1,200 page Programming Windows with C#, also by Petzold.

One of the best parts about this book is that it hardly talks about Visual Studio – it really is important to understand these libraries before you can effectively use the leaky abstractions of the Visual Studio designers.

The coolest new features of Windows Forms 2.0 are the dynamic layout features – automatic sizing, auto scaling, anchoring, docking, flow layout, table layout, etc. This book describes them nicely.

The descriptions of the controls were interesting, if brief, and without enough screenshots. I learned something about the LinkLabel control – I always assumed it implemented a label whose entire content had to be a single link, but it actually supports multiple links and text wrapping.

The ControlExplorer application is fun – you can install it via ClickOnce from http://www.charlespetzold.com/winforms/index.html. It allows you to play with all of the controls available with Windows Forms 2.0.

I also enjoyed reading about data binding. It isn’t as well done as the data binding support in WPF, but it looks usable.

In any case, if you are planning on writing a Windows Forms application with C# 2.0 any time soon, I recommend that you pick up this book.

8/17/2006 10:15:14 AM (Pacific Daylight Time, UTC-07:00) | Comments [0] | Books#
Wednesday, August 16, 2006

Designing Interfaces, by Jenifer Tidwell, was an enjoyable book that gives names, descriptions, screenshots, and rationale for most of the user interface patterns that you have ever seen. It seems to be good reference material for designing a new user interface, and should help ensure that you aren't forgetting a useful pattern.

8/16/2006 7:47:16 AM (Pacific Daylight Time, UTC-07:00) | Comments [0] | Books#
Monday, August 14, 2006

Write Portable Code: An Introduction to Developing Software for Multiple Platforms, by Brian Hook, is a short book with 18 short chapters describing the facets of computer hardware and software that can affect the portability of code. As the subtitle indicates, this is an “introduction” to writing portable code, so there are few specifics but lots of general information. This book should be useful if you have no experience in dealing with portable code, or if you are learning a low-level language like C or C++, where portability issues are more common than with high-level languages like C# or Ruby. Knowing about portability issues is important not only for writing portable code but for porting existing code to your platform, so I would recommend this book to anyone that doesn't already have experience in this area.

8/14/2006 1:00:42 PM (Pacific Daylight Time, UTC-07:00) | Comments [0] | Books#
Wednesday, August 02, 2006

I didn’t enjoy Write Great Code (Volume II: Thinking Low-Level, Writing High-Level), by Randall Hyde, as much as I enjoyed Volume I. The material was mostly either stuff that I already knew, or more detail than I needed to know, or even things that I thought were incorrect.

Understanding the concepts presented in the book is useful for writing code that won’t be needlessly slow. However, the author spends hardly any time reminding the user that the sorts of optimizations that he’s talking about should only be considered when you have a performance problem, and after you’ve profiled your application and established that the area of code in question is the reason for that performance problem.

I probably should have paid more attention as he talked about the specifics of 80x86 assembly, but it just didn’t draw me in, and it is still rather rare that I find myself staring at assembly code for any reason.

All in all, the book is definitely a “low-level” kind of a book, and thus is less useful to a “high-level” programmer of one of the more modern languages. I can’t really evaluate the book from the perspective of someone who has never done any “low-level” programming (I cut my teeth on C, after all) – this book may be one of the few places where “low-level” information can be found at all these days.

8/2/2006 5:31:09 PM (Pacific Daylight Time, UTC-07:00) | Comments [0] | Books#
Search
Archive
Links
Categories
Administration
Blogroll