Next Article (Rendezvous with JSON) >> |
DevFast stands for "Develop Fast", without compromising the code quality. Library is equipped with extensive documentation and features set of, expressive & simplest to use, methods any programmer requires almost all the time. Naming convention of these methods make sure that code stays highly readable. It provides methods which any programmer requires almost all the time.
In the v1 of this library, we propose the following features:
Useful links:
string variable and type .T to find possible extensionsBefore we look at those methods, first let's see if we would like to write the following program:
"Create a function that accepts a string, parses it as
DateTime, if parsing fails, return 12 Jan, 2000 as value"
To write such a program for such a simple requirement, we might:
null valuesOn the other hand, with DevFast added as reference, this code a one-liner. Let's see a sample as the following picture (sample code):

.TryTo => string parsing to bool,int,long,decimal,DateTime,Enum,Type, etc..ToOrDefault => string parsing to bool, int, long, decimal, DateTime, Enum, Type, etc. with given default value.To variants => string parsing to FileInfo, DirectoryInfo, bool,int,long,decimal,DateTime,Enum,Type, etc. throws Exception when parsing fails..Trim variants => string trim specific methods.Throw variants => Exception throwing methods when string satisfies certain conditions..ToBase64 / .FromBase64 variants => Base64 string conversion methods.Transform variants => String transformation methods (Base64 is a special case)The below picture shows some sample use cases (sample code):

.ThrowIf / .ThrowIfNot => on bool. throws when true (ThrowIf) or false (ThrowIfNot). Though it might look trivial, it is very powerful. Almost all other Throws fallbacks on it..ThrowIfNull => On any T which is class (ReferenceType)..ThrowIfNullOrEmpty => On any T which is ICollection (Array, List, etc.)..ThrowOnMiss => On Dictionary / Collections type. When supplied Key / valye is not in it..ThrowIfZero / .ThrowIfNotZero => as the name suggests (int/ long).ThrowIfEqual / .ThrowIfNotEqual => Any T which is IEquatable.ThrowIfLess / .ThrowIfGreater => Any T which is IComparable.ThrowIfBounded / .ThrowIfNotBounded => Any T which is IComparableThe below picture shows some sample use cases (sample code):

.ToBase64 / .FromBase64 => on string, byte[], ArraySegment<byte>.ToBase64Async / .FromBase64Async => on string, byte[], ArraySegment<byte>, StringBuilder, StreamThe below picture shows some sample use cases (sample code):

.TransformAsync => on string, byte[], ArraySegment<byte>, StringBuilder, Stream to perform various Crypto transformations.CreateFileInfo => on DirectoryInfo to create FileInfo object.CreateBytes => on ArraySegment<byte> to create byte[]The below picture shows some sample use cases (sample code):

Here, we discussed what we propose as v1 of DevFast. We are continuously adding more and more code in it to bring you helpful one-liners. We would be happy to know your requirements and on the way, we'll prioritize those.
Useful links:
Let us know your thoughts.
Next Article (Rendezvous with JSON) >> |