C# Development

  • C# High performance programming

    I have noticed a number of comparisons with C++ and C# for high performance systems , and the same mistakes are frequently made. I will go over a C# queue which is frequently used in high performance systems. 1. Any linked list system in C# will preform badly unless - You manage your memory yourself via unsafe pointers OR You recycle nodes ( which will still not offer great or C++ performance) The reason for this should be obvious since any new to create a new record is FAR more expensive than enqueing and...

  • C# and F# are complementary

     I just had a lot of repetative web work to do and im starting to look at F# , it looks like F# fits really well with C# replacing the batch files / scripts you use and great for proto typing. Things where C# are better Lib /UI Development Writing large assemblies When you need low level control or unsafe. When you use TDD When F# is better. When you need quick and dirty codes ( utilities) Screen / Web scraping AI scripts Mathematics / financial scripts Workflow scripts Frequently changing code. Project control. How often with C# did you have to do something really...

  • C# for low latency applications

    There is no argument modern languages  such as Java and C# allow quicker , safer and easier to maintain applications yest there is still a very large amount of C/C++ applications being written. A lot of use of C++ is simply for 3 reasons   - A view of better performance   -  Maintaining an existing application     - GC pauses   - Environment requires it. Lets look at these issues In practice with realistic budgets a Java/ C# applications will tend to have better performance due to better and easier to use collections and optomizations.  The main performance difference relates to...

  • Silverlight 3- impressive stuff

    Just saw this MIX Video http://videos.visitmix.com/MIX09/T40F Pretty impressive ( and they handle search engines) , if its as easy as it looks it will be great . Will check it out over the next few days.  Silverlight has 3 major versions in 18 months mmm , could it be the focus for MS ( with Azure)  , kind of tempted to go this way rather than WPF to support other platforms a multiplatform MS ??

  • Are projects getting more successful

    Im curious at the increase rate of sucess in a number of surveys such as the later CHAOS surveys. Looking in the detail however it appears that projects after peaking in 2000 the amount of time overrun and the amount of features completed have dropped dramatically in the vast majority of projects. Not sure what it means but to me it DOESNT mean software development is getting better if features are getting dropped  and there are increasing time blow outs. Things that come to mind Standards for success and projects have increasing amounts of over estimation to prevent...

  • LINQ for SQL unit testing Part2

    I'm not really sure whether the benefits are worth it unless you need very high quality code and for larger applications.   I'm not sure why i feel this and whether this is due to compartmentalizing the LINQ code or whether its just TDD on LINQ code which can be tested via a test DB i suspect its the TDD.  Still storing all the sql in the various repositories is a plus.               } ---------------------------------------------------------------------------------------------------------------------------internal class ProvinceRepositry : RepositryBase<Province>, IProvinceRepositry{public ProvinceRepositry()base(new ProvinceUnitOfWork())public ProvinceRepositry(IUnitOfWork<Province> work)base(work)#region IProvinceRepositry Memberspublic ProvinceCollection GetWorld(string worldname)throw new System.NotImplementedException();public ProvinceCollection GetWorld()throw new System.NotImplementedException();public Province Get(int id)throw new System.NotImplementedException();public void Update(Province prov)Guard.ArgumentNotNull(prov, "PROVINCE"); public...

  • LINQ for SQL unit testing Part1

    Ian Cooper had some nice articles on how to do unit testing , i have implemented his code and ideas ( shown below) . See Part 2 for some Business code { { impl = source; queryableImpl = impl.AsQueryable(); } { }   { impl.Add(item); queryableImpl = impl.AsQueryable(); }                 { }     #region   { } { impl.Remove(item); queryableImpl = impl.AsQueryable(); } { impl.RemoveAll(MatchWithContainer); queryableImpl = impl.AsQueryable(); } { }     #endregion #region System.Collections. { }   #endregion #region { } { } { }   #endregion   }     public interface IDataSource<T> : IQueryable<T>, IEnumerable<T>,ITable, IQueryProvider { }     {         } public   {             } interface IUnitOfWork<T> :IDisposableILINQDataSource<T> DataSource{ get; set; } //table// bool ReadOnly { get; set; }void SubmitChanges(); // only call for inserts OR when all work is done     {           {   unitOfWork = work; }                     {     #region     {     {   }     { dataSource = } }       #region       public abstract class UnitOfWorkBase<T> : IUnitOfWork<T>ILINQDataSource<T> dataSource; IUnitofWork<T> Memberspublic ILINQDataSource<T> DataSourcegetreturn dataSource;setvalue ;abstract public bool ReadOnly { get; set; }abstract...

  • LINQ for SQL and reattaching objects in nTier scenarios

    One of the issues that keeps cropping up is LINQ for SQLs support for nTier scenarios and having to reattach the object to the DataContext. However this problem is exhibited by all ORMs in nTier scenarios ( though not in web sites) and  you basically have 2 choices - refetch the object from cache/DB and replay all changes to see what has changed then you can craft a custom Update to just change the items changed. - update all fields in the DB. While the 2nd method is easier the first is more efficient especially when you consider that it...

  • Are Datasets dead

    Can anyone see a use for Datasets these days ? LINQ for SQL seems to have all the bases covered with a much easier and extensible model.

  • Post by Frans Bouma

    Loved this post  so had  to emphasize and post it. "That's not the case. A framework user doesn't give a **** about how many different patterns the framework is using and how great and awesome it's internally and how it will ultimately evolve in the bringer of world peace. A framework user is interested in whether the framework takes care of things the framework user can't afford to spend time on. After all, the framework user can't afford to spend time paid by the customer on plumbing, on writing infrastructure code. The framework user is paid to write code directly...

  • Custom Collections and whether to use inheritance or not

    I will talk about Windows Communication Foundation collections in the next post and wanted to get this out of the way ; I'm always lost when creating a simple collection whether to contain a collection as a member or whether to extens a base one via in extion eg public  class Customers<Customer> or  Customers :  Collection < Customer> { ..} vs public  class Customers  ; ICollection<Customer> {  private List<Customer>  customers ; //Add etc  } While the second is  obviously better as you can hide elements i dont think its good use of time to implement each such collection unless the collection requires significant extentions anyaway.  A...