Tuesday, January 29, 2008

Language Bashing

"You know what - Java sucks". When someone tells something in those lines in front me - my blood boils. I am literally letting my heart speak rather than making the expression any less intense.

Well, as a matter of fact, I was one of the victims of this unnamed syndrome when I graduated from college. At that time, we had three choices - C or C++ or Java. Some went ahead with C, few with C++ and many with Java. I belonged to the last camp. My frequent attempts were to educate people with Java and how powerful it is. I despised people who coded in C - like they live in some sixties still. For C++ people, I had some admiration - but I knew that 90% people who say that they write C++ code, actually mean they write "C with Classes" code. So, I often indulged in verbal bashes in favor of Java (quoting the design patterns to whom most were unfamiliar). Sometimes, I could convince people - sometimes I just gave it up.

After a while, AJAX came into picture. That, I believe, is a turning point in defining what would be the perfect language. I will give the answer after a few lines here. The next noticeable turnaround was the chanting of "python" mantra by Google-related sources. People said that C++ and Java are soon to be extinct : scripting is the way to go. You will find millions of just blog lines and comments arguing that this language is the future and that cannot hold any longer. Had those developers written that many lines of code - probably some company would have posted more profit than Google did (or whomsoever is the leader in this area). Few long-bearded gentlemen proposed Rails and further Ruby-on-Rails. I guess - that is the sweetest name of any framework I have ever heard. And again all hell broke loose. People against people - on something so abstract.

And still today I hear it - "Java is for web development Man! Do you want to go in that field?"

People who are expert in PERL should die. And those still writing code in Assembly - I guess they should take a hack-saw, put in some salt & after-shave mix on the ridge and start cutting their throats right now. I am sad to say them this - You guys don't even get discussed among these people. Read on.... you can do those once you are done with this article. I hope you change your mind.

The ONLY answer I have for all these people - who ask such STUPID question & perhaps are too adamant about seeing the truth is : Someday, you are going to learn it the hard way - brutal and it will hurt.

"There exists no ONE language for all purposes". That being said, people still try to make coteries among language. Oh you know what - if you are in this subset {ASM,C,C++}, then take the kleen closure and you are cool. Otherwise, you are not among the best. Shocking!!

I have been riding this wave for 4 years now. And perhaps I can see the shore. My belief is that there is exists no ONE language for all solutions. Neither coteries help. What matters the most is this simple question - "What is the fastest way you can make money out of the effort you put in and once done how long does it take you to keep it generating worthy revenue". I guess you would understand how sensible that question is - you involve business in and you see everyone is nodding and listening to you very carefully. Read on.

Money matters to us all. We may want to be a filthy rich professional or are a humble millionaire already through stock options - what we all believe in at the end of the day is we EARN our money and this earning never dries - till we are faithful to our work.

Said that - we are always home with certain technologies like C++, Java, Oracle, MS Office etc to name a few. Anything beyond that will make our ears go deaf. Protests will just be knocked out without giving any second thoughts.

No doubt they are the best products of some of the VERY best minds in our industry - but didn't they solve some purpose too easily which at one time looked unsolvable. That is the main reason why they have gained so much popularity and people have embraced it. But one needs to know, someday a bigger different problem would exist - and then everything would break loose again. We need a new solution and it would be one of its kind. Evolution is something which we can't stop. We HAVE to embrace it and live our lives.

So for people who are still reading as in why Java DOES NOT suck against C++ - I will answer next.

Any product, given a bunch of exceptionally talented engineers, can be written to the best it can perform. Did I forget the language part there?

No.

You guys might want to read the INTERNET more than a NORMAL / AVERAGE person who uses Java does. There are many benchmarks which cite performance measurements with Java outperforming C++ compiled with g++. I AM NO WAY SAYING NOW THAT C++ IS BAD. There can be many reasons to this - The platform can be a mobile phone whose stack was implemented in Java - so JVM compatibility was the best when the apps were written in Java. What you often forget is the following two simple things which are utmost important to any product development:

1. Time to turn around the concept to reality - a neat and clean working code
2. Time to fix bugs

