Saturday, September 29, 2012

First Step to Learning Programming...

I had a terrible start. Around 17 years back I decided I will be a computer programmer. My first serious encounter with programming was "C". I was from ICSE board, and they had BASIC not even C as part of their academic. We had DOS those days, and had to remember the commands. Loosely talking there were BIOS calls to be made after setting various bits in the CPU registers to get things to work. There were no background process other than TSR programs. Achieving graphic result was accompanied with tons of secret codes, even some ASM.



We didn't have Internet. Damn, there were no mouse! It needed to be typed, there were very few books detailing the secret weapons. We were hearing from distance horizon of something called Java cooking up. We read, it runs inside a box and no system calls can be made. It wouldn't have been used either for serious UI based application nor for writing any background service. I don't worry what Java 6 or 10 has now, but that's how it was in 1996.

Things are changed now. Instead of calling interrupts, we call the APIs or damn me we call the "Framework"'s function. Things are encapsulated at such a detail that your compiler will even help you run your code in 32 or 64 bits computer with almost no effects.

So whats the point? When you drop Internet, when you drop your Superior High Level Language, and when you seat naked with your command line based compiler, then it makes you do one thing that you absolutely and essentially need to be a programmer. That is, Think!

Sunday, September 9, 2012

Where you work matters!

Private software companies have made quite a bad reputation. Once a government subsidiary bank manager visited me and during talk he said right of course you wouldn't have been placed that's why you're seating here. One of the employee's (who run away lately) mother came to visit me, and reasoned that there would be better prospect of finding a good girl if her boy was working in a public company.

In the Jungle of elancing, software companies main theme is do as many projects as possible with the lowest possible paid workers. Paid by Quantity not Quality. Before you start damning your employer, it is your equal fault to be working there. Nobody has fastened you to your seat but your paycheck, if you are working at a place which is no better than a sweet shop, it is time to break free.



Jerry McGuire woke up in the middle of the night and started writing a mission statement for his company, he copied it and passed it on to all his staffs at work. It said, `Fewer clients, less money.` A week later he was fired, because the mantra of success of service industry is `More clients, more money.` McGuire was not the founder of the company, he was an employee. But is it a curse for an employee to write the mission statement of its company if you were already giving your sweat and blood to it?

Software companies need to advocate a place of openness where free flow of idea can take place. It should not just be the products getting focus, but the process as well. The vision of the company need to be induced in each employee of the company. Attend the clients that bring value to the company. Do the projects which sharpen your portfolio, bring quality process and stick to good code design. Use private networking to increase openness. Focus on getting it done to getting it done right.

As an employee, rebel to the conspiracy. Bring change to the process. Go agile, use source code control, make UMLs and build user friendly scalable and maintainable software. Stand up to the politics, and don't be afraid to pass above your immediate supervisor if you wish to bring a good change. And above all be the change you wish to see in others.

Of course, if you wake up to write mission statement for Retina, promise you wont be fired for it.

Friday, July 6, 2012

5 Tips for Software Developers

Here is the sad realization I had last Friday, after I clicked on XCode -> Cocoa Applications for Mac. I have never written any Mac application. XCode created an AppDelegate and I started missing the ViewControllers. I created Document-based application and it created two interface builder files. Where do I set the actions of the MainMenu to? And how to create different Windows for Document based applications! Finally the safe browser for Mac is ready with full screen kiosk mode and is better than most other such browsers they got.

So here is some tips for software developers:

1. Be Resourceful:

Research and Development goes hand in hand, and for a reason. The layman definition of programming is a sequence of instructions given to computer to perform a task. We cannot do nothing which isn't in the API or the Framework we are using.

And guess what, most part of the APIs are documented. All you have to do is open msdn.com or developer.apple.com, etc and voila there you have almost everything you need. The next step is only putting every pieces together, knowing where to take the pieces is winning major part of the battle. For app development, you are as good programmer as good is your availability to Google.




2. Maintain a To Do:

A simple to do list maintained on a notepad or google tasks, is one of the best productive and motivational tool one can have. Divide your project into several smaller tasks, and put them in a to do. Tick them off as its complete and sense the feeling of achievement there only.

3. Use Source Code Control:

Just how many things can go wrong in writing code, occasionally even a hard bug is going to make you want to redo your whole class. Given the power to revert back to days or weeks back and making a fresh start, or to compare why it worked on xx/yy date and not aa/bb date is an advantage.

When using SVN, utilize branch and tags to keep versions of your working program, update before commit. Commit as many times as possible and put detailed comments with each commit.

4. Design Your Project Before Coding:


Unless you are working in Dilbert's office, planning your software architecture and UI wireframe is very critical before writing any code. If you are working on small projects on single you can just design stuffs on white paper and if you are on a team being formal is even more important. The seniors can simply make the wireframes and UMLs and pass it on to the developers to move on with the project.

