Wednesday, December 3, 2008

Learning the Language

Today we have a plethora of computer languages, mostly open source, to pick from to suit our needs. For example, for simple web applications, there is PHP, for programming dealing with heavy math calculations, we can use Fortran and so on and so forth. Coming to my mother tongue, Java; it is a boon for large enterprise level applications. The advantages that distinguish Java from other languages are 1. Object Oriented paradigm, 2. Automatic memory allocation and garbage collection, 3. Enterprise level support, 4. The number of java professionals available, 5. Enterprise security and many more.....
Through this post, I want to express the problems I faced while understanding the language. When I first heard the name, I didn't know that there are language paradigms like object oriented, procedural etc. A language is a set of instructions given to the computer, that's all I knew from my minuscule experience with Fortran and C. But here I was determined the learn the omnipotent language.
The first day of training was exciting with the trainer promising big. The second day he started with a comparison between procedural and OO concepts. We were told to imagine everything as object. "The chairs, tables etc are all objects, and java works with objects", he said. So far so good, but nothing related to coding, I thought. Then we started with the core OO concepts like Polymorphism, Encapsulation etc. As examples, the trainer was writing some rough code on the writing board, but hey, I don't know the Java syntax at all. What I found was that I was somehow trying to relate the concepts with the syntax, which was totally foreign to me. How exactly the Car extends the Vehicle, and how does java fit in, was the question I was repeatedly and compellingly asking myself.
So the first problem which I faced while learning java was a desperate need to at least have a basic understanding of java syntax and code structure; the knowledge that java does not start with a #include, or that java code can be distributed through different files, that there are packages, or that java code is written inside a class(!!! Yeah, most of us didn't know even that), or that Class actually means something to the language, etc. It was almost like the package and class code was something by default that the code puts in. Days went by and I was still imagining how can java make a horse a 'type of' Animal, and how a Car 'has a' engine (I was quick in figuring out the grammatical exception there ).
From my experience, the approach that I would prefer as a trainer would be to first make the trainees write a java code to print out 'Hello World!'. This would at least give them a rough structure of java syntax. So that when I tell them that class Car implements the method drive( ), they understand that I am not talking about putting engineering flow charts into the method. This should be followed by the OO concepts and so on and so forth.
The most celebrated book among java newbies, the Head First Java, follows the same approach.

Sunday, September 21, 2008

The Day I went Shopping Alone…In US


It seemed a perfect day for outing. Sun shone brightly over the horizon and a cool breeze was making the Sunday more pleasant. So here I was, getting up early and planning my trip to one of the biggest malls in New Jersey, the Jersey gardens mall. It was also interesting because this would be the first time I go out alone, without friends, to an unknown place. So it was also a sort of adventure for me. I was excited about the possibilities.

I left home at quarter to 9 with my bag and some 20 odd dollars in change, because bus transit operators only accept the exact change, you don’t get the remaining back! So I checked my possessions and left for an exciting shopping experience. I had prepared a list what to buy and all.

I had to change two buses to reach my destination. I had to wait for long for my second bus at the 30th street, which was sort of annoying, but the thought of what was coming ahead kept me happy…Finally the bus arrived.

I sat beside an old lady who smiled a lot, like a devil does welcoming you to hell. And then she started talking…and talking…and talking. The worse thing was, she spoke Spanish! I told her I could not understand a word, and to add to the trauma, she didn’t understand English. I decided to show some respect and try to grasp what she said. Surprisingly I could understand some part from her expressions. She seemed pleased.

I disembarked the bus in a hurry and said ”Open Sesami” to a huge automatic door. I decided to satiate my hunger first. So I headed towards the food court to savor some vegetarian delicacies. I decided to have a veg burger with extra cheese, my tongue already feeling the taste. I looked around for an ATM to get some cash. Finding one, I took my wallet out in style. And then the disaster struck. 10 minutes later, I was sitting at a nearby table, still searching for my card and sporadically scratching my head. I concluded that I had lost my card. So I thought of blocking it, but my horse sense suggested me that I had forgotten it home. I decided to go with my intuition.

So the only possible action was to find the latest bus and head home. But my digestive juices were making noise. I looked at ppl having hot pizzas and bugers…I checked my wallet and found 10 dollars, 2 in quarters and 8 in 1s. Hmm, my journey home would need around 7.50. Well, I experienced what a penury feels every day of his life. I shaked off the thought.

I roamed around and found fried onion rings for 2 bucks. Well, something is better than nothing….Then I went to the bus stop, and to my disappointment, I had missed a bus, and the next bus was 3 hours later. I thought of going around the mall, do some bird watching and return in time. Suddenly I remembered that I had a cheque worth $1400. If I could find a place to encash it, I might be able to shop!! But some unknown force just didn’t want me to shop that day.

So here I was roaming around and looking at T-shirts, jeans, wallets etc. all mocking me. Big deal, I thought. Just when I was imagining myself in one of the T-shirts, I heard a non American accent calling me. I turned back to find a middle aged but charming Argentine lady throwing a 70mm a smile. She was a sales girl for a men’s facewash. She enquired my age, and as usual, said I looked much younger than my age suggested. I smiled, good, isn’t it? I divulged my funny secret expecting her to loose interest in me, but, well, instead she explained her business in more detail and gave her contact to me saying that next time I visit the mall, I should visit her. Hmm….We exchanged wishes and bid farewell.

One of the longest 3 hours of my life were about to end when I reached the bus stop at 1.45, the bus was scheduled at 2.10. I sat down on a bench. I was tired, hungry and sleepy. I closed my eyes and went into deep sleep for some time. When I regained consciousness there was a huge crowd around, all waiting for the bus and queued up!! I was one of the first ones to reach, and now was at the end of the queue!! ‘O boy, if I miss this bus, I will have to steal food and would end up in prison!! Well, I could have waited for the next bus which was 2 hours later, but I had no intention to do that. But no option, had to wait.

Miracles do happen! I saw that Spanish lady standing first in the queue and waving her hand to get my attention. I thought she is saying hi! But no, she was calling me. I happily accepted her invitation and prouldy occupied the first position in the queue. Boy, do I like Spaniards!!…I happily listened to the lady for my entire commute without understanding a word, but no issues…..

And finally I reached home. It was indeed an interesting day…

Saturday, September 20, 2008

My obsession with my laptop


I am obsessed with my laptop. After I wake up in the morning, I turn my laptop on and search for news. I don't brush first, but check my email, like I was a CEO who should be in touch on the move. Crap! I can surf all day long. Watch movies, videos, blog, read blogs etc...And believe me, it's useless. What a waste of time! I think I should reduce surfing. I can do so many other things. Like studying for CAT, shopping, going out, writing programs, reading novel etc..

Another interesting and idiotic habit I have developed is surfing with TV on. I don't watch it, but it should be on, don't know why. So here's the deal. I don't touch my laptop for one full day, holiday I mean. No checking emails, no chatting, no blogging(if it is necessary to write something, use pen and paper!), and no television!! If I am successful, I will treat myself with a Cold Stone Chocolate chip ice-cream. And if not!! Well, nothing...A big thumbs down!
Sounds interesting