• Sharp Things

    The Least a C# Programmer Needs to Know about F# Part I--Implicit Types

    • 6 Comments
    Jomo Fisher--A few weeks ago, a fellow C# programmer asked me what the biggest differences between programming in C# and programming in F# are. Since then, I've been building a list of differences. My plan was to write a single article that discussed...
  • Sharp Things

    Soma on F#

    • 6 Comments
    Soma announced some exciting news this morning. Developer Division--the people at Microsoft who make Visual Studio--is partnering with Microsoft Research on F#. We're going to fully integrate F# into Visual Studio: “This is one of the best things that...
  • Sharp Things

    Adventures in F#--Sweet Test-First Kung Fu

    • 4 Comments
    Jomo Fisher--Up until now, I've been avoiding using F# with the VS IDE. I've been using notepad.exe and fsc.exe because I wanted to build my own expectation for what the experience should be before I experienced what it actually was. I can tell you that...
  • Sharp Things

    Adventures in F#--Lazy Like a Fox

    • 3 Comments
    Jomo Fisher--This is the next part of the open-notebook series documenting my exploration of F#. Today, I'm looking at the lazy keyword. When an F# function is invoked its value is immediately evaluated. F# does not do lazy evaluation by default. However...
  • Sharp Things

    Adventures in F#--Corecursion

    • 6 Comments
    Jomo Fisher--In a prior post I touched on recursion in F#. One of the comments was about mutually recursive functions. The example given was, let f1 a do print a f2 a let f2 a do print a f1 a f1 1 It turns out that this F# doesn't compile because F# scoping...
  • Sharp Things

    Adventures in F#--Tail Recursion in Three Languages

    • 12 Comments
    Jomo Fisher—Here’s the F# I'm looking at today: #light let rec f n = do printf "%d\n" n f (n+1) f 1 This defines a recursive function 'f' that takes a value 'n' as a parameter. This function prints the value of n to the console and then calls itself with...
  • Sharp Things

    Adventures in F#--Discriminated Unions

    • 7 Comments
    Jomo Fisher-- Easily my favorite feature of F# so far is the combination of discriminated union and pattern matching. Together, these allow you to concisely represent a complex language-like data structure and operations over that structure. We used this...
  • Sharp Things

    Adventures in F#--Poking Tuples with a Stick

    • 3 Comments
    Jomo Fisher--In a comment on my bloglet about type inference in F# John Harrop suggested I try: let f (a,b)=(b,a) Which, under Reflector, gives this equivalent in C#: public static Tuple<U, T> f<T, U>(T a, U b) { return new...
  • Sharp Things

    Adventures in F#--Function Type Inference

    • 6 Comments
    Consider this F#: let Reverse a b = b a This means: given a and b (whatever they may be) call b as a function with 'a' as the argument. When I compile this and look at it under reflector I get: public static U ( ,Microsoft.FSharp.Core.FastFunc...
  • Sharp Things

    Adventures in F#--Probing Type Inference

    • 12 Comments
    Jomo Fisher--I was curious about type inference in F# and I wondered what would happen if there was really no way for the compiler to infer a type. Consider this function which takes a value and just returns it: let func n = n Like last time , I compiled...
  • Sharp Things

    Adventures in F#--The Lay of the Land

    • 5 Comments
    Jomo Fisher--I'm taking some time now to better understand F#. Right now, I understand the concept of functional code and have some narrow but deep experience by way of the work we did on LINQ for C# 3.0. My goal is to understand F# as well as I understand...
  • Sharp Things

    Persistence Ignorance in LINQ to SQL

    • 0 Comments
    Mathew Charles is a member of the LINQ to SQL development team. He's posted a great article on POCO support in LINQ to SQL: http://blogs.msdn.com/digital_ruminations/archive/2007/08/28/linq-to-sql-poco-support.aspx
  • Sharp Things

    Probing a Hidden .NET Runtime Performance Enhancement

    • 8 Comments
    Jomo Fisher--Matt Warren once told me that the runtime had a performance optimization involving calling methods through an interface. If you only had a small number of implementations of a particular interface method the runtime could optimize the overhead...
  • Sharp Things

    LINQ to SQL Trick: Get all Table Names

    • 6 Comments
    It's often useful to be able to list all the tables or columns in your DataContext. One example is if you want to write a report generation system that works for any DataContext class. LINQ to SQL has an API called the MetaModel which allows you to get...
  • Sharp Things

    The Least You Need to Know about C# 3.0

    • 20 Comments
    Jomo Fisher—A lot of people (myself included) have written about LINQ in the next version of C#. LINQ is indeed an empowering technology. However, even without LINQ, C# 3.0 would be a compelling upgrade. Now that Beta2 is publicly available , here’s my...
  • Sharp Things

    LINQ to SQL Beta2 Performance Numbers and the Dynamic Compilation Pattern

    • 1 Comments
    Jomo Fisher--Rico Mariani has been posting about LINQ to SQL perfomance and has finally posted the performance numbers for Beta2: http://blogs.msdn.com/ricom/archive/2007/07/05/dlinq-linq-to-sql-performance-part-4.aspx One of the tricks Rico and Matt...
  • Sharp Things

    Why Symmetric Multicore is a Dead End for PCs

    • 12 Comments
    Jomo Fisher--There are two kinds of programming problems—those that can run in parallel and those that can’t. There’s no special sauce that can turn an inherently serial problem into an efficient parallel algorithm. Today’s top-end desktop has eight cores...
  • Sharp Things

    Dealing with Linq’s Immutable Expression Trees

    • 9 Comments
    Jomo Fisher --I recently got a question via my blog that dovetailed nicely with something I’ve been working on: I know that expression trees are (or at least appear to be) immutable - which requires that you rewrite the entire tree if you want a tree...
  • Sharp Things

    Leaky Functions\Barrel of Bugs

    • 16 Comments
    Jomo Fisher--Pop quiz. Consider this function call in C#: a = MyFunction(b); What information is exchanged between the caller and the function? When is the information exchange done? It would be nice if the answer was: MyFunction takes value b and returns...
  • Sharp Things

    Visitor Revisitted: LINQ, Function Composablity and Chain of Responsibility

    • 8 Comments
    Jomo Fisher— Last time , I wrote about constructing an inline visitor using new C# language features. It worked fine for what it did, but it completely falls down when you want to extend existing visitors that you’ve created. What if I wanted to modify...
  • Sharp Things

    Inline Visitor Construction using LINQ

    • 4 Comments
    Jomo Fisher—My current job is in the C# team working on LINQ to SQL. Because of nature of programming languages, very few days go by that I don’t deal with syntax trees and the visitor pattern. Occasionally, it would be convenient to create a quick one...
  • Sharp Things

    Fast Switching with LINQ

    • 33 Comments
    Jomo Fisher—I’ve run into a performance problem several times in my career that I’ve never found a truly satisfying answer for until now. The problem can be distilled down to this: Look up a value based on a string key. The set of strings is fixed...
  • Sharp Things

    Hack the Build: Use ILMerge and MSBuild to Combine Multiple Assemblies into One

    • 15 Comments
    Jomo Fisher--Over the last few years I've been coding mostly in C#--before that, my day-to-day work was done in C++. I don't miss much about C++, but one of the things that I do miss is the ability to link many .LIB files into a single DLL or EXE I...
  • Sharp Things

    Update: Targetting 1.1 .NET Framework with MSBuild

    • 4 Comments
    A while back I post a sample that shows you how to target the 1.1 framework with MSBuild. Now, another team within Microsoft is working on turning it into a more polished add-on for VS 2005: http://blogs.msdn.com/msbuild/archive/2005/11/09/490817...
  • Sharp Things

    C# 3.0 Expression Trees

    • 2 Comments
    IanG gives a brilliant explanation of C# 3.0 expression trees and how they enable efficient queries in DLinq: http://www.interact-sw.co.uk/iangblog/2005/09/30/expressiontrees This posting is provided "AS IS" with no warranties, and confers no rights...
Page 2 of 3 (73 items) 123