5. Do Good the First Time:

When you compile programs it will give you warning and it will give you errors. Guess what, you cannot ignore the warnings. Just because your compiler was able to link your program doesn't mean you are good to go, compiler is only trying its best to do its job. What your program does is your job. Logical and performance issues are mostly likely hidden inside the warnings you get, and if you keep on ignoring them the numbers is going to keep on adding.

Understand your platform, know your language and mind the requirements before diving in to coding. I spent around 20 hours on iPad studying the Frameworks and around 6-7 hours on XCode max to get the SmyleSafe done. It would have been easily 60-70days if I tried to reverse and do coding before planning.


Thursday, May 31, 2012

Wrong recruitment is murder.

I've been a programmer for as long as I can remember. From TC++ to Obj-C, from AceSpy to Tank-O-Mania, this is what I crave to do. It might not be an adventurous job for many yet the different kind have their fun in it. But very few in their childhood will reply and say gosh, I wanna be a coder and write codes all my life. They would rather say I would be a pilot or a doctor and save some lives, but heck no, what does these Dennis Ritchie do?

Sadly when we decided to turn a home/hostel business to a corporate, we needed more programmers. Like money, programmers do not grow on trees. Nor does they are sold in big bazaar. No, the guy who is calling your HR twice a day to propose his next "Employment Agency" has no clue about it.

Finding good programmer is a nightmare, hiring bad programmer is a suicide.

The blogs and articles we read on Joel on Software have little effect in India. America and India is different. No? Try calling your boss with his name. However I like the ideas proposed by Joel in his book: Smart and Get Things Done.

So here are my points when hiring software programmers:

1. Are they a programmer by choice or interest?

Here, we chose a degree before what we want to do in life. Given the population and unemployment its no fault of the generation. Not going to change, so well adapt. If not early enough are there signs of interest in technology right from the beginning? Has he being doing the college projects and internship for, well, the letter or was that seriously done?

2. Experience


Experience is the best disguise to wear. The veil the anti-performers wear to trade on their year wise growth to performance growth. For bigger MNC, funded by public or big investors keeping "x" number of employees is a target to meet to show to their investors. Given the low salary in India, its no problem with them to satisfy this number, on the neck of the students hired. Hence, experience of a candidate only depends on the "kind of" projects he has been doing and contribution in the team.

3. Resume is False, no exceptions.

We have arranged marriage in our subcontinents, the matrimonial services takes the "bio-data" of boys and girls to share with each other family. The family then filter on this "bio-data" to schedule the family visit to the "boy/girl lookout" trip. Will there be surprise if the girl turn out to be a 5 foot instead of 5.4? or if the boy is bald? Will you arrange a marriage on the bio data and telephonic conversation?


4. Emotional

While interviewing the candidates, dive deep in the way he has done his project. Especially the contributions, the logic, the code design, the tools and how he got it done. The false candidates will stick to "what the project is" no matter how much you will stretch. The good one will get emotional and go on talking, drawing diagrams with their fingers or trying to actually show you his work online. Only programmers should interview other programmers, so that they just can give the candidate the support of being a good listener and understanding that what he is saying is not words in any order but meaningful.

5. Write Code

