5

Your code looks quite reasonable, though there are a few tweaks you could consider. Function or Callback? Rather than names like FoldlFunction and MMapFunction, since what those types contain are the types for the callback run for each element of the array, consider calling them FoldlCallback etc instead. It's a bit more precise and will make more intuitive ...


5

Welcome to Code Review! I don't have much time to write a full review right now, but I'll give you a concise list of things you could do to improve your code (in my opinion). Naming Use camelCase instead of PascalCase for local variables, class variables & method arguments. In addition to making your code a lot more readable (I don't have to wonder, &...


4

First I would like to re-iterate the points made by @cliesens regarding naming and avoid uint. Keep in mind the most number of elements you may have in an array is int.MaxValue. Theoretically, with your use of unit, someone could try to create an array that is 3 billion wide by 3 billion deep, which would throw exceptions. And your code doesn't handle ...


4

This: Console.WriteLine("Index invalid"); return default(T); is dangerous. Having out-of-bounds indices is dangerous enough that you should probably just raise an exception here, rather than returning a default that will probably be wrong from the perspective of the caller. If this is a feature that you're really going to use, wrap it in a ...


3

You can define a mapping between Types and the Deserializers. You can do this for example like this: public class GenericDeserializer<T> : IDeserializer<T> { private readonly ImmutableDictionary<Type, object> _deserializers = new Dictionary<Type, object> { { typeof(double), Deserializers.Double }, { ...


1

Trying to not promote low-level transaction implementation in initial design, IDbContext is the place for db-transactions. public interface IDbContext { void Commit(); void Rollback(); } Using “Generics” to implement “Unit Of Work” public interface IUnitOfWork<T> where T: IDbContext { T DbContext { get; } } Now the async ...


Only top voted, non community-wiki answers of a minimum length are eligible