Oskar Gewalli's blog articles

0
comment
on 10/20/2013 2:47 AM
I’ve done some small tests while writing the library to handle readonly objects in c#. Turns out that getting the value of a sub expression can be costly (since you have to compile the expression and execute). When just setting one property there can be a performance benefit of using the following syntax:<blockquote class="tr_bq"> new MyClass(1, "2").With(m => m.MyProperty, 3) </blockquote> There might be some way of optimizing the code in order to get better performance for the form:<blockquote class="tr_[...]
>> Read the full article
.
0
comment
on 10/20/2013 2:47 AM
I’ve done some small tests while writing the library to handle readonly objects in C#. Turns out that getting the value of a sub expression can be costly (since you have to compile the expression and execute). When just setting one property there can be a performance benefit of using the following syntax: new MyClass(1, “2”).With(m => m.MyProperty, 3) There might be some way of optimizing the code in order to get better performance for the form: new MyClass(1, “2”).With(m => m.MyProperty == 3) [...]
>> Read the full article
.
0
comment
on 10/18/2013 10:39 AM
One thing I like about f# is the ability to use readonly objects in a way that does not require a lot of code. I’ve done a small lib inspired by this ability of f#: with The syntax is a bit special since I assume that the properties have a private set.<blockquote class="tr_bq"> myobject.With(m => m.Property1 == 3 && m.Property2 == "3") </blockquote>
>> Read the full article
.
0
comment
on 10/18/2013 10:39 AM
One thing I like about F# is the ability to use readonly objects in a way that does not require a lot of code. I’ve done a small lib inspired by this ability of F#: with The syntax is a bit special since I assume that the properties have a private set. versions prior to 5 myobject.With(m => m.Property1 == 3 && m.Property2 == "3") With 5+ using With; ... public class SomeClass { private static readonly IPreparedCopy<MyClass, int, string> PreparedCopy = Prepare.Copy<MyClass, int, string>((m[...]
>> Read the full article
.
0
comment
on 10/13/2013 11:02 PM
If you prefer to write your build tasks in c# then there is a package for you:Shake
>> 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