A computer based test will help in judging a good programmer, give him the tools, the internet and the tools and ask him to make a small project. (Use Net Spy Pro to ensure he's not cheating). Why do we have written exams at every semester end and not before switching a job?

Hiring a bad programmer is a suicide for a software company. Make mistakes in not recruiting the right person, but don't recruit the wrong person.

Monday, February 27, 2012

What "should" motivate you!

When you cross 25, you realize life is cruel. All the hopes and dreams you have had in your young life is shattered in the harsh reality of organizational policies, politics and a bald boss. You snooze your alarm clocks several times before awaking from your bed, and dread reaching your office. You hate to see if your boss has reached earlier, and it could be a day of those nasty yelling. The day passes in sorting out who is in your side, and what the back-stabbers are planning as their next move. And the team meeting discussion hot topic is how to convey the project delay to the client. The joy comes when clock ticks 5, and like a prisoner out of prison, you run out satisfied at least one day is over. Life is cruel! But what is it that gets you going?

Now of course, the low salary doesn't give enough space for multiple bottles of Red Bulls and the office milk-powder coffee is hateful. But still something helps you maintain your senses. Lets first see what is it that keeps you motivated:

Money: If I don't work, wait, if I don't punch the attendance and seat in office I won't get paid. Money is the primary motivations, no matter how much people say it isn't, it is. Realize it sooner and lead a truthful life.

Recognition: Awards and promotions has always been the not-so-secret weapon of your managers to achieve the "Carrot Motivation" in its staff. Surprisingly it has been working on humans for so long.



Fear: How fast can you run? 6-8KM/H? Imaging a blood sucking wolf running after you, now, how fast can you run? 10-12Km/h, or at least faster than the wolf. Replace running with working, and wolf with ... (do I need to say?), and their you have the fear motivation. Fear of losing your job, security, feeling of employment, social status, money, it all drives to continue achieving the target so blindly set by your managers.

Again, I can go on... but I will keep these as the top three motivators, if you have any different feel free to comment and correct me.

So the point of the blog is, what instead should be your motivator.

Love: Why exactly did you do everything you have done so far? Why did you go to that college? Why you took that course? Why did you join this company? If it has been for any of the three reasons above, it is time to take out a rubber and erase your canvas so you can correct it. If, however you are here because you really hoped that what career you're choosing will give you work satisfaction, a feeling that you're doing what you're suppose to do, a feeling that you enjoy what you are doing, then everything else doesn't matter. If only you love your work, you can love your life, and spread some of it to others.

Achievement: Is performing your task an achievement? Did it required more efforts, ability, push to accomplish it? Your work-life can be divided into several achievements, every next task that you do requires more talent, skill, ability, and effort to accomplish it - and that becomes your achievement. Like clearing a stage in a game, and going to next. Upgrading yourself with newer versions of your own knowledge is very essential and it will give you passion to conduct yourself to superior work quality.



Fun: "If you think daily that this might be the last day of your life, one day certainly it would be true." So the place and the job your doing for 60% of your waking hours should certainly be enjoyable to do. Try to seek fun in the work you're doing, enjoy your work.

If this three is your key motivator, you sure will have a great and long life, save early wrinkles and high blood pressure. Is money, recognition and fear are more important than your health and happiness?

Friday, January 27, 2012

Making Tank-O-Mania : iPhone Tank Game

Update: the game is online, find more about it at www.iPhoneTankGame.com

I learned a little about game programming in 1998, before I started to work on Windows. We use to do most of our job in Borland-C++ and use the DOS int86 calls. I happen to buy the book Action Arcade Adventure Set, written by Diana Gruber. In 100s of tech books I have read so far (including academics), this one is the only I have read cover to cover. The book was excellent. But it covered C, and VGA 256 colors 320x240 mode-x, with about 128"KB" of available memory.

I usually say to people, learn the concept not the language. The book manage to throw a lot of light on Tile-based side scrolling, sprites, game engine and a lot more.

Fast forward to now, while the majority of games are being done for PC, or consoles with all the awesome 3D and no controller (kinect) engines, a new chapter is introduced with launch of Smartphones. It is like the bell-bottom era making a come back. The sizes of 320x240, less memory and casual gamers concept is being back. The era of 2D is reintroduced.

iPhone Tank Game
I was in Delhi and thinking of the statements of Bill Gates, something like taking books on vacations. I opened flipkart.com and ordered some books, out of which one was on Cocos2D. And while doing some net readings, I came across tank graphics from Vicki Wenderlich. All those who have grown up in 80s and early 90s must have played Mario, Contra in arcade stores. There was one called Tank90, and it was cool. One look at the Tanks and I wanted to do that.

And hence the coding for Tank-O-Mania, iPhone Tank Game started on 26 Oct, 2011, the day of Diwali.

At first it made of all tiles and tanks graphics from Vicki, but later our in-house designer did some tremendous work and the sprites took form. I contacted another excellent designer to do the level-art and managed sounds from stock sounds. And hence I dumped that version, and recreated everything from scratch.

The best part was programming, programming the game was awesome and I am already missing writing codes for it. It is like the availability to create own world, where we set the rules. And thanks for Ra-One release in between to keep me just as pumped.

The game has:


- 30+ types of Enemies with Unique A.I.
- 24 Levels of Play within 6 Countries
- 5 different Weapons including Mines, Grenades and Rockets
- Call Friendly Helicopter for Air Strike
- 5 Power Ups including Invisible Mode, Freeze Enemy, Extra Lives and more
- Classic Arcade Joystick as well as Accelerometer based control
- Strategical Level Designs
- Game Center support, Compete with the World for High Score
- Dazzling Graphics of World Powers and Realistic Cities
- Thundering Battleground Music and Sounds Effects

And here's some screenshots:

iPhone Tank Game

iPhone Tank Game
Tank-O-Mania, iPhone Tank Game, is Waiting Review from Apple. Till then

- Follow us on Twitter @TankOMania http://www.twitter.com/tankomania
- Like Tank-O-Mania on Facebook: http://facebook.com/tankomania
- Subscribe for Videos Preview: http://youtube.com/tankomania