Now, if you really don't want to hold no longer and ask the AGE-OLD tried and tested missile question - "What happened to performance" - All I can say is this - "Every language gives you freedom to fiddle with it - to the degree that you modify and use it to the best you want to". In case of Java, you may want to redefine the garbage collection and tweak in the JVM. But you won't : as language bashing is the easier route.

A new age is upon us. When I started using computers, C++ was the standard. Java came into boom in late nineties. We bid goodbyes to procedural languages and welcomed OO frameworks. Somewhere and sometime, scripting language sneaked in. Some trillions of lines were written overnight and they remain as backbone and sometimes the most important asset of many companies. We jumped guns and embraced Javascript through AJAX - because it just looked cool. The person who still does not know what is the POWER of AJAX : will not give you an iota of respect if you say that your bread and butter is Javascript. May be PHP might sound cool to him. (Don't say ASP or JScript - you will fall 'down' into some domain that he cannot define himself).

Then why is that Cisco still uses Assembly in its best possible routing codes. Why do companies employ people to learn PERL and write those very million dollars worthy UNIT test cases - is TDD bad after all? Or why does not Google do all its development just in C++? Why does Microsoft spend money after all in inventing F# or asking teams to build products using D. Why Bruce Eckel takes the pain in evaluating Scala and advising people that it is the most definitive successor to Java. Why in MIT if you still get admitted, you get to use Scheme. And you thought coding in Python was cool.

Baseline - It is the time to build and sell the product which matters. Do it in a language you are comfortable with - so that you will write less buggy code and give a better output in the time assigned to you. But by that don't convince youself that you have evolved to the best you can. Keep you eyes open. C++ has its place - may be in embedded systems, may be with C++0x you would find a Concurrent Language worthy of learning (you might want to learn a language which is inherently concurrent - not just supports threads as a library). When you speak about Oct core systems, if you write a program which does not exploit Concurrency - you should feel sick downright - coz you are wasting computing power. Don't you think there should be language ConcurrentJava which would befit. Or you still want to to fall into your coterie and be Multi-C.

Java or C++ - they have places to stay. So is ASM. You want real time - use ASM. You want little lesser than that use C. May be even C++ now-a-days gives almost the same runtime support with HALF the development and perhaps ONE-EIGHTH the maintainance time. Use Java to build applications in Distributed Platforms - Isn't today all the work done in distributed scenarios? You want performance - tweak in JVM. Profile and profile. When you give up - know that given ONE-TENTH the time you invested in coding it in Java, you can achieve the same mark if you switch to any different language if you have some excellent coders in your team and IF YOUR DESIGN IS PERFECT. People neglect the 80/20 rule and start cursing Java. They don't realize that the 80 belongs to the debugging and cross-platform issues in C++. In Java most of the time is spent in designing. Still, some good coders are faithful and regardless of language, spend time in architecting the entire thing - before even deciding what to use : I say they are the best coders, even if they have not written even one damn line!

So, start googling for the language problems you feel you have. There can't be a case that all your problems are solved by one paradigm solution. Learn at least one from each - Assembly, Procedural, OO, Scripting and Functional (sorry, If I missed anything here - tell me and I will learn). You can build a browser in just 25 lines of Python code. While in some - you can multiply two matrices in just one line.

Remember that what matters is you should propose a solution which should be independent of underlying infrastructure. Model you design to not compromise with anything. Then start picking what fits in best based on constraints you have :
1. Time to build and sell (Productivity counts)
2. Ease of collaboration
3. Ease of Maintainance
4. Debugging
5. Inherent features and Recent Developments
6. Open Source Initiatives and Available Plugins
7. Scalability and Performance Metrics
8. Agility

So the next time if someone asks you - "Do you recommend me reading Java or C++?". Just stare and stay silent - Do not utter a word. I hope he feels like he asked a question which perplexed you so much that you could hit him at any moment. After sometime he would realize it and start describing the actual problem in his design and then asking for advice. All you need now is to educate him not to ask that little **stupid** question again.

Saturday, January 26, 2008

Potpourri

We are always living in times when things are happening - even when they seem to be still and quiet. In case you are like me - you must know this, that you are missing out the celebration somewhere.

In the winter break I watched so many movies that I stopped watching any more this semester. With that I meant I stopped watching movies on television. I watched Halla Bol recently - but would not recommend as a must watch. The theme lacked a force - may be few strong dialogs from the main actor Ajay Devgan. And yes, before that I watched Juno. Nice movie - simple story : good watch. And I always knew the guys in SuperBad would be seen in many more to come.

And then there is Australian Open. All sorts of thing happening this year around. Tsonga beats Nadal as if Nadal was the one who was unseeded. The volleys and techniques just stunned Nadal who tamely lost the game. The courts are said to be slower than US Open, but still Tsonga repeatedly surprised Nadal by coming to the center of the court and taking control of the game rather than letting Nadal to continue his baseline ralleys.

And then the historic upset - I would say this because I respect Roger. When he says he has created a "Monster", we have no idea how high peoples' imaginations soar for him. I watched his game against Blake - James was no match. He was a spectator to almost most of Federer's returns. People often say that this man is 26 and still the fastest around. But....

Someday all this has to end. If not this grand slam, still signs have started coming in. And I hope the best for him to make that 14 as soon as possible. Djokovic was not very good - but he played really sensibly. My analysis (whatever sane my mind could think) is that Roger dig his own grave by making more unforced errors than that is allowed in a grand slam final and come on - its not allowed to him either, he is Roger Federer. Novak never failed trying and the moment he got the opportunity to break games, he took his chances. It was a great game to watch and to see the legend bow down. I am making him a legend - coz I know he is sure to be one pretty soon.

Next comes Fe-male matches. Sadly I watched the finals. My observations were that ladies should not have two serves given to them because 99% times they tend to make mistakes in the first serve. Hardly you see 2-3 aces in the entire match. Anyways, as reported in the news, it must have been a photographers' frenzy to watch Tennis's 2 hottest and best players fight each other - Serbian Ana Ivanovic vs Russian Maria Sharapova. Who then cares what happened to match? Haha, just for the records - Maria won it in straight sets. But I cheered for Ana and I know Maria ain't last long.

What else - I had and have my classes going in full SWING. Unfortunately, rather than going out and playing it, I am in my blanket caught napping for past a month now. Thats {bs}ad.

Next few weeks are going to be interesting. I am hoping that I get some Internship Calls pretty soon - now that its time to convert and secure something for the summer. So, thats in a whole a short diary of what happening these days. And being a lazy bum - I did not celebrate republic day ? Why, because by the time I recollected it was THE day the time in the clock was 6:30 pm. India was already past the day :).

