Reading list for the week of Aug 4-8, 2014

 

WebSites Runtime Performance Resources

I attended Build 2013 in SFO and on this excellent talk by Tobin Titus on Web Runtime Performance Tobin shared lots of insight on Web Runtime performance. He shared the list of resources which I thought is beneficial who is looking for improving website performance.

Books on Websites Performance

High Performance Websites
Steve Souders, September 2007

Event Faster Websites: Best Practices

Steve Souders, June 2009

JavaScript Patterns

High Performance JavaScript Nicholas Zakas, March 2010

JavaScript the Good Parts Douglas Crockford, May 2008

JavaScript Patterns Stoyan Stefanov, September 2010

JavaScript Cookbook Shelley Powers, July 2010

Microsoft Guidance

Windows Store App: JavaScript Best Practices
MSDN, December 2012

Performance Tricks to Make Apps & Sites Faster
Jatinder Mann, Build 2012

50 Performance Tricks for Windows Store Apps

Jason Weber, Build 2011

Engineering Excellence Performance Guidance

Jason Weber, EE Forum 2011

Internet Explorer Architectural Overview

Jason Weber, PDC 2011

W3C Web Performance

Web Performance Working Group Homepage

Performance Timeline Specification

Navigation Timing Specification

Blog Posts

Tools

WPT Standalone SDK

Windows Performance Toolkit

Fiddler Web Debugger

 

Evolution of .NET Framework

CLR

.NET Framework

Components

CLR 4.0

.NET 4.5

Metro

HTML5

Portable Class Libraries

.NET 4.0

Parallel Computing

Dynamic

Covariance and

Contravariance

CLR 2.0

.NET 3.5 SP1

ASP.NET MVC

Entity Framework

LINQ to Entities

Cloud Computing

.NET 3.5

LINQ

ASP .NET AJAX

REST

RSS

LINQ to SQL

LINQ to XML

LINQ to Objects

.NET 3.0

WCF

WPF

WF

CardSpace

.NET 2.0

Winforms

ASP.NET

ADO.NET

CLR 1.0

.NET 1.1

.NET 1.0

Winforms

ASP.NET

ADO.NET

 

Switching between Running Apache and IIS in Windows

When one installs Apache in Windows Machine where IIS is installed, starting Apache will give the following error :

The Apache service named  reported the following error:
>>> (OS 10013) An attempt was made to access a socket in a way forbidden by its access permissions.
:make_sock: could not bind to address 0.0.0.0:80.

The reason is both the servers listen on Port 80. Even though you can make one of the servers to listen in different port it is too many changes to make things work.

Easier way is to have these servers running alternatively using simple batch scripts.

Apache and IIS are both launched as a Windows service — open Administrative Tools > Services. Locate Apache and IIS (W3SVC – World Wide Web Publishing Service) and set both Startup types to Manual:

IIS TCP port bindings

(Make a note of Apache’s service name — in the screenshot above, it’s “Apache2.2″.)

Neither server will run when your PC is booted. To start and stop the services, create 4 batch (.bat) files in the same folder.

start-apache.bat
This will stop IIS and start/restart Apache. (Note that ‘Apache’ is assumed to be the service name in the third line, but your installation may be different.)


@call stop-iis.bat
@call stop-apache.bat
@net start Apache

stop-apache.bat
This will stop Apache (change the service name if necessary).


@net stop Apache

start-iis.bat
This will stop Apache and start/restart IIS.


@call stop-apache.bat
@call stop-iis.bat
@net start W3SVC

stop-iis.bat
This will stop IIS on Windows Vista or 7.


@net stop was /y

stop-iis.bat
This will stop IIS on Windows XP or earlier.


@net stop iisadmin /y

You can double-click these files to run them or create desktop / start menu shortcuts for easier access.

Source : sitepoint.com

C# Coding Guidelines

If you are looking for C# Coding Guidelines grab these guidelines from

I have listed the important ones here.

Basic Principles of Coding

Class Design

  • A class or interface should have a single purpose (AV1000)
  • An interface should be small and focused (AV1003)
  • Use an interface to decouple classes from each other (AV1005)
  • Don’t hide inherited members with the new keyword (AV1010)
  • It should be possible to treat a derived object as if it were a base class object (AV1011)
  • Don’t refer to derived classes from the base class (AV1013)
  • Avoid exposing the objects an object depends on (AV1014)
  • Avoid bidirectional dependencies (AV1020)
  • Classes should have state and behavior (AV1025)

Member Design

  • Allow properties to be set in any order (AV1100)
  • Avoid mutual exclusive properties (AV1110)
  • A method or property should do only one thing (AV1115)
  • Don’t expose stateful objects through static members (AV1125)
  • Return an IEnumerable or ICollection instead of a concrete collection class (AV1130)
  • String, list and collection properties should never return a null reference (AV1135)

Miscellaneous Design

  • Throw exceptions rather than returning status values (AV1200)
  • Provide a rich and meaningful exception message text (AV1202)
  • Don’t swallow errors by catching generic exceptions (AV1210)
  • Always check an event handler delegate for null (AV1220)
  • Use a protected virtual method to raise each event (AV1225)
  • Don’t pass null as the sender parameter when raising an event (AV1235)
  • Use generic constraints if applicable (AV1240)
  • Don’t add extension methods to the same namespace as the extended class (AV1245)
  • Evaluate the result of a LINQ expression before returning it (AV1250)

 Maintainability

  • Methods should not exceed 7 statements (AV1500)
  • Make all members private and types internal by default (AV1501)
  • Avoid conditions with double negatives (AV1502)
  • Don’t use “magic numbers” (AV1515)
  • Only use var when the type is very obvious (AV1520)
  • Initialize variables at the point of declaration (AV1521)
  • Favor Object and Collection Initializers over separate statements (AV1523)
  • Don’t make explicit comparisons to true or false (AV1525)
  • Don’t use nested loops in a method (AV1532)
  • Add a block after all flow control keywords, even if it is empty (AV1535)
  • Always add a default block after the last case in a switch statement (AV1536)
  • Finish every if-else-if statement with an else-part (AV1537)
  • Be reluctant with multiple return statements (AV1540)
  • Don’t use selection statements instead of a simple assignment or initialization (AV1545)
  • Prefer conditional statements instead of simple if-else constructs (AV1546)
  • Encapsulate complex expressions in a method or property (AV1547)
  • Call the most overloaded method from other overloads (AV1551)
  • Only use optional parameters to replace overloads (AV1553)
  • Avoid using named parameters (AV1555)
  • Avoid methods with more than three parameters (AV1561)
  • Don’t use ref or out parameters (AV1562)
  • Avoid methods that take a bool flag (AV1564)
  • Always check the result of an as operation (AV1570)
  • Don’t comment-out code (AV1575)
  • Consider abstracting an external dependency or 3rd party component (AV1580)

Framework Guidelines

  • Use C# type aliases instead of the types from the System namespace (AV2201)
  • Build with the highest warning level (AV2210)
  • Use Lambda expressions instead of delegates (AV2221)
  • Only use the dynamic keyword when talking to a dynamic object (AV2230)