This is a mirror of official site: http://jasper-net.blogspot.com/

Eight Reasons C# is the Best Language for Mobile Development

| Thursday, January 3, 2013
The statisticians behind the Popularity of Programming Languages (PYPL) index have named C# the language of the year for 2012. Their data shows that C# popularity grew by 2.3 percent in 2012, more than any other programming language during the same period.

What accounts for the growth of C# in 2012? Well, the launch of Windows 8 has probably played a role — C# remains the dominant language of third-party application development on Windows devices.

But we think there’s more to it than that. Here are eight reasons why C# is increasingly the programming language of choice for mobile development:

  • Cutting edge – asynchronous programming as a first-class language feature turns what is typically regarded as boring, repetitive and error prone coding into a simple and delightful experience. And anonymous types, lambda expressions, type inference, functional-style programming and LINQ allow developers to write code that is highly expressive and easy to maintain.
  • Powerful features – object-oriented programming and encapsulation make it easier to structure code for maximum reuse. Capabilities like reflection and dependency injection offer developers a lot of power and flexibility.

Read more: Xamarian
QR: Inline image 1

Posted via email from Jasper-net

Practical approach to Memento design pattern

| Sunday, December 30, 2012
Introduction  

Many times we face a situation where we need to store the state of an object. One of the best examples is rollback operation where we need to restore the application to some previous state. This can be achieved by creating a copy of the object at certain point of time while working on the actual object. The actual object stores the list of own objects as a state. The object can be restored to some previous state through the list of objects. This approach is memory intensive as we keep a copy of the object at the defined states. The other drawback is violation of encapsulation in order to store the state of an object as we have to expose the internal state of an object such as member variables. Also, if we are interested only in some part of an object to be stored, we store the whole object, which is not required.

Background

Memento pattern is one the GOF design pattern that comes as a rescue to store the state of an object. Memento means a reminder of past events or a souvenir. In Memento pattern, we do not create a copy of an object. We create Mementos that hold the state of an object and it might include full object or elements of an object that needs to be stored.

Wikipedia definition of Memento Pattern

The memento pattern is a software design pattern that provides the ability to restore an object to its previous state (undo via rollback).

Ingredients of a Memento Pattern

Originator: It is the one whose state needs to be saved and creates the Memento object.
Memento: It holds the internal state of an Originator.
Caretaker: It is responsible for keeping the memento.

Class Diagram

Inline image 2

In order to save the state of an Originator, Caretaker asks the originator to create and pass the memento. The originator saves the internal state and passes the memento to the CareTaker. Caretaker maintains the memento. Whenever, Originator needs to be restored to a previous state, CareTaker calls the SetMemento of Originator and passes the saved memento. The originator accepts the memento and restores the originator to previous state.

Example:

Let’s take an example of an Employee whose state needs to be stored, and restored to a previous state.

Read more: Codeproject
QR: Inline image 1

Posted via email from Jasper-net

Free Code metrics for visual studio professional

|
Inline image 2

Editorial Note

This article appears in the Third Party Product Reviews section. Articles in this section are for the members only and must not be used to promote or advertise products in any way, shape or form. Please report any spam or advertising.

Introduction

Recently my superior requested to report some code metrics from my team. Unfortunately, Visual Studio professional was used me and team members. This version does not provide ready to use tools for collecting this statistics. TFS server was not used either.

Note: explanation for metrics are taken from the Wikipedia and extension developer's blog. I am not affiliated with none of the tool authors mentioned in the article. All tools are free to use.

Background and solution 

I have reviewed number of extensions for Visual Studio Professional, and have stopped on following combination:

Tool to collect characteristics:  Visual Studio Code Metrics PowerTool 10.0, by Microsoft Corporation 

This is the command line tool, that analyzes code in your solution code and provides 5 important quantitative characteristics for Project Manager / Team leader:

Maintainability index 

This metric originally is calculated as follows: Maintainability Index = 171 - 5.2 * ln(Halstead Volume) - 0.23 * (Cyclomatic Complexity) - 16.2 * ln(Lines of Code) 

Read more: Codeproject
QR: Inline image 1

Posted via email from Jasper-net