A Paradox of Braces

A great deal of thought goes into language design. Eric Lippert’s posts is a living testament, at least for C#. Syntax and idioms are also part of the language design. When designing a language, the designers have to also consider its future. For instance, when designing C#, Anders and…

JS Programming in C# - Local Functions

Functional programs treat functions and data alike. No discrimination, if you will. That means, you can declare and use functions – assign to variables, pass to other functions etc., the same way you would play with variables. A canonical example of a functional program would show how to pass functions…

My Take on Picking a Log Level

Logging? What’s there to talk about logging? It’s straightforward. Use the one of the log levels and log it. The ubiquitous log4j‘s website says … ERROR level designates error events that might still allow the application to continue running FATAL level designates very severe error events that will…

JS Programming in C# - Objects on the fly

Creating objects without defining types is considered a great flexibility in JavaScript. JavaScript treats objects nothing more than key-value pairs. Yeah, you can declare functions in the object but they are still part of the key-value philosophy. Bottomline: JavaScript did not start out as an object oriented language. Typically, objects…

Writing sonnets in C++

Recently, I came across this post – Write a URL in a C++ program, one of those C’s tricks. If you have not already read the post, I will wait until you read and return … Waiting … The crux of the trick is the protocol part of the…

Compiler aided overloading

I was playing with xUnit.net for a pet project of mine. I wasn’t writing test cases with xUnit rather I was using the underlying xUnit engine to discover test cases and invoke calls that execute desired test cases. Forget the details of what I was doing, let…

C++/CLI Primer - An Apress Book

Earlier this year, I wrote about publishing C++/CLI Primer on LeanPub.com. I wondered if there is anybody else besides myself and Microsoft using C++/CLI but readers surprised and humbled me with their support. Seems C++/CLI is here to stay. Know why? A couple of months back…

Problem Reduction

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 distance between two words in a given set of words. Following is an unanimous solution,…