ksh2dotnetkicks

Stories submitted by ksh2dotnetkicks

Absent Value (codingroute.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 2 years, 3 months ago

The most common way for representing an absent value is 'null' (Null, Nil, Nothing, (), ...). But in some languages the absent value have an actual representation. That helps avoiding many problems that has their root in 'null'. Unfortunately those tools can not be easily mocked in C# because C# lacks ADT (Algebraic Data Types). There are many other entries on the web on the matter if more details are needed; yet, in simple it's about controlling absence of a value (more) explicitly in type-system itself. read more...

add a comment |category: |Views: 2

tags: another

Paranoidal Singleton (codingroute.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 2 years, 3 months ago

1 - If one object must have at most one instance in an application, then no one must be able to capture a pointer to it in any other scope. In other word's it should have at most one pointer to it in whole application, too. Otherwise it's lifetime and service access can not be controlled. So there must be a proxy to that object and at any time, just one of these proxies has access to the actual instance. 2 - In Singleton pattern, if the single instance object have any kind of changing states then it will become a source of disaster (as any other global state in the application). So it is not just enough to provide a thread-safe pointer access. Instead we need a working scope for our singleton object. Using proxy pattern we can achieve this goal: at anytime there is just one pointer to singleton and there is just one user for it. read more...

add a comment |category: |Views: 2

tags: another

Straighce; a straight tracing tool (a thread-safe, non-blocking, file-(code.google.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 2 years, 3 months ago

I needed this; so I have wrote it; and now share it. This is a low-featured, cyclic (log files reside in appname\1.txt to at mose 31.txt), thread-safe and non-blocking TraceListener with some extension methods for System.String to ease tracing which are in fact some wrapper around Trace.Write(...) and Trace.Write(...) functionality (So you can change your TraceListener later!). read more...

add a comment |category: |Views: 25

tags: another

C# 4.0 Development Enhancements I Like To See!(hcoding.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 3 years, 6 months ago

Thoughts around having some features in C# 4.0 read more...

add a comment |category: |Views: 16

tags: another

Where is the magic point of a Monad?(hcoding.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 3 years, 7 months ago

A Monad Pattern is easy to understand but how this little tool can be so flexible and useful? Where is the magic point of a Monad? read more...

add a comment |category: |Views: 20

tags: another

Fast and Clean ToString()(hcoding.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 3 years, 7 months ago

For sure you have overridden ToString for your classes and the null values and other unexpected things broke your code in ToString which you have implemented just for testing or tracing and nothing more... read more...

add a comment |category: |Views: 15

tags: another

Convert Long-List-Argument Functions to DSLs by Interfaces(hcoding.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 3 years, 8 months ago

This is a little DSL for sending emails in C#. I had a function with many arguments that I should have take care of them. And the code was ugly in C#; a function name with a long list of values after it. In F# it is very nicer since we can use argument names for assigning values to arguments by using option type... read more...

add a comment |category: |Views: 4

tags: another

Foop on codeplex(codeplex.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 3 years, 8 months ago

This is library for functional-object-oriented-programming in C# 3.0 and a library of Extension Methods and data structures which I have used in my daily job. Some of these are like syntax extension macros and others are mostly handy tools... read more...

add a comment |category: |Views: 7

tags: another

Patten Matching in C# 3.0(hcoding.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 3 years, 8 months ago

Pattern matching works best with built in facilities in the language, yet this was fun to implement. Basically a pattern matching statement(expression, computation) is of type Type1 => Type2 which means it get a value of type Type1 and returns a value of type Type2. We need a set of pairs of lambdas. Each pair consists of computations of type (Type1 => bool, Type1 => Type2). First item of this pair helps us to decide if we must execute the second part or not... read more...

add a comment |category: |Views: 11

tags: another

QuickSort for Fun!(hcoding.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 3 years, 8 months ago

This is a quick sort, implemented in C# 3.0. It was fun to implement it! read more...

add a comment |category: |Views: 9

tags: another

Wafagy(hcoding.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 3 years, 11 months ago

A new design pattern is being forged into new interesting technologies and this is a re-arrangement of it's concepts. This design pattern has four main steps in implementation; and it is for unifying or making constraint on boundaries of somthing (some context): - Wrap it - Formalize it - Generalize it - Simplify it read more...

1 comment |category: |Views: 10

tags: another

One Aspect of a Successful Programming Language (Yes! Again!)(hcoding.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 3 years, 11 months ago

We have 2 different points here (of views): 1 - Feel tha joy and enjoy 2 - Make it done Or we can mix them up (unconsciously): 3 - Make it doomed ... read more...

add a comment |category: |Views: 4

tags: another

Duck Typing In C# 3.0(hcoding.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 4 years, 1 month ago

In C# 3.0 we achieve this feature by employing Extension Methods. The whole point came straightly from definition of Extension Methods, where says: "An extension method with the same name and signature as an interface or class method will never be called.". That means we can call a method on objects without providing a specific type for the compiler. Of course we have the choice to add the extension methods to just one type/class of objects; that for example have implemented a specific interface. read more...

add a comment |category: |Views: 19

tags: another

Dependency Injection Not Needed In C#(hcoding.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 4 years, 1 month ago

We do not need Dependency Injection in C# 3.0. Because we already have it in a very cleaner way!... (Using extension methods in a different way to make everything inside-out!) read more...

add a comment |category: |Views: 49

tags: another

OOP and FOOP(hcoding.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 4 years, 3 months ago

As we are using functional programming techniques more and more, new point of view is needed for some already well known concepts. In this text some thoughts on this has been presented. read more...

add a comment |category: |Views: 1

tags: another

Monad Described Imperatively (hcoding.blogspot.com)

submitted by ksh2dotnetkicksksh2dotnetkicks(135) 4 years, 5 months ago

I have written a Monad thing in C#. This Monad has a private field that I have not access to, but I can change it in any way that I want to! :O And that's the interesting thing about it :P. Once I have pushed a data into it; There is no way out of it. But I can still make any modifications to the data in the Monad. ... read more...

add a comment |category: |Views: 14

tags: another