• PREVIOUS
  • 1 of
  • of
  • 1
  • NEXT

A Brave New World – The changing pace of Microsoft Product Release Updates

The manner and timeliness that Microsoft provides Azure releases has now permutated across it's product range providing us with a challenging New World!

Written by Andy James at 10:30

Categories :

What to do post the demise of Google reader???

For a number of years I have used Goggle reader to pull together and categorize a number of key blogs I follow. The number has risen over the years as the subject matter has grown and now sits at over 150+ blogs. Now not all update daily but I spend around 40 minutes to an hour every morning checking out the various updates. For the last couple of years that has been achieved using FeedlerPro on my iPad and more lately using Modern Reader on my new Lenovo Think Pad Twist (more next blog on this one).

Written by Andy James at 00:00

Categories :

Evernote vs OneNote

Evernote Icon One Note Icon

If you find yourself regularly on customer sites then you will have encountered the issue of taking notes. Personally I find I can hand write notes in a meeting while still concentrating on what has being said. Typing notes I find is distracting not only for me but I detect others at the meeting don’t like people typing whilst they are talking. >>> More

Written by Russell Smith at 00:00

Categories :

Learning lessons from others mistakes!

Warning sign

On March 6th 2013, NuGet.org’s package download was broken for one and a half hours. Unusually for a development team they have accepted the outage was their fault and could have been avoided. The full and frank documenting of the events can be found at the NuGet blog. For the purpose of this blog I am going to focus on the Post-mortem and what lessons can be learnt. Read the full post ...

Written by Andy James at 00:00

Categories :

Microsoft Ship Visual Studio 2012 Update 2

Yesterday Microsoft announced the shipping of the second update to Visual Studio 2012. To quote S. Somasegar the corporate VP of Microsoft’s developer division:

“This release contains important fixes as well as a wealth of new functionality, addressing feedback we’ve received from the community and aligning with key software development trends in the market.  The new functionality primarily spans (though is not limited to) five areas of investment: agile planning, quality enablement, Windows Store development, line-of-business development, and the general developer experience.”

This release builds on the already de-facto tool for .Net development and development management. Of note are the better agile planning aspects, increased quality enablement and the addition of a number of Windows Store and Line-of-business development support items. These updates complement the previously released ASP.NET and Web Tools 2012.2 Update.

I look forward to examining the impact of these over the coming months and how they relate to Solidsoft projects.

Written by Andy James at 00:00

Categories :

Poor, confused C# compiler

 

Originally posted on: http://geekswithblogs.net/cyoung/archive/2013/01/22/poor-confused-c-compiler.aspx

The C# compiler is a pretty good thing, but it has limitations. One limitation that has given me a headache this evening is its inability to guard against cycles in structs.  As I learn to think and programme in a more functional style, I find that I am beginning to rely more and more on structs to pass data.  This is natural when programming in the functional style, but structs can be damned awkward blighters.

Here is a classic gotcha.  The following code won't compile, and in this case, the compiler does its job and tells you why with a nice CS0523 error:

    struct Struct1
    {
        public Struct2 AStruct2
    }

    struct Struct2
    {
        public Struct1 AStruct1
    }

Structs are value types and are automatically instantiated and initialized as stack objects.  If this code were compiled and run, Struct1 would be initialised with a Struct2 which would be initialised with a Struct1 which would be initialised with a Struct2, etc., etc.  We would blow the stack.

Well, actually, if the compiler didn't capture this error, we wouldn't get a stack overflow because at runtime the type loader would spot the problem and refuse to load the types.  I know this because the compiler does a really rather poor job of spotting cycles.

Consider the following.  You can use auto-properties, in which case the compiler generates backing fields in the background.  This does nothing to eliminate the problem.  However, it does hide the cycle from the compiler.  The following code will therefore compile!

    struct Struct1
    {
        public Struct2 AStruct2 { get; set; }
    }

    struct Struct2
    {
        public Struct1 AStruct1 { get; set; }
    }

At run-time it will blow up in your face with a 'Could not load type <T> from assembly' (80131522) error.  Very unpleasent.