Adios.

Monday, January 14, 2008

Bloated, Wrinkled and Dead

Things sometimes don't go well. You can see them working - but not around you. You see people moving on with those things quickly and efficiently - they are happy. Sometimes thats makes you all the more sad. Is it not?

Well - to make it worse - you can't stop them from moving on. Can you? They have every right to. We all live for ourselves. And then you know that you are alone!

Still - a wise man has said, "It is not what happened to you, It is what you do about it". Perhaps, that extra hassle will pay off some day. Life is unfortunately an infinitely big circle. The moment you call your game to be over - might be the turning moment of your life. Its a casino which never shuts down itself - until you pack your cards. So as I always have said to myself - hang on!!!

Monday, December 31, 2007

Reflections and Reverberations

It's time to look ahead. It's time to look back. It's time.

Nobody knows what 2008 has in store. Will it be different? Will it bring all the bads to an end in your life? Would it make this life a little bit more lively, if not filled with celebrations day in and out. I don't know.

The calenders are turned in and people look at months ahead and make tentative plans. Some people keep them. Most forget and get busy with mundane schedules of life in which this new year's celebration adds nothing but hope. Is it all in vain? I am not sure.

So, should I be celebrating still when all these questions remain unanswered? I thought I had a good appetite for them. I am contemplating now on things. I am nobody.

As I deliberate more, I fall into these loops and I can see that I get swamped into the fake patterns which life shows. The more I try to understand them, the more it intrigues me. Sadness and Happiness over long terms share common proportions. But can I amortize them over any period of my life? I have no answers.

So, how does it matter if it is 2008? This time next year, I may be sipping margaritas somewhere or will be drinking my sorrows away. But both of them would have started well before the new year giving it no due significance. Do we need a new year to drink? Aha! No, Not at all.

