Oskar Gewalli's blog articles

0
comment
on 12/4/2012 1:51 PM
Reading source code is hard. One way of dealing with this is rewriting what is not understood. This can help focus on some parts of the code, but can be detrimental since it’s easy to overlook functionality in files that are not touched or files that look too complex (throwing away functionality). One way of doing this is to create a fork to rewrite one, in order to be able to throw away the changes made essentially to read the code. It’s usually harder to read code than to write it. Trying to read a 700 [...]
>> Read the full article
.
0
comment
on 12/4/2012 1:51 PM
Reading source code is hard. One way of dealing with this is rewriting what is not understood. This can help focus on some parts of the code, but can be detrimental since it’s easy to overlook functionality in files that are not touched or files that look too complex (throwing away functionality). One way of doing this is to create a fork to rewrite one, in order to be able to throw away the changes made essentially to read the code. <div> </div> It's usually harder to read code than to write it. Trying [...]
>> Read the full article
.
0
comment
on 11/22/2012 10:27 AM
I was thinking about how nice you have it in some languages where you can do a case statement for types. Thing is, we have a lot of compiler goodness in C# already. By being explicit about the type and using type inference we can have a generic Case statement of a maximum length (depends on how many if else you think are ok to add). I find it pretty sweet to write code like this: TypeMatch.Case(exception,   (GnarlyType e) => { HandleGnarly(e); },   (FuncyType e1) => { HandleFunky(e1); },   () => { Explo[...]
>> Read the full article
.
0
comment
on 11/22/2012 10:27 AM
I was thinking about how nice you have it in some languages where you can do a case statement for types. Thing is, we have a lot of compiler goodness in C# already. By being explicit about the type and using type inference we can have a generic Case statement of a maximum length (depends on how many if else you think are ok to add). I find it pretty sweet to write code like this:<blockquote class="tr_bq"> TypeMatch.Case(exception,   (GnarlyType e) => { HandleGnarly(e); },   (FuncyType e1) => { HandleFunky([...]
>> Read the full article
.
0
comment
on 11/14/2012 2:10 AM
Some times you encounter a class that implements IEnumerator without any IEnumerable implementation. To preserve the spirit of the enumerator (basically a cursor) we can just add an extension method that yields the elements. But most of the time it’s simply to add a “.Cast()" if it is IEnumerable without the extra type information.<div style="clear: both;"></div>
>> Read the full article
.
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper