Monday, February 28, 2005
World Wind
Words of wisdom
"Do not allow "scope creep" (changes to your initial project objectives) to enlarge your effort. Stick your original idea; generate a "requirements" document, make a list of things you need to do, organize the list (assign the tasks, determine resources you need), and then do.
Why building software is not like building bridges
I was having a conversation with a friend the other night and we came across the age-old “software should be like building buildings” argument. It goes something like this: Software should be more like other forms of engineering like bridges or buildings. Those, it is argued, are more mature engineering practices. If software engineering were more like them, programs would be more stable and projects would come in more on time. This analogy is flawed. Before I begin, I must state that I’ve never engineered buildings or bridges before. I’m sure I’ll make some statements that are incorrect. Feel free to tell me so in the comments section. First, making software, at least systems software, is nothing like making buildings. Engineering a bridge does not involve reinventing the wheel each time. While there may be some new usage of old principles, there isn’t a lot of research involved. The problem space is well understood and the solutions are usually already known. On the other hand, software engineering, by its very nature, is new every time. If I want two bridges, I need to engineer and build two bridges. If I want two copies of Second, the fault tolerances for buildings are higher than for software. More often than not, placing one rivet or one brick a fraction off won’t cause the building to collapse. On the other hand, a buffer overflow of even a single byte could allow for a system to be exploited. Buildings are not built flawlessly. Not even small ones. I have a friend who has a large brick fireplace inside their room rather than outside the house because the builders were wrong when they built it. In large buildings, there are often lots of small things wrong. Wall panels don’t line up perfectly and are patched over, walls are not square to each other, etc. These are acceptable problems. Software is expected to be perfect. In software, small errors are magnified. It only takes one null pointer to crash a program or a small memory leak to bring a system to its knees. In building skyscrapers, small errors are painted over. Third, software engineering is incredibly complex—even compared to building bridges and skyscrapers. The Finally, it is a myth that bridge and building engineering projects come in on time. One has to look no further than It is incorrect to compare software development to bridge building. Bridge building is not as perfect as software engineers like to think it is and software development is not as simple as we might want it to be. This isn’t to excuse the failings of software projects. We can and must explore new approaches like unit tests, code reviews, threat models, and scrum (to name a few). It is to say that we shouldn’t ever expect predictability from what is essentially an R&D process. Software development is always doing that which has not been done before. As such, it probably will never reliably be delivered on time, on budget, and defect free. We must improve where we can but hold the bar at a realistic level so we know when we've succeeded. |
Code metrics tools
- Source Monitor
- NDepend
- Vil
- Peli's Reflector add-in, Reflector.CodeMetrics http://blog.dotnetwiki.org/archive/2004/11/23/1281.aspx
- devMetrics http://www.anticipatingminds.com/Content/Products/devMetrics/devMetrics.aspx"
- http://dotnetjunkies.com/WebLog/johnwood/archive/2005/01/09/42951.aspx looks for branches in the IL to determine the cyclomatic complexity of any .Net binary.
- There's a great little addin called C# Refactory, which provides you all the standard refactoring tools - rename, extract method etc. What everyone ignores is that it also has some industrial strength metrics, including LOC and CC.
.NET Control Gallery
Friday, February 25, 2005
Never send an email in outlook, without the attachment
ZBB - zero bug bounce
At Microsoft there is a stage of the development called ZBB or "zero bug bounce." ZBB basically means that the software teams have taken care of all their open bugs for the current milestone and are ready to transition to the next milestone. ZBB is a cause of much celebrating on the part of the teams since it can be a hard drive to hit the ZBB dates. |
Thursday, February 24, 2005
ComputerZen.com - Scott Hanselman's Weblog - Building your own Windows Media Center Edition 2005 Home Theater PC System
Wednesday, February 23, 2005
Ultimate Developer and Power Users Tools List
- SlickRun - What a wonderful thing. Check out SlickRun. It's fast and small. t's a resizable, floating text box. It does autocomplete for commands and for directories. You can type C:\doc and you're in documents and settings. Awesome. Faster than Dave's Search, and easier than ActiveWords. I shall delete my half-assed attempt at the ZenBar immediately and bow to Bayden Systems.
- Jeff Key's Screen Ruler - Transparent and written in .NET. A great pixel ruler for you pixel pushers.
- APIViewer 2003 - A database and browser of the Win32API, similar to the old win32api.txt file that was distributed with VB6. Includes 6500 function declarations and 55000 constants.
- Application Profiler - A great GotDotNet sample, a tool for visualizing and analyzing allocations on the GC heap. Has a GREAT graphical view
- Anakrino - The original .NET decompiler.
- Denis Bauer's ASP.NET Version Switcher - The ASP.NET Version Switcher is a little utility that can be used to quickly switch the .NET Framework version that the ASPX pages are compiled against. This is helpful for developers who often have to test their web applications for compatibility with different version of the .NET Framework.
- BootDisks.com - I've downloaded and saved everything from BootDisks.com, including Win95 and Win98 boot disks and a DOS 6.22 disk.
- DllFiles - You never know when you might need an old-ass dll.
- Adam Nathan's CLRSPY - A diagnostic that looks at .NET 1.1 Customer Debug Probes, in-freaking-valuable.
- Stoyan Damov's KBView - A Microsoft Knowledge Base Viewer Applet
- Dave's Quick Search Bar - The best thing to happen to the Windows interface since the Command Prompt. Totally configurable, and less invasive than the Google Search Bar.
- PowerMenu - Great little hook that adds item to the System Menu that let you change the Transparency or Priority of the current window.
- ProxyChanger (ja-JP) - A convenient little util if you need to change between proxies at various locations.
- Lutz's Reflector (and all his other tools) - Now the easiest .NET object browser, decompiler (to C# as well!), and includes a great member search feature.
- RoboCopy - When COPY and XCOPY just won't cut it, try the "Robust Copy"
- Aaron Skonnard's Xml Utilities - Includes command line .NET utils to check for wellformedness, validity, and perform xslt transforms. These belong in your PATH!
- Eric J Smith's CodeSmith - Oh, yes, it's much more than just a Strongly Typed Collection Generator. It's a complete code-generation engine with an ASP.NET-like syntax. Very extendable, very powerful, very free. And, only $199 for the source. And all is right with the world. I've used it to generate THOUSANDS of lines of code. There's a learning curve, but the benefits are immense. It's worth the download just for the Strongly Typed Collection code from Chris Nahr.
- Jeff Key's Snippet Compiler - Sits quietly waiting for you to test a quick snippet of code or algorithm. No need to even start VS.NET!
- NUnitAddIn - Makes integrating NUnit into your life easy by integrating NUnit into VS.NET! Right Click | Test. Glorious.
- Virtual TI-89 [Emulator] - Sometimes CALC.EXE doesn't cut it, and I want a REAL scientific calculator for Windows, so I emulate the one I used in college.
- Virtual CD ISO Image Mounter - This is the utility that is up on BetaPlace and is usually released to MSDN Subscribers. It lets you mount an ISO image as a Drive Letter...nice to keep a library of CDs around on a Firewire drive. It's not something I can distribute, but you can always use...
- Nero 6 and ImageDrive - Nero 6 is a fantastic value and the greatest burning suite out there. It also include ImageDrive that let's you make and mount ISO images.
- Visibone HTML/JavaScript Reference - These guys make a great physical paper reference, but they also have a great .HTML file you can download for free that has ASCII charts and Color references. It's a link I keep close by.
- VisualXPath - A nice GotDotNet project that runs XPath Queries interactively and displays the results. Also useful for quick coarse timing of query speed.
- Web Services Studio 2.0 - .NET Webservice Studio is a tool to invoke Web Services interactively. The user can provide a WSDL endpoint and it generates the .NET Proxy immediately.
- SoapScope 2.0 - Your one stop shopping center for SOAP Debugging, WSDL Analysis and SOAP Traffic Tracing.
- WhoAmI Administration Wallpaper Tool - If you log into a lot of boxes remotely and always wonder, where the hell is this? The WhoAmI wallpaper tool creates custom wallpapers with all the information you'd need, like IP Address, Box Name, Disk Space, and it's totally configurable.
- Xenu's Link Sleuth - Xenu's Link Sleuth (TM) checks Web sites for broken links. Link verification is done on "normal" links, images, frames, plug-ins, backgrounds, local image maps, style sheets, scripts and java applets. It displays a continuously updated list of URLs which you can sort by different criteria.
- DeveloperPlayground - Jonas Blunck and Kim Gräsman's great DLL dependency tool, also hooks any process and traces calls to externals DLL
- Alintex .NET Scripting Host - Allows you to create scripts (like like VBS files, etc) except with .NET. Also a great prototyping tool.
- AutoRuns - I always am suspicious that someone is running something automatically on my system. AutoRuns (from SysInternals) checks EVERYWHERE that could be running something, the registry, win.ini (remember those?), the Startup Group, etc...
- ActiveXplorer v4 - A file manager and analyzer for COM objects...a little higher level than OleView and easier to understand.
- BinType2.exe - Ever want to check a VB6 COM dll to see if it's been appropriately compiled with "Retain in Memory" and "Unattended Execution" set to true for correct execution under MTS?
- Clemen's BuildDay.exe - Great commandline util that you should put in your path. Returns the last digit of the year and the number of the day. Great for batch files that create daily builds, log files, etc.
- Microsoft MDAC Component Checker - Utility to diagnose and deal with MDAC compatibility and versioning problems.
- Billy Hollis' ChalkTalk - Great for Presentations, let's you write directly to the screen like John Madden.
- CommandBar for Explorer - This tool extends explorer with functionality of a command prompt. Implemented as a band object completely in C#. Demonstrates COM Interop and P/Invoke, windows hooking and API interception. Finally you can run all these .Net SDK tools and ‘Hello World!’ programs without leaving explorer shell. Definitely turns heads if you use it in a presentation.
- Aurigma COM to .NET - Great tool that simplifies moving from COM to .NET. Analyzes COM objects and shows how to implement that interface with .NET Interop Attributes, etc. Also allows deployment of wrapped COM objects for use with .NET applications, without requiring COM registration!
- Kenny Kerr's DisplayLogonServer - Small app that tells you what Logon Server serviced your domain login. He also has a nice tool that cleans VSS files out of your project folders.
- DxRuler - Great transparent ruler application that overlays a grid of lines over whatever you drag the window over. Good for any kind of interface design, and a great demo of useful transparancy.
- Marc Merrit's Event Log Monitor (EventReader) - Sits in the tray and pops up a nice XP-style baloon whenever the event log is written to. I hate tray icons but I love balloon tooltip info, so it's a good tradeoff.
- FeedReader - The first RSS reader I used. I don't think it's being worked on anymore, but I keep it around because it's lightweight and I'm nostalgic.
- Fesersoft's VS.NET XSLT 1.0 Schema - Enables Intellisense for XSLT 1.0 documents in Visual Studio.NET
- FileMon and just about everything SysInternals has ever produced - Displays file system activity in REAL TIME. Just who is that writing to the disk right now?
- Filter Files with Unknown Extensions for XP - Chris Sell's provides a .REG file that let's explorer's find files with file extensions that are not known. A real irritant with XP, fixed.
- FindUser by Rich MacDonald - Given a Domain name and User name, tells you what systems that user is currently logged in to. (Not sure where to find this, Rich's site is now bare)
- fLogViewer - Great freeware highlighting log viewer for large log files.
- XmlSpy - Just buy it.
- GhostIt - Little tray app that lets you ghost (make transparent) any window by clicking on it.
- HightLight for Windows - Highlight is a universal sourcecode converter for Linux and Windows, which transforms code to HTML, XHTML, RTF, LaTeX or TeX - files with syntax highlighting. (X)HTML output is formatted by CSS.
- IECookiesView 1.5 from NirSoft - Nice clean interface to snoop contents of the cookies on your box in IE.
- ieHttpHeaders - Internet Explorer "Explorer Bar" that shows the HTTP Headers as you browse. Invaluable for quickie debugging. More great stuff from Jonas Blunck.
- COMTrace - Hooks and lets you see COM "traffic" on processes on your system. Intercepts COM calls on any interface. Has saved my ass 3 times.
- JR Screen Ruler - Alternative Screen Ruler. Literally, it's a ruler you can 'virtually' measure things with. Nice when you have to get down to the pixel.
- Zoomin - The original, now with Source from Brian Friesen. If you've seen me talk, you've seen ZoomIn, and hopefully it saved your eyes.
- MSICleaner - This is a small cleaner for those irritating files that don't seem to be deleted from WINNTInstaller (should probably work on Win98, too). You may notice that loads of nonreferenced files from all your work on the installations are left behind, and this tool helps to keep your machine clean.
- NetPing - Jeff Key's multi-threaded pinger...it continues to include new features, like right-click and launch Remote Desktop. Great for administration of small networks. I use it all the time.
- Magical Jelly Bean KeyFinder - Misplace your Windows and Office Product Keys? Find them with this.
- NetworkDriveInfo - Helps you find free drive space on remote systems.
- UrlRun plugin for Outlook - From Tim Tabor based on Chris Sells' UrlRun. Lets you right-click on messed-up and wrapped URLs in Outlook and launch the browser without manually fixing the URL. Chris Sells says "It's pure sex."
- Speak-n-stop - Little timer util that you start when you begin a presentation and it warns you when your speaking time is running out.
- IE Booster 2 - A collection of extensions to Internet Explorer like HTML Detective, Copy Meister, and Page Analyzer.
- YATT by Simon Fell - Yet Another Trace Tool, requires WinPCAP, when you just need to sniff some packets.
- PPXML - Command-Line XML Pretty Printer
- ProxyTrace - Often better and less trouble than the Soap Toolkit's SOAPTrace.
- PSTools from SysInternals - All the command-line tools that Windows forgot...kill, loggedon, remote exec, shutdown, getsid, etc.
- QuickCode.NET - Lets you turn short phrases in Visual Studio.NET like "prop int test" into a complete property getter and setter with xml documentation, etc. Configurable and the snippets are shareable.
- Roy Osherove's Regulator - Roy enters the RegEx fray with a bang, and with syntax highlighting and web services integration with regexlib.com. The very definition of slick.
- Eric Gunnerson's Regular Expression Workbench - Nice .NET interactive Regular Expression builder.
- Expresso is a new free tool for working with regular expressions in .NET.
- RegexDesigner.NET from Chris Sells
- The Regular Expression builder inside of SharpDevelop (which is worth the download just to read the SharpDevelop code!)
- Reggie - Not a regular expression tool, not it's a BETTER RegSvr32.exe from Shawn Van Ness. It provides better error handling and messages. It doesn't suck.
- SCCSwitch - Harry Pierson's ruthlessly competent Source Control Provider switcher for VS.NET. Great if you are using Vault, VSS and CVS like me.
- Who's Locking? - WhosLocking.exe lets you know what application is locking that DLL you're trying to delete!
- TrueName - Right click a file in Explorer and find out it's TRUENAME (Remember the Truename.exe?) The 8.3 name of My Documents might be C:DOCUME~1SHANSELMMYDOCU~1.
- Sid2User - CommandLine Util to take a SID and get a Real Name to, for example, get the local name of the "Everyone" user.
- SummerProperties - a Shell Extension that adds a Tab to File Properties that calculates the file's checksum.
- TamperIE - Let's you intercept and tamper with Form Posts from within IE...
- Zoltan's TaskManagerEx - Extends the existing TaskManager with a new menu and CPU Alerts, colors Services, modules in use, etc.
- TextView 5.0 - Freeware Text Viewer that lets you run through many directories with many files, much like explorer, except everything is one click.
- VisiCalc (vc.exe) - Because I just like having a copy of VisiCalc in my utils folder. I use it occasionally.
- Fritz Onion's ViewStateDecoder - Simple util that gives you more insight into what's hidden inside of ASP.NET's ViewState (hidden form field)
- DevelopMentor's Tools Page - Everything here is golden.
- RealVNC - When RemoteDesktop is a hassle and PCAnywhere is lame...VNC stands for Virtual Network Computing. It is remote control software which allows you to view and interact with one computer (the "server") using a simple program (the "viewer") on another computer anywhere on the Internet.
- VS.NET Command Prompt Here - INF files to create Right-Click menus for "Visual Studio.NET 2003 Command Prompt here." I use this dozens of times a day. I should probably just keep the window open, eh?
- WHICH - It's which and it's back. Wondering WHICH copy of that .exe is being run first in the path? Run "which calc.exe"
- WhiteBoard Photo - Has to be seen to be believed. Takes a skewed low-contrast, bad photo of a Whiteboard and automatically corrects it and offers up a clean white sheet of paper with a color corrected and keystoned photo of your whiteboard. Check out the demo.
- URL Bandit - Monitors the clipboard and saves all URLs that go by in the click-stream. If you copy a 1 meg file to the clipboard, URL Bandit can find, for example, all 200 URLS within it. Yum.
What great .NET developers ought to know
What Great .NET Developers Ought To Know
Everyone who writes code
- Describe the difference between a Thread and a Process?
- What is a Windows Service and how does its lifecycle differ from a "standard" EXE?
- What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?
- What is the difference between an EXE and a DLL?
- What is strong-typing versus weak-typing? Which is preferred? Why?
- Corillian's product is a "Component Container." Name at least 3 component containers that ship now with the Windows Server Family.
- What is a PID? How is it useful when troubleshooting a system?
- How many processes can listen on a single TCP/IP port?
- What is the GAC? What problem does it solve?
Mid-Level .NET Developer
- Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming.
- Describe what an Interface is and how it’s different from a Class.
- What is Reflection?
- What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?
- Are the type system represented by XmlSchema and the CLS isomorphic?
- Conceptually, what is the difference between early-binding and late-binding?
- Is using Assembly.Load a static reference or dynamic reference?
- When would using Assembly.LoadFrom or Assembly.LoadFile be appropriate?
- What is an Asssembly Qualified Name? Is it a filename? How is it different?
- Is this valid? Assembly.Load("foo.dll");
- How is a strongly-named assembly different from one that isn’t strongly-named?
- Can DateTimes be null?
- What is the JIT? What is NGEN? What are limitations and benefits of each?
- How does the generational garbage collector in the .NET CLR manage object lifetime? What is non-deterministic finalization?
- What is the difference between Finalize() and Dispose()?
- How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization?
- What does this useful command line do? tasklist /m "mscor*"
- What is the difference between in-proc and out-of-proc?
- What technology enables out-of-proc communication in .NET?
- When you’re running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?
Senior Developers/Architects
- What’s wrong with a line like this? DateTime.Parse(myString);
- What are PDBs? Where must they be located for debugging to work?
- What is cyclomatic complexity and why is it important?
- Write a standard lock() plus “double check” to create a critical section around a variable access.
- What is FullTrust? Do GAC’ed assemblies have FullTrust?
- What benefit does your code receive if you decorate it with attributes demanding specific Security permissions?
- What does this do? gacutil /l | find /i "Corillian"
- What does this do? sn -t foo.dll
- What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
- Contrast OOP and SOA. What are tenets of each?
- How does the XmlSerializer work? What ACL permissions does a process using it require?
- Why is catch(Exception) almost always a bad idea?
- What is the difference between Debug.Write and Trace.Write? When should each be used?
- What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?
- Does JITting occur per-assembly or per-method? How does this affect the working set?
- Contrast the use of an abstract base class against an interface?
- What is the difference between a.Equals(b) and a == b?
- In the context of a comparison, what is object identity versus object equivalence?
- How would one do a deep copy in .NET?
- Explain current thinking around IClonable.
- What is boxing?
- Is string a value type or a reference type?
- What is the significance of the "PropertySpecified" pattern used by the XmlSerializer? What problem does it attempt to solve?
- Why are out parameters a bad idea in .NET? Are they?
- Can attributes be placed on specific parameters to a method? Why is this useful?
C# Component Developers
- Juxtapose the use of override with new. What is shadowing?
- Explain the use of virtual, sealed, override, and abstract.
- Explain the importance and use of each component of this string: Foo.Bar, Version=2.0.205.0, Culture=neutral, PublicKeyToken=593777ae2d274679d
- Explain the differences between public, protected, private and internal.
- What benefit do you get from using a Primary Interop Assembly (PIA)?
- By what mechanism does NUnit know what methods to test?
- What is the difference between: catch(Exception e){throw e;} and catch(Exception e){throw;}
- What is the difference between typeof(foo) and myFoo.GetType()?
- Explain what’s happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?
- What is this? Can this be used within a static method?
- What is the purpose of XML Namespaces?
- When is the DOM appropriate for use? When is it not? Are there size limitations?
- What is the WS-I Basic Profile and why is it important?
- Write a small XML document that uses a default namespace and a qualified (prefixed) namespace. Include elements from both namespace.
- What is the one fundamental difference between Elements and Attributes?
- What is the difference between Well-Formed XML and Valid XML?
- How would you validate XML using .NET?
- Why is this almost always a bad idea? When is it a good idea? myXmlDocument.SelectNodes("//mynode");
- Describe the difference between pull-style parsers (XmlReader) and eventing-readers (Sax)
- What is the difference between XPathDocument and XmlDocument? Describe situations where one should be used over the other.
- What is the difference between an XML "Fragment" and an XML "Document."
- What does it meant to say “the canonical” form of XML?
- Why is the XML InfoSet specification different from the Xml DOM? What does the InfoSet attempt to solve?
- Contrast DTDs versus XSDs. What are their similarities and differences? Which is preferred and why?
- Does System.Xml support DTDs? How?
- Can any XML Schema be represented as an object graph? Vice versa?
Tuesday, February 22, 2005
Whats the difference between Control.Invalidate, Control.Update and Control.Refresh? (.NET)
Control.Invalidate() v/s Control.Update() v/s ControlRefresh()
Before discussing each one of the above functions, let’s look at how winforms controls paint.
Windows controls paint is response to WM_PAINT messages. This message is sent when UpdateWindow or RedrawWindow is called, or by the DispatchMessage function when the application gets a WM_PAINT through the message queue. On getting the WM_PAINT message, the control paints its background and then the foreground if necessary. Double-buffering and transparency is honored while painting and then the OnPaint event is fired to give the user a chance to perform his custom painting.
With this background, let’s look at the above mentioned three functions in more detail,
Control.Invalidate( ) / Control.Invalidate(bool) / Control.Invalidate(Rectangle) / Control.Invalidate(Rectangle, bool) / Control.Invalidate(Region) / Control.Invalidate(Region, bool)
The bool parameter denotes whether the user wants to invalidate the child controls of the control on which he is calling Invalidate. The Rectangle parameter are the bounds to invalidate and the region parameter is the region to invalidate. All the overloads essentially end up calling one of the RedrawWindow, InvaliateRect or InvalidateRgn functions. If RedrawWindow is called then this may result in a WM_PAINT message being posted to the application message queue (to invalidate the child controls).
The important thing to note here is that these functions only “invalidate” or “dirty” the client area by adding it to the current update region of the window of the control. This invalidated region, along with all other areas in the update region, is marked for painting when the next WM_PAINT message is received. As a result you may not see your control refreshing (and showing the invalidation) immediately (or synchronously).
Control.Update()
Update function calls the UpdateWindow function which updates the client area of the control by sending WM_PAINT message to the window (of the control) if the window's update region is not empty. This function sends a WM_PAINT directly to WNDPROC() bypassing the application message queue.
Thus, if the window update region is previously “invalidated” then calling “update” would immediately "update" (and cause repaint) the invalidation.
Control.Refresh()
By now, you might have guessed what Refresh( ) would be doing. Yes, it calls Invalidate(true) to invalidate the control and its children and then calls Update( ) to force paint the control so that the invalidation is synchronous.