Posts by Nirupam Biswas

I am not the one who goes out a lot, but likes to know about the outside a lot. Likes to make friends, well have lots of them, fortunately. Loves programming, well ‘am still learning.

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.

Firefox 6 is out! Yeah and it’s not a beta.

Mozilla has gone nuts with their release version numbering. In a span of two – three months we get FF 5 and 6! Too good to be true? Yeah right. They say that it is just a number but these “just number” upgrade breaks extensions. At the time of writing this article Firebug was still broken in FF6.

Below I have pasted some interesting comments on this subject by other vexed FF users. (Src: http://hacks.mozilla.org/2011/08/firefox6/)

 

  1. Luis Elizondo wrote on August 16th, 2011at 9:16 am:

    Not enough changes for a mayor version release. I don’t want to be using Firefox 3569 next year!

  2. louisremi wrote on August 17th, 2011 at 12:37 am:

    We’ve changed our release cycles: http://hacks.mozilla.org/2011/04/aurora/
    Version numbers are just numbers, what matters is that we deliver features faster to you, Firefox users and Web developers.

  3. Jose wrote on August 17th, 2011 at 4:16 am:

    Considering that “just numbers” break extensions and make it just plain difficult for admins…

  4. Alex wrote on August 17th, 2011 at 6:19 am:

    Couldn’t agree more, Jose. Another new version…half my extensions no longer work. What’s the point? Using Firefox is no longer ‘fun’.

    And, rapid updates is one of the reasons why Chrome is unsupported at work…now Firefox? You’re pretty much pushing companies back to IE. Heck, we’re still on IE8 at work, probably won’t go to IE9 until next year. Whether it’s right or wrong, companies move at a slower pace, because they need to continuously support the internal software that keeps the place going. These rapid changes just mean that Firefox won’t be supported anymore. The extensions we need for day to day work keep breaking every few weeks now. It’s not good.

  5. Logan wrote on August 17th, 2011 at 6:45 am:

    I agree, this new versioning is ridiculous. If they’re just numbers, what’s wrong with “just numbering” them 4.1 and 4.2? Save the whole versions for releases that are actually a big deal.

  6. austin wrote on August 17th, 2011 at 7:05 am:

    i have to agree the version numbering is going too high too fast, and soon you will be at very large numbers that start to get ridiculous (as his “firefox 3569″ alludes to) people can handle small numbers even weird decimals(i say weird because 3.5.26 is not a real decimal but kinda looks like one. its made of a series of small numbers that are easy on the eye)

  7. Luis Elizondo wrote on August 17th, 2011 at 7:47 am:

    This is already ridiculous. This change to the release cycle is one of the stupidest decisions I’ve ever seen in an Open Source Project. What are you trying to achieve Mozilla? Really. You’re breaking extensions every two months or less, you’re making it really hard for developers to keep up to date with your changes, and remember, those developers are working for free, on their free time. Remember the expectation of Firefox 3 and Firefox 4? Millions of downloads in hours, even a Guinness World Record, and now with 5 and 6 you’re just loosing momentum against other browsers, when will you get another ‘Firefox party’ to celebrate the next release of the “Greatest Browser Ever”? When you reach Firefox 1000? Or maybe Firefox 2000? Again, this is stupid. You can still make really fast updates without moving to a major version and making big efforts to not break extensions.

    I will still use Firefox because of Firebug, but the moment you break it with one of your “mayor” versions, I’m done with you. There’s no reason to keep using a browser like Firefox when I have other options. This is not year 2000 when we have only two options.

  8. Jose wrote on August 16th, 2011 at 2:22 pm:

    Thank you for breaking my extensions once again. Whats up with the number jumps????

  9. Luis Elizondo wrote on August 17th, 2011at 7:51 am:

    Ohh, don’t worry, developers will fix them just about a week before they launch Firefox 7 and the history will continue.

  10. Andy M wrote on August 17th, 2011at 6:53 am:

    I don’t mind the new features but why does each new version have to break so many plugins and add-ons?

    It’s damn annoying to lose functionality that works perfectly well, just because a few new features have been added.

  11. raj wrote on August 17th, 2011 at 8:32 am:

    version no’s can be 1 thru 100000. by the time we reach 1000 the product itself will become obsolete. we dont have netscape anymore right. same way. of couse firefox is the new avatar of netscape. so by the time firefox reaches 1000 it will be rechristined firebox LOL

  12. Joe Luhman wrote on August 17th, 2011 at 10:07 am:

    Thank you for breaking my extensions for the second time in as many months. How long is this insanity going to continue? Please stop breaking the extensions for every major release, or please re-think this silly move to a six week ‘major’ release cycle.

I just hope, Mozilla come to senses before the users run out of patience.

CInkv2 release postponed

Last weekend I was about to release CInk v2, but at the last moment I found a big bug in the way paths are implemented. Now the situation is quite tricky to solve. On top of that, now-a-days I find myself with very little free time. Anyway I will continue to work on it. My estimate is that now CInk v2 release is postponed by a month.

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.