Skip to main content

Posts

Moving on ...

My experience with blogspot has not been pleasant so far. I have found the interface and the final page rendered broken many times. If I write just paragraphs of text, maybe that works fine. But in a technical blog where there is code and links and various other formats, blogspot fails miserably. I find the themes and other user interface oriented stuff within blogger crappy. Yes, you can edit the template but neither do I have the time nor interest in that.
Google should have improved blogger to really compete with other platforms - WordPress, Ghost etc. Blogspot, obviously, is not of high interest for Google.
Overall, I am not happy with the product. I will be (have already!) no more writing here on this blog. Will be continue to post at http://vivekragunathan.wordpress.com. See you there!
Recent posts

A-Team Library !!!

A short while ago, I had to write a compelling document for a client about a library that I had developed during my tenure, call it A-Team Library or ATL. Having to learn the "eyes-wide-shut" culture to maintain the couples-of-decades old code and simultaneously develop on the top of it was very disheartening. It was time a lot of things were given fresh thoughts. Not the least of all duplication of code and functionality. But not just that. Like in a programming language, when there is more than one way of doing something, when those ways are opposing, it causes nothing but confusion. So was the case. The business seemed to be far from realizing it.Instead of showcasing the issues that were being faced and yet not realized, let me state the alternate - how things in such cases can be better:
Business has to realize or let known: When the engineering team accepts the authority of the business in deciding the priority of features, the business has to be prudent enough and tru…

The Secret behind Bjarne and Herb's Papers on Unified Call Syntax !!!

A long time back, in one of my posts here, I had discussed about Extension Methods ... in C++; sorta! It seems that the grand daddy, Bjarne Stroustoup, had read my post, and was impressed. So he has published a paper - Call syntax: x.f(y) vs. f(x,y). Good thing except I don't like the idea of assuming x.f(y) for f(x, y) while the reverse is the actual idea of extension methods. You will know when you read his paper. It seems the commander, Herb Sutter, also was impressed with my post. Not only that he too doesn't seem to like the x.f(y) for f(x, y) idea. Great men think alike. LOL! So he published his paper - Unified Syntax. How is that?

Needless to say, I was completely kidding about the Herb and Bjarne about borrowing the idea of extension methods from my post. I wasn't even born when Bjarne invented C++. The papers are detailed and deep in considering various scenarios from a language standard perspective unlike my post where I just spotted the existing but unrealized …

PHP Savers - PropertyBag !!!

The ubiquitous and the universal data structure in PHP is the array. It is an amalgamation of commonly used data structures - list, map etc. In the recent times, PHP has also adopted object orientation and introduced classes. The syntactic difference in the way a property of an array and object poses an inconvenience in the user code1 specifically when there is a need to interact with code that is not open for change; legacy or not.
JavaScript would allow you to access an object property either obj.propName or obj["propName"]. That does come in handy for sure. Besides, accessing the property by [] tags is the only way if the property name contains characters like hyphen: obj["prop-Name"]. At the user code level, it is fair to see an object as a bag of key-value pairs.
Along the same lines, it is not wrong to expect the same in PHP between an object and an array; although there is a fundamental difference2. The expectation arises when there is a lot of code that ge…

Cool Regex Testers !!!

Anytime I have to play with regular expressions, I use one of the online regex testing web sites to come up with the regex I need. Last couple of times I had to come up with a regex for most common everyday stuff like dates and such. Oh yeah, last time it was date actually. I had a server response that had a date in the format yyyy-mm-dd, ISO format. I was working with JavaScript, and initially I was naive to use the Date class to parse the date in the response. Turned that there is difference in the way the date is interpreted by Firefox and other browsers.
Ok, this is not a rant post about the Date class but actually share some sites that help you with regular expressions, of course at different levels. Here is a list of such sites:
http://regexpal.com/http://regex101.comhttp://rubular.com/https://www.debuggex.com/http://www.freeformatter.com/regex-tester.html
In the above list, I like the last but not the least - freeformatter.com. The cool thing about freeformatter is that it lists a…

Overloading vs Variable Arguments !!!

In a statically typed (object oriented?) language, function overloading offers the facility of organizing your code into two or more functions with different types and/or number of arguments. This is highly useful when the functionality offered by the function can be invoked in different scenarios. For instance, let us consider the function(s) below:
// C# code Dictionary<string, object> CreateResponse(string msg) { return CreateResponse(ex.Message, 0, false); } Dictionary<string, object> CreateResponse(string msg, int code) { return CreateResponse(ex.Message, code, false); } Dictionary<string, object> CreateResponse(string msg, bool success) { return CreateResponse(ex.Message, 0, success); } Dictionary<string, object> CreateResponse(Exception ex) { return CreateResponse(ex.Message, ex.HResult, false); } Dictionary<string, object> CreateResponse(string msg, int code, bool success) { var errorInfo = new Dictionary<string, object>(); errorIn…