Browse by Tags

Tagged Content List
  • Blog Post: Continuation-Passing Style

    There are some technical words that cause quite a stir even amongst geeks.  When someone says the word "continuation" , people's eyes glaze over and they seek the first opportunity to change the subject.  The stir is caused because most people don't understand what a continuation...
  • Blog Post: In Case You Haven't Heard

    It has been a while since I have posted. We have been working hard to get Orcas beta 1 and beta 2 done. So I apologize for the long interlude between posts but I hope that you are enjoying beta 1 and that you are looking forward to beta 2. Now that beta 1 is out there, what do you all think of it? Beta...
  • Blog Post: All About Iterators

    Design patterns have been all of the rage for a number of years now. We have design patterns for concurrency, user interfaces, data access, object creation, and so many other things. The seminal work on the topic is the Gang of Four 's book, Design Patterns . When used appropriately they are a fantastic...
  • Blog Post: Extending the World

    When people think of C# 3.0 and Linq, they commonly think of queries and databases. The phenomenal work of the Linq to SQL guys provides ample reason to think of it this way; nevertheless, C# 3.0 and Linq are really much much more. I have discussed a number of things that can be done with lambdas, expression...
  • Blog Post: Immutability, Purity, and Referential Transparency

    How often do you write code that just works? It seems to happen so rarely that I find myself suspicious if code does just work. When was the last time that you wrote a non-trivial program that had no compile errors on the first try and then ran fine as well? If it happened recently then congratulations...
  • Blog Post: Linq to ASCII Art

    Last night I was searching for an audio version of Painters and Hackers by Paul Graham . Pretty soon I had completely forgotten about the book and found myself reading the Wikipedia article about Hackers . Isn't Internet search great? Of all of the things in the article, the one thing that captured my...
  • Blog Post: The Virtues of Laziness

    It seems that I riled some people up with my blog post yesterday. After some thought, I think the primary reason that there was some backlash is because some people feel that I violated one of the sacred principles of FP: lists are *the* data structure. Well, let me set the matter straight. I love lists...
  • Blog Post: Why all the love for lists?

    One of the things that I have noticed when participating in interviews with potential candidates is that most candidates have a favorite data structure. Presumably this is the data structure that they feel the most comfortable with. The problem is that no matter what coding question I ask them, they...
  • Blog Post: Baby Names, Nameless Keys, and Mumbling

    Baby Names I recently finished reading Freakonomics . It is a fascinating book about a number of strange phenomena. Its topics range from the economics of dealing crack to cheating in sumo wrestling. Among the sundry topics is a discussion concerning the psychology and sociology underlying babies names...
  • Blog Post: Memoization and Anonymous Recursion

    Keith Farmer brought it to my attention that there is at least a little confusion about how closures work. Hopefully, I can help shed a little light on the subject. The question is why doesn't the following code actually memoize fib in the call to Test? Func<int, int> fib = null; fib = n =>...
  • Blog Post: Anonymous Recursion in C#

    Recursion is beautiful and lambdas are the ultimate abstraction. But how can they be used together? Lambdas are anonymous functions and recursion requires names. Let's try to define a lambda that computes the nth fibonacci number. Func<int, int> fib = n => n > 1 ? fib(n - 1) + fib(n...
  • Blog Post: Currying and Partial Function Application

    When I first heard the term Currying , I thought immediately of tasty Thai and Indian food. To my dismay, I found that the conversation was not about wonderful spices but rather about transforming a function that takes n arguments into a function that takes only one argument and returns a curried function...
  • Blog Post: Function Memoization

    One of my favorite pastimes is playing games. No not XBox 360, PS3, or Wii games nor other computer games, but board games, card games, and other such games. It's probably because I'm from a large family - I have 8 siblings - and we would often spend time together playing games. It is a good way to accommodate...
  • Blog Post: Video on Linq Queries and Delayed Evaluation

    I recently recorded a video with Charlie Calvert about Linq queries and delayed evaluation . You can find it here (streaming video). Download it here.
  • Blog Post: About Queries

    This concludes my series of posts about queries. I will still discuss them occassionally and if anyone has any specific questions then I would be very glad to address them. Query Expression Posts 1. Comprehending Comprehensions What are queries? How are queries treated by the compiler? 2. Transparent...
  • Blog Post: Another Model for Query Interpretation

    An imperative model for interpreting Linq to Objects queries has already been discussed , but are there any other models or method for interpreting queries? It turns out that there are other models. Linq to SQL queries operate in a completely different manner. In the discussion about Linq to Object queries...
  • Blog Post: Having Trouble with Queries

    A Funny Joke and a Sad Joke There is a joke that goes something like this: Two men are hopelessly lost in hot air balloon. Their condition is aggravated by the fact that they are enshrouded by a thicket of fog. When it seems all is lost, suddenly the fog parts and miraculously a man is standing on the...
  • Blog Post: How Linq to Objects Queries Work

    If you have ever tried to step through a Linq to Objects query in the debugger, you may have been mildly surprised at the results. It may have seemed as if the program had a mind of its own and ran certain expressions when it wanted to and not when it was supposed to. Be assured, it is doing the right...
  • Blog Post: A Model for Query Interpretation

    Evaluating Query Expressions After writing the code to translate query expressions and remove transparent identifiers, one of my first desires was to write a tool that would generate query expressions to test the correctness of the code. Of course, I already had a set of programmer tests in place...
  • Blog Post: Reading and Writing Queries

    Now that we have discussed some of the underpinnings of query expressions, we can turn our attention to how to use them. As has already discussed , most people who see query expressions immediately think of SQL and often even mistake query expressions for embedded SQL. While it is true that there is...
  • Blog Post: Thus Quoth the Humble Programmer

    I love Scheme! It is such a beautiful language. I was first introduced to it during college. At that time, I thought it was an interesting language but I didn't see the power of the language until later. That moment came when I experienced reading The Structure and Interpretation of Computer Programs...
  • Blog Post: Transparent Identifiers

    My last post described in detail how query expressions in C# are translated, but I have a confession to make. I did a little bit of hand waving through one part of the translation rules. The astute reader (whomever that is, whenever I read such things I always wonder, "Am I that astute reader?") may...
  • Blog Post: Comprehending Comprehensions

    Not long ago, I was reading through some articles posted on programming.reddit.com when I came across an article claiming that C# is trying to be a dynamic language . One user posted a comment that mentioned that C# 3.0 included among other things "embedded SQL". Unfortunately, it seems that there is...
  • Blog Post: Types of confusion

    When I began programming in my early teens, I was very excited to learn about programming and also excited to become a "real" programmer . I remember picking up a book from the library that purported to teach what real programmers were like. I absorbed the material and enjoyed every page. I can only...
  • Blog Post: Saving the State of Enumerators

    Cyrus and I were writing some code together the other day and we used an interesting data structure that I wanted to share with you. This data structure I will call a chain which is essentially a immutable singlely linked list. interface IChain <T> : IEnumerable <T> { IChain <T>...
Page 1 of 2 (26 items) 12