Will's profileWill's spacePhotosBlogListsMore Tools Help

Will's space

Will Perry works and studies in London

wperr on Twitter

Loading...

Countdown

Loading...

Flickr

Loading...
Thanks for visiting!
Please wait...
Sorry, the comment you entered is too long. Please shorten it.
You didn't enter anything. Please try again.
Sorry, we can't add your comment right now. Please try again later.
To add a comment, you need permission from your parent. Ask for permission
Your parent has turned off comments.
Sorry, we can't delete your comment right now. Please try again later.
You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
Complete the security check below to finish leaving your comment.
The characters you type in the security check must match the characters in the picture or audio.
hello just passing
Nov. 6
November 21

Simple Guidelines for Building Reusable .Net Libraries

There are some great (and very thorough) documents out there that can give you fantastic guidance on creating beautiful, reusable .Net libraries, Krzysztof Cwalina's Blog is my personal favourite. Most of it, however, is pretty verbose, very long and just feels a lot like overkill, so here are a few things I've done in the past that seem to work.

  1. The 80/20 Split
    Consider the core functionality that 80% of the library users want to achieve, stick all the classes you need to achieve a solution in that 80% region in a concisely named namespace. Generally this means asking yourself: What do people want to do? and What can I give them to help them do that?
    Next, consider that final 20%: Can your library be extended? If so how? What are the unusual, complex scenarios that require a deeper understanding of the technologies involved to build a solution? Once you figure this out, create a child namespace of your '80%' one and expose only the public types required to achieve that final 20%.
  2. Visibility Modifiers are Your Friend
    (Generally) No one cares about your implementation details - if they do care its usually because your public interface sucks. In summary, if its not vitally important to getting the job done, hide it. Use internal for those important classes that ship data around your library but never see the outside world, mark static holder types as static, and remove the constructors for types that are constructed by a factory. Use 'internal' as the default modifier for type visibility and before changing it to public spend a few minutes thinking:
    1. Does the name of the class really say what it does? (Nobody reads the manual)
    2. Do the constructor arguments convey the minimum information needed to create a 'sane' instance?
    3. Is this class useful to a user? what would they do with it? where would it come from and how is it consumed?
  3. Encapsulation is Your Best Friend
    The user of  your library didn't read the manual, they'll probably ignore the intellisense summaries too. Design your class so that everything you can do, you should do.
    1. Public fields are evil (and inexcusable), use properties instead
    2. (Generally) There is no need to expose a setter on a collection property, so don't do it
    3. Wherever it makes sense, use immutability by marking fields as readonly

More later...

--W

November 20

Microsoft gives birth to wave of new technologies

Wow. Didn't see that coming, not as fast either.
 
In the last 7 days, Microsoft Released Visual Studio 2008, Popfly, Windows Live {Messenger, Writer, Mail, Sign In Assistant, Photo Gallery} and Zune 2. Its going to take me a while to catch up with it all!
 
For now, checkout http://www.winsupersite.com for Zune and Windows Live
and just jump straight to http://www.microsoft.com/express for visual studio
 
-- W
November 06

.Net in the Palm of Your Hand (or the sole of your shoe)

Technorati Tags: ,

Most developers have heard of the .Net framework, some are aware that the framework also runs on mobile devices (the .Net Compact Framework) but many are completely unaware of .Nets new smaller brother: .Net Micro.

The micro framework is a subset of .Net 3.0, although not a subset of the compact framework (it includes serialization features not present in cfx), and weighs in at a miniscule 400K, requiring just 70K of RAM to run. Just let that sink in for a moment. You get a WPF-esque presenation layer, Network Access, garbage collection, the type system, serialization and threading (for starters), all sitting on just 400K of flash with just 70K of RAM. Wow.

The micro framework runs directly on hardware, no operating system (or associated overhead/cost) is required, the devices don't need to be the slave of a PC either: you can literally have micro framework compatible chip with some batteries and a screen sat on your desk running a C# application. The implications of this technology are clearly huge. Suddenly developing new hardware doesn't take years and cost millions, anyone can download the SDK (complete with a customizable, extensible emulation platform) and write managed code to run on a cheap,flexible device. no more low level C/C++, no more bespoke tooling and poor documentation.

I'm hoping to attend another session focused on the micro framework on Wednesday and will be speaking with Dave and Rob a little later for Channel 8.

November 05

Microsoft Announces Availability of Visual Studio 2008

At TechEd EMEA in Barcelona today (05 Nov 07) Microsoft announced the availability of Visual Studio 2008 by the end of this month. The product will still launch in February 2008, along with SQL Server 2008 (codenamed Katami) and Windows Server 2008 (codenamed Longhorn), but will be released an incredible four months ahead of schedule.

Visual Studio 2008 and .Net Framework 3.5 include new versions of the C# and Visual Basic (VB) languages with new features to reduce the gulf that currently exists between data (query) languages and tranditional general purpose languages. LINQ, whilst being on of the most talked about features of the new versions, is not the only thing new, however; the 3.5 framework includes the WCF/WF 'silverbits' which improve the interoperability between Windows Workflow and Windows Communication foundataion: enabling services to be called from workflows, and workflows created by service calls.

The new release of visual studio boasts a wealth of new designers, including a new split view for Web Designers and support for WCF applications using Xaml and the designer codenamed Cider.

 
Public folders