Problem Reduction

algorithmsC#min-diffprogrammingword-distance

Problem Reduction is what I call when a given problem can be expressed in terms of or solved using a solution to an alternate problem. Take for instance, the word distance problem: Find the shortest …

Read more →

Iterators vs. Generators

C#designJavajinqLINQprogramming

Yes, there is a difference. Although both produce the same end effect, an iterator is not the same as a generator. The difference is in the way it is implemented and also consumed.

Read more →

JINQ

.NETC#JavajinqLINQprogramming

JINQ (Java INtegrated Query) is an ultra minimalistic library inspired from and mimicking the .NET LINQ. While LINQ is a language level construct, JINQ is composed of types - classes and methods, but …

Read more →

Partial Classes – Java ???

C#Javapartialpartial-class

I am really sorry if I tricked you into believing that Java is offering partial class feature. Unfortunately, Java doesn’t. Maybe never will. But I am going to talk about a workaround also presenting …

Read more →

final, const and beyond

C#constfinalimmutabilityJava

What are your thoughts on the following piece of code? public String someGibberishMethod() { int length = someMethodReturningLength(); int sum = 0; for (int index = 0; index < length; ++index) { // …

Read more →

An Unfair World of Tuples, Anons., var and auto

anonymous-classanonymous-typesautoC#Javatuplesvar

It all began when I wanted to return more than one value from one of the methods. Although my attempts ended futile, it was fun exploring and musing how things could have been. There are at least a …

Read more →

A Simple Tree List View

.NETC#listviewtreelistviewWinForms

Digging up stash is one of the best pass times. You know you never know what you will find. I had an article written quite some time back but had not posted it anywhere. Not sure why. I posted it at …

Read more →

Missing MI !!!

C#codeprojectMI

We all know C# does not offer multiple inheritance but offers arguments that programmers can live without it. It is true in almost all cases, especially all cat and animal or employee and manager …

Read more →

finally and Return Values !!!

C#codeprojectfinally

Let us read some code:- int SomeMethod() { int num = 1; try { num = 5; return num; } finally { num += 5; } } What is the return value of SomeMethod? Some anonymous guy asked that question in the code …

Read more →

Extension Methods – A Polished C++ Feature

C#extension methodsinterface principlekoenig lookup

Extension Methods is an excellent feature in C# 3.0. It is a mechanism by which new methods can be exposed from an existing type (interface or class) without directly adding the method to the type. …

Read more →