Different ways of solving problems in code.
- by Erin
I now program in C# for a living but before that I programmed in python for 5 years. I have found that I write C# very differently than most examples I see on the web. Rather then writing things like:
foreach (string bar in foo)
{
//bar has something doen to it here
}
I write code that looks like this.
foo.ForEach( c => c.someActionhere() )
Or
var result = foo.Select( c =>
{
//Some code here to transform the item.
}).ToList();
I think my using code like above came from my love of map and reduce in python - while not exactly the same thing, the concepts are close.
Now it's time for my question. What concepts do you take and move with you from language to language; that allow you to solve a problem in a way that is not the normal accepted solution in that language?