Browse by Tags

Tagged Content List
  • Blog Post: Microsoft "Roslyn" September 2012 CTP now available

    Following last Wednesday’s official launch of Visual Studio 2012, we’re excited to announce that the Roslyn September 2012 CTP is now available for download and provides support for VS 2012 RTM. Please note that Visual Studio 2010 is no longer supported by this CTP. We’ve been hard...
  • Blog Post: Announcing Microsoft “Roslyn” June 2012 CTP

    Today, we're excited to announce that the Roslyn June 2012 CTP is now available for download ! Since the first public release of Roslyn , we’ve been hard at work implementing new language features , addressing top customer feedback from the Oct CTP , iterating on our API design and improving...
  • Blog Post: Roslyn Syntax Visualizers

    Hi All! A few weeks ago, we announced the Microsoft "Roslyn" CTP . I hope many of you have had a chance to download the CTP and take it for a spin :) If you haven’t, do give it a try . To recap – in the Roslyn CTP, we are previewing a powerful set of language services APIs that you can...
  • Blog Post: Introducing the Microsoft “Roslyn” CTP

    By Kevin Pilch-Bisson As Soma mentioned earlier, today we’ve made a Community Technology Preview (CTP) available for download ! The Roslyn project is a forward looking effort to make the wealth of language understanding that the compiler generates available to developers in other scenarios...
  • Blog Post: Does the “LINQ to Objects” provider have built-in performance optimization?

    Let’s start with the basics and maybe repeat some information that many of you already know. One of the most important concepts in LINQ performance and optimization is, of course, deferred execution. It simply means that when you declare a variable and assign it a query expression, that expression is...
  • Blog Post: What does the /target: command line option do in the C# compiler?

    All the /target: options except module create .NET assemblies. Depending on the option, the compiler adds metadata for the operating system to use when loading the portable executable (PE) file and for the runtime to use in executing the contained assembly or module. module creates a module. The metadata...
  • Blog Post: Why does C#'s iterators feature spit out a class definition instead of a struct definition?

    Q: Why does C#'s iterators feature spit out a class definition instead of a struct definition? The iterators feature in C# generates classes that implement the enumerators required. This is detailed in the C# Specification . Why doesn't it use structs, which would be more efficient. A: ...
  • Blog Post: How are return values from a delegate handled?

    Q: How are multiple return values from a delegate handled? In C#, it's possible to write a delegate such as: delegate double GetResult(params double p); If there is more than one method on this delegate, there are multiple return values. A: In this situation, the return value is the value...
  • Blog Post: Why can't I use the same variable as an inner loop does?

    Q: Why can't I do the following: namespace Bug { class Class1 { [ STAThread ] static void Main ( string [] args ) { for ( int i = 0; i < 100; i ++ ) { } int i = 0; } } } the compiler gives me an error on the “int i = 0;” part of the code...
  • Blog Post: Why aren't reference types polymorphic?

    Q: Why aren't reference types polymorphic? A: Consider the following code: using System; class Dog { public string Name; } class Test { public static void Swap(ref object a, ref object b) { object temp; temp = a; a = b; b = temp; } public static void Main() { Dog d1 = new Dog(); d1.Name =...
  • Blog Post: Should I assign null to my local variables?

    Q: Should I assign null to my local variables after I use them? For example: string s = ...; Console.WriteLine(s); s = null; A: There is rarely a need to do this for local variables in C# The lifetime of variables is tracked by the JIT - it analyzes how variables are used in a routine, and it...
  • Blog Post: Why doesn't C# warn about unused methods?

    Q: Why doesn't C# warn on unused methods? A: This is something that the C# compiler could do, subject to a few caveats: Virtual functions would have to be excluded Interface implementations wouldn have to be excluded You would get false positives if you used reflection You might get...
  • Blog Post: Why can't I have static and instance methods with the same name?

    Q: Why can't I have static and instance methods with the same name? class Test { static void Process(); void Process(); void AmbiguousCaller() { Process(); } } there's no ambiguity, since the first can only be called through the type name, and the second can only be called through...
  • Blog Post: Why doesn't C# have checked exceptions?

    Checked exceptions are a very hotly debated topic in some circles, particularly for experienced Java developers moving to, or additionally learning, C#. Here are some resources that discuss the issue in depth: The Trouble With Checked Exceptions (Anders Hejlsberg, Bruce Eckel, Bill Venners) ...
  • Blog Post: What's the difference between cast syntax and using the as operator?

    Using the as operator differs from a cast in C# in three important ways: It returns null when the variable you are trying to convert is not of the requested type or in it's inheritance chain, instead of throwing an exception. It can only be applied to reference type variables converting...
  • Blog Post: Why can't I use static and const together?

    All constants declarations are implicitly static, and the C# specification states that the (redundant) inclusion of the static modifier is prohibited. I believe this is to avoid the confusion which could occur if a reader were to see two constants, one declared static and one not - they could easily...
  • Blog Post: Why don't relational operators return bool as a type?

    Section 10.9.2 of the language specification says: A binary operator must take two parameters, at least one of which must have the class or struct type in which the operator is declared. Parameters of the shift operators ( § 7.8 ) are further constrained. A binary operator can return any type...
  • Blog Post: Why don't namespace using directives import nested namespaces?

    In C#, when you specify a “using” clause, such as using System.Text; the compiler only imports the types in System.Text into the global namespace - it doesn't do the same with any namespaces inside of System.Text. So, while that using allows me to write: StringBuilder s = new StringBuilder...
  • Blog Post: Why doesn't C# support multiple inheritance?

    This answer is from Chris Brumme via the following post . I've copied the text in here in case the post disappears. *** There are a number of reasons we don't implement Multiple Implementation Inheritance directly. (As you know, we support Multiple Interface Inheritance). However, I should point...
Page 1 of 1 (19 items)