Making Frameworks

Every few months we see a new framework springing up somewhere. Now we have too many choices. In fact it is little too much. Unfortunately, choice is something you don’t have in a typical enterprise. In an enterprise, software developer is coaxed to make use of many frameworks from which he would rather run a mile away. Not a day will go by without him criticizing them. Is something wrong with today’s developers? Why do they always keep criticizing about something which their managements rave about?

Before I continue I should clearly define, what I mean by (software) framework. I consider a framework to be a package (a closed box) of code that helps a developer to instruct the computer electronics to solve some problem. Now this problem could be of many types. You already know that instructing a processor in their native language (machine language) is no simple task. In other word this is a problem. To solve this we have the OS. Yes, OS is a framework too! Think about this. OS provides us with some basic APIs to read file, read from network, allocate memory , display output, taking input, and so many things. Your program doesn’t have to code them. OS provides APIs for them. So, OS too is a framework, which solves some common problems. To interact with Microsoft Windows’ API a VC++ programmer will typically use MS Foundation Class (MFC) library. This is needed since interacting with raw Win32 API in itself is a problem. It is very difficult to use. To ease that VC++ provides MFC framework. So, a typical framework also solves the problems in other frameworks.

No software in this world is perfect. If they were then there would have been no software industry, as service accounts for 70% revenue. They all have problems. This means there is always scope for a framework which solves that. However, the framework itself is a software, that means we need more frameworks to solve that! This has given birth to today’s infinite stack of frameworks. Stack of frameworks is no doubt needed but an infinite stack is always ridiculous. Infinite stack is a condition when developers try to fix problems from the top of the stack instead of going down and fixing the source of it. Unaddressable problems in a framework usually arise from design issues and lack of foresight. Perceived problems in a framework arise from framework user’s lack of understanding of the scope of it. In either case the developer using the stack should remove the problem framework, but usually end up adding a new framework to it. This is because – 1) It is cool to create a framework. 2) It is much easier to code a framework than make management understand why you want to change the stack. Once plagued with this condition the stack will inevitably grow like cancer until the hardware begs for mercy. At which point it will be declared that the stack is too advanced for current hardware.

Broadly classified, frameworks are of two types – thin and thick frameworks. Thin frameworks try to ease out some kinks in some other frameworks. Thick frameworks are the one which promise to do every god damn task you throw at them. In future if technology permits then maybe we will see a thick framework which will not only write the codes for you but also clean your kitchen floors. :p If you are a developer then you must have come across some frameworks like these.

It is interesting how sales people have changed the jargon to market frameworks. They do not use the word framework. They say it is a ‘technology’. Typically thick frameworks are marketed like this. Sales people will typically list out mind numbing number of features and at the end of the presentation the only thing you will remember is that this ‘technology’ is very powerful and hence awesome.

Endless frameworks stacks are no doubt ridiculous, but thick frameworks are evil. You depend on them and when things don’t work out the way you want then you will have run after their creators for help. Remember they are closed box. In industry parlance, they are black box. So, you know hardly anything about how it works. Do you want to take the risk of using something which does 90% of the job without you knowing anything about it? Thick frameworks, even when open source, are still dangerous. It is simply because they are so hard to code and could possibly have loads of bugs. This brings us to an interesting point. The code that we build on top of a framework in itself is a package of frameworks, in fact we can call that a framework too. So, does this mean the bigger the code is the more unreliable it is? Well yes, of course; but we try to minimize that by dividing the code into distinct (almost) independent parts. So, this means when evaluating a thick framework we must always try to identify the independent parts in it. If any such part is too big and complicated to understand then you should not go ahead with it.

A user of a framework must understand how the framework works. A normal user of OS need not know this, but as a developer you must know. This is because a normal user will always stay within the bounds of the foreseen scope, while the developer needs to push the boundary of it. By the time a developer understands that the current stack may not fully meet his requirements, it is already too late to change it. The only way around in this case is hack it! To hack it you need to know it inside out. For example, it is best to avoid a web framework which is so thick that you don’t even have the slightest idea of how it routes the HTTP packets inside it.

People now a days seem to miss the point of creating a framework and ‘technology’ stacks is solving problems, not multiplying them. Never make a framework which has more problems than the number of problems it solves.

Site running on steriods or so I am told

I was told Nginx is superbly efficient and is the only way I can keep my server from being thrashed every two days. Yesterday I moved to Nginx. So far so good. If it runs fine for a week without issue then fine. Keeping my fingers crossed. Will post my Nginx configs then.

One more thing before I sign off. Apache processes are bloated since it has mod_php embedded in it. In case of Nginx you need to rung Php processes separately. So, in this case we must count the memory usage as the combined total of Nginx and Php. In many cases you will end up with the same memory size as that for Apache but there is a catch here.

Nginx processes have very low memory footprint and it can alone serve all the static files, very efficiently. This will cut down on a huge load since, on your WordPress powered blog too, there are loads of static files – images, Javascript, CSS, etc. Only the Php rendered page will tax the system, but hold on, here comes the second catch!

