My Fall Software Development Books
I just bought a lot of software development books, mostly centered on Microsoft’s .NET Framework. I have a code base that is getting old and creaky (for example, parts are written in VB6) and it’s time to look at re-doing it, using Visual Studio 2010.
I’m tempted to write everything in a mix of F# and Boo, but I won’t, because it would be hard for almost anyone else to maintain it. Instead, I’m planning on mostly C#, with maybe some IronPython thrown in (for rapid customization).
I’m reading each book quickly first to get an idea of what I can learn, then I will go back in depth for the techniques that I will use.
So what is on my list?
- C# In Depth, Second Edition — to make sure I’m up to speed with all the latest changes to C#. I haven’t read it yet.
- Functional Programming in C# — highly recommended; it’s well written and shows how to use a lot of the functional techniques I’ve come to love from using Python; in short, it makes C# much more usable. However, if you aren’t already familiar with concepts such as closures, first class functions, and lambdas, it’s going to be slow going for a while — and consider learning them in another language first (such as Lua using Programming in Lua).
- The Art of Unit Testing: With Examples in .NET — highly recommended; it provides lots of practical advice and best practices for creating unit tests that work well.
- IronPython In Action — I haven’t read it yet, but it looks good, with a lot of best practices advice.
- Practical Statecharts in C/C++, First Edition — I haven’t read it yet. This book is really aimed at embedded developers, and although I don’t plan on using the author’s Quantum Programming framework, I think I will get some good ideas from it.
The Manning books all include a free PDF of the book when you register your book. I haven’t done this yet, but I will soon.
All my books are real, not e-books, because I prefer real books when learning a new topic, the paper books were cheaper or about the same price, and I won’t buy ebooks that require a proprietary reader (such as Kindle or Apple books).
September 12, 2011 No Comments
Compiling Code for Visual Studio 2003 Without VS2003
Recently, I needed to compile some code for Visual Studio 2003, which I don’t have (I have VS 2002 and VS 2005).
The obvious approach is to convert the project to VS 2005, which uses .NET 2.0. However, I wanted to compile to .NET 1.1 for various reasons, and VS2005 does not allow this out of the box.
The first approach I tried was using the MSBee program. MSBee is a program for MSBuild to allow compiling a program in VS 2005 to .NET 1.1. MSBee requires modifying the project file, and has to be run from the command line. I gave it a try, and it gave me a lot of errors.
I probably could have figured out those MSBuild errors, but I found a better solution: SharpDevelop 2.2. SharpDevelop typically allows you to compile to either the current .NET version or the previous one. So SharpDevelop 2.2 can target either .NET 2.0 or .NET 1.1 — and it can read and convert VS 2003 project files.
Sharp Develop read my VS 2003 solution files without a problem, and I went to the Project menu, selected Project Options, clicked on the Compiling tab, and set the Target Framework to .NET Framework 1.1. Success!
September 2, 2011 No Comments
Write Microsoft .NET code faster with Boo
even if you’re using C# or VB.NET. How? By using Boo’s interpreter to try out ideas, test usage of .NET framework functions, and interact with components (COM, .NET). Then when you’re comfortable, you can write the polished code in the language of your choice.
This is one use for mixed language programming, mentioned by me here, but where the final software might not use both languages.
In fact, any .NET interpreter such as IronPython or IronRuby could be used. And it’s a great technique for other than .NET – I’ve used it a lot with Python on Win32, and you can use it in Java with JRuby, Jython, Groovy, etc. This approach could be very useful for embedded and factory software development.
On .NET IronPython and IronRuby have advantages because they’re official Microsoft languages (and IP has a book coming out – IronPython In Action) and the languages are already in wide use (Win32, *nix, Java). I’m using Boo because it comes with the open source SharpDevelop IDE, and right now it integrates better with .NET (IP does not support attributes well, and it’s not easy to make an IP assembly callable by other .NET languages, etc).
Short example – interactively using DirectoryInfo in Boo (text I typed in bold):
>>> di = DirectoryInfo(“C:\\Download”)
C:\Download
>>> files = di.GetFiles()
(AdbeRdr80_en_US.exe, AdbeRdr80_en_US_Nosso_error.log, Firefox Setup 2.0.0.1.exe, SharpDevelop_2.2.1.2648_Setup.msi, TortoiseSVN-1.4.3.8645-win32-svn-1.4.3.msi)
>>> files = di.GetFiles(‘t*’)
(TortoiseSVN-1.4.3.8645-win32-svn-1.4.3.msi)
Interactively calling a COM object in Boo:
>>> ieType = System.Type.GetTypeFromProgID(‘InternetExplorer.Application’)
System.__ComObject
>>> ie = System.Activator.CreateInstance(ieType)
System.__ComObject
>>> ie.Visible
false
>>> ie.Visible = true
true
>>> ie.Visible
true
So far I haven’t had to use InvokeMember to call COM functions. At least for C# and VB.NET (and probably Boo) it appears you need to use it if you are using late binding. BTW, it is possible to use late binding with COM events, but it is significant extra work.
Tony
September 26, 2007 No Comments