Why contributing to an Open Source project is a good way to learn new language and/or technology

I’ve been trying to learn F# for quite a long time now, but there was never a good way to do it. First of all, I need some way to evaluate my work. It’s really easy to learn new language, but you never know if you’re using it right. That’s even more likely to happen when not only language is new but also general idea behind that language is much different. That’s the case with my F# learning. Almost every programming language I’ve used so far can be classified as object-oriented-first language. F# is different. It’s functional-first language and because of that it’s more about learning how functional programming looks like, not how F# syntax looks like. But I think I found a way to learn F# right. And the answer is: Open Source.
Continue reading Why contributing to an Open Source project is a good way to learn new language and/or technology

Learning F# and solving Digit Recognizer competition on kaggle

I’ve started learning F# couple weeks ago, but unfortunately after few days I got quite busy and after these days I still know almost exactly nothing about functional programming at all. That’s why I decided I have to look for some challenges and samples I could work on while learning. That’s how I found F# and Machine Learning Dojo slideshow and Digit Recognizer competition on kaggle. I decided to give it a try. Of course, the main goal is to learn F#, not to get 100% correctness in the competition. You should have it in mind while reading the post :)
Continue reading Learning F# and solving Digit Recognizer competition on kaggle

The Future of C# and multiple results. Why don’t we use anonymous types?

I just watched The Future of C# talk by Mads Torgersen recorded at NDC London conference over a month ago. Among all the stuff Mads talked about one really drawn my attention: methods/properties with multiple results. Unfortunately, instead of providing some new, crazy idea how to make it possible in C# he focused on making current usage easier. I think language designers could go much further and create real multiple results experience!
Continue reading The Future of C# and multiple results. Why don’t we use anonymous types?

Introducing CloneExtensions .NET cloning library

I’ve spent last two days working on my first open source .NET library named CloneExtensions. It gives you a smart way to clone your object instances without implementing any interface writing any additional Clone method at all. It uses Expression Tree to compile that Clone method for you right before you’re trying to use GetClone for given type T for the first time.
Continue reading Introducing CloneExtensions .NET cloning library

Partitioning the collection using LINQ: different approaches, different performance, the same result

Another blog post inspired by StackOverflow question. This time it’s all about LINQ, performance and a tiny little detail, that really matters. The question itself is about yield keyword in VB.NET, but there is another, much more interesting part I’d like to examine. The algorithm quoted in the question is the key.

The idea is simple. How to partition a collection into parts with given number of elements in ever part? Algorithm presented in the question is as easy as the questions seems to be:
Continue reading Partitioning the collection using LINQ: different approaches, different performance, the same result

Playing around with List<T>, part five: finding elements

This time I’ll try to examine how are all search-related methods in List<T> implemented. Here is quite long list of all these methods:

public bool Exists(Predicate<t> match)
public T Find(Predicate</t><t> match)
public List</t><t> FindAll(Predicate</t><t> match)
public int FindIndex(Predicate</t><t> match)
public int FindIndex(int startIndex, Predicate</t><t> match)
public int FindIndex(int startIndex, int count, Predicate</t><t> match)
public T FindLast(Predicate</t><t> match)
public int FindLastIndex(Predicate</t><t> match)
public int FindLastIndex(int startIndex, Predicate</t><t> match)
public int FindLastIndex(int startIndex, int count, Predicate</t><t> match)
public int IndexOf(T item)
public int IndexOf(T item, int index)
public int IndexOf(T item, int index, int count)
public int LastIndexOf(T item)
public int LastIndexOf(T item, int index)
public int LastIndexOf(T item, int index, int count)</t>

Continue reading Playing around with List<T>, part five: finding elements