ReSharper helps a little.  It can spot the issue with the auto-property code and highlight it, but the code still compiles.  However, ReSharper quickly runs out of steam, as well.   Here is a daft attempt to avoid the cycle using a nullable type:

    struct Struct1
    {
        public Struct2? Struct2 { get; set; }
    }

    struct Struct2
    {
        public Struct1 Struct1 { get; set; }
    }

Of course, this won't work (duh - so why did I try?).  System.Nullable<T> is, itself, a struct, so it does not solve the problem at all.  We have simply wrapped one struct in another.  However, the C# compiler can't see the problem, and neither can ReSharper.  The code will compile just fine.  At run-time it will again fail.

If you define generic members on your structs things can easily go awry.  I have a complex example of this, but it would take a lot of explaining as to why I wrote the code the way I did (believe me, I had reason to), so I'll leave it there.

By and large, I get on well with the C# compiler.  However, this is one area where there is clear room for improvement.

Update

Here's one way to solve the problem using a manually-implemented property:

    struct Struct1
    {
        private readonly Func<Struct2> aStruct2Func;

        public Struct1(Struct2 struct2)
        {
            this.aStruct2Func = () => struct2;
        }

        // Let's make this struct immutable!  It's good practice to do so
        // with structs, especially when writing code in the functional style.
        // NB., the private backing field is declared readonly, and we need a
        // constructor to initialize the struct field.  There are more optimal
        // approaches we could use, but this will perform OK in most cases,
        // and is quite elegant.
        public Struct2 AStruct2
        {
            get
            {
                return this.aStruct2Func();
            }
        }
    }

    struct Struct2
    {
        public Struct1 AStruct1 { get; set; }
    }

Written by Charles Young at 22:06

Categories :

The Mobile Challenge

Gone are the days when we simply had to worry about which browser a web site had to support we now have to consider what ‘form factor’ it is going to be viewed on. Typically at present that breaks into three groups:

             

          1. Desktop or classic web

          2. Tablet

          3. Smart phone

 

Now each of these has a different form factor.

At the beginning of the smart phone rise to prominence the phone manufactures vied with each other around who could render the best ‘minified’ version of any web site. It was irrelevant to the web site designer as the need was small and the reward poor to ‘support’ these niche phones.

With the launch of the iPhone all this changed. In addition HTML 5 arriving and the ability to respond to the form factor of the client started to become important.

Today it is paramount that the web team ‘get it right’ with their support for all viewing clients.

 

There are many theories about how we should achieve this but for today I am going to consider only three:

 

           1. Responsive Design

           2. Adaptive Design  

           3. Responsive, Adaptive Design!

 

Responsive Design

Responsive design is based on a simple premise: design you site, style sheets et al in a manner that allows them to adapt the same site to many screen sizes. Now this design paradigm works really well where the site content is, lets say, on the minimalistic or sparse side. A site that give you just enough but not too much detail. The reason being for my thoughts here are as we ‘adapt’ to the smaller form factor a site  displaying ‘content bloat’ will just look awful on a mobile phone.

That is not to say this doesn’t work just that it may not be the solution.

 

A quick win in the world of responsive design is to try adding the following lines of code to your candidate MVC web site (\Views\Shared\_Layout.cshtml):

 

<meta name="viewport" content-"width=device-width" />

This provides a ‘quick fix’ but not an elegant one.

 

Adaptive Design

This design paradigm is about providing style and content to the particular client. This is typified by the sites that offer a mobile ‘switch’ or url extension.

It requires the developer to provide different web pages for each form factor. This is considerably helped by the likes of JQuery Mobile and the like.

For my buck this is the most sensible way forward. We can have a content rich desktop version but the serve that up in a much more mobile friendly manner. The catch has always been the switch between the two.

 

Responsive, Adaptive Design

‘As it says on the can’ a combination of both recognising the form factor shift we can decide what content and style to present.

 

Over the next few articles I will be attempting to show this in action with a real world example.

Written by Andy James at 10:05

Categories :

  • PREVIOUS
  • 1 of
  • of
  • 1
  • NEXT