Your blog’s content doesn’t update every day or minute. So, why do we need to go to Php for each and every user and re-render the page again? Well we don’t need to. WP Supercache is a plugin for WordPress which does just that. It generates the static htmls of your pages and keeps them on the disk. Whenever you publish something then it will update the related static html. Cool isn’t it. What is cooler is then you can configure Nginx to directly pickup that generated static html from disk and serve it to the user, completely bypassing the bloated Php. 🙂 Only when it doesn’t find the needed static html file then it will need to go to Php to generate it.

New place, new face

As I reported before, I have moved to “cloud” based hosting from eApps. Moving to “cloud” was no easy task, and more than once it knocked the lights out of me. After many tussle and numerous tickets, rackets, hair uprooting exercises and under the hood tweaking, I guess now I can rest easy.

To celebrate this occasion and to save myself from further boredom of using the old theme, I have moved to this new theme. Hope you enjoy this. 🙂

OOh, BTW, the Bengali tag line under the banner is the literal translation of Apple and phonetic transformation of Grew. So, the Bengali text should be read as – Aaa-pel Gru. 😉

New (possible) social engineering attack using forums.

First a disclaimer: I am not 100% sure if the incident that I am about to mention was really a social engineering attack to steal my email id. The attacker introduced himself as Osher. Osher if your intentions were really good then do let me know and I sincerely apologies.

The incident

Refer to the comment posted by some guy Osher on my post ‘Making sense of standard deviation‘. I had asked one question in the StackOverflow forum, to which he replied on my forum! his repose read funny.

Hi – I’m trying to get you without any relevance to this post.
I’m referring your post in Stack Overflow:
http://stackoverflow.com/questions/5230144/script-tags-in-body-not-get-evaluated-after-previous-js-errors

I don’t see the mechanism of Stack-Overflow fit for dialog, and I need some information to understand some things before I can post a reply…

Is one of the scripts that do not exist any more is HtmlUnit?
I suspect that the problem is that you take API that you get from HtmlUnit as a part of JavaScript, and when you take them out – you get null-reference on APIs that HtmlUnit provides and is no longer available

find me at osher.filter (at) gmail.com, and we’ll sort things out 🙂

If you read his reply then it doesn’t make any sense. Furthermore StackOverflow has comment section for discussing stuffs. You need not reply in anybody’s forum. My StackOverflow account has my blog address, so it wasn’t hard to guess how he came here. My guess is that he wanted to harvest my email for spam, so I replied to him by posting via my forum. After that I never heard from him.

So, friends beware on the net!

Maybe Pizzas and Subways have caused some allergies in me

Like many I have feasted over many Pizzas and ‘healthy’ Subway burgers. Infrequently and sporadically I have seem to get allergy attacks where hives form on your skin [1].

Hives will cause lot small swellings to form on your body, as it happens in case of insect bites, but all throughout the body. Many of the swelling may merge to form bigger islands. Along with that you will get extreme burning sensation throughout your body over your skin and incessant itching, but itching only spreads the hive formations.

I remember, I had this for the first time in my life, more a year ago. I had a Domino’s Non-veg pizza and after 15-20 mins I went to a local market, where it was hot and sweaty. I started having itchy sensations over my head and arms, along with some hives. The hives were not red and looked like it happened as a result of some mosquito bite. Then when I started scratching them then the situation aggravated. In half hour I was back home and my body was full with hives and islands and it was burning my skin. I took a cold shower, even though it gave a little relief, but it felt like thousand stings. My roomies grew concerned about my situation so we went to a doctor and took a shot of an anti-allergy medicine. It took about an hour to recover after that.

Later I called Dominos to query about any ingredients they put which is known to cause allergy, but as I expected they did know of anything. I had the dreaded thought that I have developed allergy of chicken! Finally I concluded may the heat, sweat and dirt caused this. Time passed and I had many more pizzas and I never had such an issue except for one another day. This time I was at home and was cool and dry. This time I tired not to scratch and in 15-20 mins I recovered.

It has been now one year and today after having Subway burger that same hive allergy struck me. Today also I was cool and dry and I tried not to scratch myself and I recovered in 15-20 mins, but now I could not ignore this anymore. So, I googled and found loads of information. So my final conclusion is I have developed allergy against corn syrup.

Conclusion

It seems I have developed allergy against High Fructose Corn Syrup (HFCS). This is a very dangerous substance and unfortunately, as I found out today, it is present in almost all fast foods. Including Subway burgers and Domino’s Pizzas [2][3][4]. This is also known to cause allergies, like hives [5].

Links

The HDFC scumbags.

I got a call from HDFC saying that I am being offered a Credit Card which has no renewal fees. I needed one but only for international online transactions like paying for this server, but didn’t want to incur any additional maintenance charges. Well so, I inquired and was assured that there are NO MAINTENANCE charges.

But the telemarketing scumbags of HDFC didn’t reveal then that there is indeed an annual charge for dormant cards of Rs.400. Well as it turns out if you do not make total transactions of minimum Rs.50000 per year then your card is dormant! This is exact reason for which I turned down ICICI credit card even though I have bank account there, but at least they were very clear and truthful about this.

HDFC you got me. Now I am now thinking of getting other bank’s credit card (maybe ICICI, even though it costs Rs.100 more), and will get out of this shitty bank.