2008, 2008, 2008 ...... Reverberating everywhere. Hope it goes on for sometime for the people who dreamed to see this day. Let them have their share of joy. And then, lets get back to where we started. The mundane circles of life awaits our presence.

If you really want to remember it, do something new. Even if it is a small thing not worth of any significance, do it for yourself - probably it may turn out to be a reason for you to remember new years. If not that, perhaps your life may not remain mundane after all. Little works of pleasure build an empire of happiness.

Sunday, December 23, 2007

Supreme Beings of Leisure

I am no connoisseur. But the taste is far too difficult to forget because the ecstasy seconds to none. And well for that matter, the pleasure is Never the Same.

For few days the Johnnie Walker Black Label Advertisement was airing and I liked the jingle a lot. Being all ears to good music (what I think is Good Music) I tried to get the source (if any). Needless to say - the names are perhaps aptly given.

I got a lazy lounge version of the song - soothing and flowing as slowly as possible. The Details:

Track Name: Never the Same Album: Supreme Beings of Leisure.

Classy, ain't it? Well for that matter, Johnnie Walker is meant for such a coterie. Cheers.

Thursday, December 13, 2007

A Math Riddle



This is a twisted version of a simple thing. I bumped up to this while trying to come up with the formula for summation of squares of natural numbers and if they could be derived as a factor of sum of natural numbers. But, I went down and down into the whirlpool. Finally with some online help, I could find my way out. Do post your comments about whatever you could come up with.

Do you think the approach is wrong? Why?

Tuesday, December 11, 2007

MiKTeX

{/begin}
My First academic semester at UF just ended yesterday. And I was so happy that I did not sleep yesterday night. Weirdo am I?


I would like to pass on some information about useful stuffs one should know if you have something to do with Computer Science in general. Perhaps this is pretty vague and may be redundant - but still you can take it as a preaching hah :)
{/end
}

MiKTeX - Let me take this first. Well, in case you have not heard yet about LaTeX, its high time you get to know what it is about. If you write long documents, have a knack for preparing them beautifully and could not quench your thirst with popular word processing tools available - go for it.

Well, just for the fact to get the dates straight - TeX was written in late 70's and is much popular in the academia domain. The typesetting system was developed by Donald Knuth and many others contributed to it along with support for all major operating systems.

The TeX file looks kind of a html file but is strongly typed. Most of the commands start with a backslash. The file (usually stored in .tex format) gets compiled into a DVI format (DeVice Independent). The DVI file can be sent as input to printer drivers or converted to pdf or postscript formats.

All these formats are standard formats which can be used without explicitly obtaining any licenses from any proprietary sources - This is the best part.

Sadly for novice users, afaIk TeX does not support WYSIWUG formats. So there are two options - one can take existing pre-written files and change stuffs as per one's requirements. Take a smaller version - there are plenty available, all you have to do is forget being lazy and google for .tex files. Of course any worthwhile task consumes time before giving results.

Or, you may write down from scratch. Remember to make a lot of tex files for specific purpose - which will prove to very useful for future modification. Its very tedious to read 1000 lines of tex code as it is to interpret a 1000 lines of html spaghetti.

You can include these smaller tex files into a single tex file. This file can actually contain only 10 lines and these lines are nothing but inclusions of 10 specific tex files. Remember, the order is important as in any C program.

It is not just about mathematics - why one should use tex. The problem is with over repeating things. You always wanted to do things once and use shortcuts the next time. Word Processing offers so many shortcuts - that they literally abuse it. You struggle with things which should have been simple. They break that rule that things should be simple, but no simpler - and I just abused Occam's Razor.

Hope you get it. Perhaps on a Sunday, when you feel like trying out some good stuff, give this a try. I installed it on MS Windows. Go to MiKTeX Home Page. Lots of Documentation is available. Read the Installation properly because you would not like to mess it up. I downloaded the complete installation from a local mirror available with UF. A recommended editor from this website is WinEdt. Try it out. You may go for other installations of LaTeX. Tell me about it if you know something is really good.

Next Blog would be on few video lecture courses in Computer Science - highly recommended for students in the bachelors' program. I am currently viewing the course lectures. Once completed I would post complete information about it.

SiteMeter