Resharper Isn’t Always Smart

I was writing some code today, essentially like this: public class MyClass {     private int value;     public MyClass(int value)     {         this.value = value;     }     public static bool operator==(MyClass left, MyClass right)     {         return left.value == right.value;     }       public static bool operator !=(MyClass left, MyClass right)     {         return !(left == right);     } }     //…     MyClass myClass1 = new MyClass(1);     MyClass myClass2 = new MyClass(1);     if((Object)myClass1 != (Object)myClass2) // “Type cast is reundant”     {         Console.WriteLine(“not equal”);     } … Continue reading Resharper Isn’t Always Smart

Licences for Microsoft products

Occasionally I get development questions that are governed by one or more product licenses (End-User License Agreement, “EULA”).  One question that I see is “I’ve used Reflector to decompile the .NET Framework and want to use that C# code in my application”. You’ve installed some Microsoft software and agreed to the EULA but didn’t save it and it’s nowhere on your hard-disk.  If you’re not sure what your license terms are, there’s a Microsoft web page that allows you to look up EULAs for many products: http://www.microsoft.com/about/legal/useterms/  By the way, the answer to the question is “You’re not licensed to … Continue reading Licences for Microsoft products

Windows XP Professional EULA

07/27/2001 54834.1 Microsoft Windows XP Professional END-USER LICENSE AGREEMENTIMPORTANT—READ CAREFULLY: This End-User License Agreement (“EULA”) is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation for the Microsoft software product identified above, which includes computer software and may include associated media, printed materials, “online” or electronic documentation, and Internet-based services (“Product”). An amendment oraddendum to this EULA may accompany the Product. YOU AGREE TO BE BOUND BY THE TERMS OF THIS EULA BY INSTALLING, COPYING, OR OTHERWISE USING THE PRODUCT. IF YOU DO NOT AGREE, DO NOT INSTALL OR USE THE PRODUCT; YOU MAY … Continue reading Windows XP Professional EULA

.NET 2.0 Framework License

End-User License Agreement MICROSOFT SOFTWARE SUPPLEMENTAL LICENSE TERMS MICROSOFT .NET FRAMEWORK 2.0 Microsoft Corporation (or based on where you live, one of its affiliates) licenses this supplement to you. If you are licensed to use Microsoft Windows operating system software (the “software”), you may use this supplement. You may not use it if you do not have a license for the software. You may use a copy of this supplement with each validly licensed copy of the software. The following license terms describe additional use terms for this supplement. These terms and the license terms for the software apply to … Continue reading .NET 2.0 Framework License

Upcoming C# 3 Guidance From Microsoft

Mircea Trofin has some design guidelines with regard to some C# 3 language additions (that I assume will make it into a revised Framework Design Guidelines of some sort).  They more less agree with the guidelines I published in Code Magazine a while ago.  There are some slight differences: Consider using extension methods in any of the following scenarios: to provide helper functionally relevant to every implementation of an interface… and, Do define extension methods in the same namespace as the extended type, if the type is an interface, and if the extension methods are meant to be used in most … Continue reading Upcoming C# 3 Guidance From Microsoft

Single-Entry, Single-Exit, Should It Still Be Applicable In Object-oriented Languages?

Before the modern high-level languages Edsger Dijkstra came up with “Structured Programming”.  This programming methodology relied on the programmer to form and enforce most of the structure of the program–manually keeping sub-structures and logic separate from one another to promote maintainability and easy of understanding, among other things.  Think assembly language with a linear collection of instructions and jumps and then the only concept of a method or function is how the rest of the logic jumps to that block of code. This concept of delineating functions hinged on a single entry, i.e. from point A to point B only one point … Continue reading Single-Entry, Single-Exit, Should It Still Be Applicable In Object-oriented Languages?