Saturday, August 13, 2011

Lessons i learnt playing Angry Birds



So i finally saved up and bought my first smart phone a few weeks back(A samsung galaxy s i9000 to be specific). I heard about the game Angry Birds even before i had a smart phone but never got a chance to play it. The hype about it was very true. The game is addictive :D. Anyhow my objective of this article is not to disseminate news how awesome Angry Birds is, which is quite obvious with the plethora of download rates it is getting, but to write about a few things that crossed my mind whilst playing it.

  • Plan before execute
       When you first start off a chapter, you are shown a glimpse of what obstacles lie ahead. You can then scroll back and forth looking at where the stinky(ok im exaggerating a bit here, but im on the bird's side after all) pigs are situated and how they are protected by the obstacles. So you plan the attack beforehand and launch it. 
          As a developer this is a very interesting point. Sometimes i rush into writing a piece of code. But if i had looked at a few possible obstacles, other possible solutions, i believe most of the time i could have come up with a much better design. 

  • Efficiency in resource utilization
           In some instances you get birds with different abilities. Some blow up, speed through, drop bombs, replicate etc. Each has their strengths and weaknesses. Before we launch an attack we see how best to use them and at which point.
           As a developer, i should know my strengths and weaknesses and apply them accordingly when given a particular task, and look at what i lack and gain knowledge in areas where i lack in order to fill the gap.
          As a project manager you should know the skills of your resources and utilize them to the tasks at hand efficiently in order to achieve the end goal of delivering a stable product to the customer. Not everyone is good at everything, so identifying your resource pool enables you to make better decisions and improve and refine your resources' knowledge base as you go on.

  • How to handle the task with minimum effort
           When you blow up all the pigs around with a few birds left up you get bonus points.
           As a developer, when given a task i must strive to see ways in which i could achieve it with minimum effort. This does not mean your a lazy bum, but that you opt to work smarter than harder. You can thereby save up time to do other things like gain knowledge on other new technologies, contribute to some open source project you love etc. In the birds example, you are left with a few birds because you used your targets efficiently. In the same way, if you apply the solution you devised in the correct manner, you will be left with some time to spare(this might depend on your supervisor ofcourse :)  )

  • Go ahead with what works for you
           In any level, you have multiple ways of approaching the obstacles. You may try a few options, but in the end you have to go with what works for you in order to send those pigs flying(again exaggeration).
           As a developer, when designing a particular module/project, there always are many ways in which that can be achieved. But in the end you have to decide on what will work for you and go ahead with it. When presented with many solutions you have to decide on what will work for you and stick to the plan to achieve the end goal. Again as the birds example sometimes the one you chose might not work, so you refine your solution and come up with a successful one in the end.

  • Perseverance

        When you embark on a mission, sometimes you cannot complete it in one shot. You need to keep on trying and eventually you will get there and make the pigs pay.
           As a developer sometimes i might not be able to come up with a viable solution for the problem at hand. But you should not be discouraged and give up. Breaking the problem into smaller understandable components might let you see things in a new perspective. So keep on trying and eventually you will get there.  

Thats it for now guys. Ofcourse im still on level 2-17 at the time of writing this post, so i might learn a few more things as i go on :)... 

Thank you for reading and please do leave by your thoughts if you have the time. Have a great day guys!!! 

   

Saturday, August 6, 2011

What i love about PHP



 First of all i must say im relatively new to the whole PHP scene. Coming from an OOP background with mostly Java/C++ experience i must say the transition was not rough as i expected it to be. Unfortunately i have not been able to code in PHP at an industrial level but use it for many of my freelance projects which has been very productive up to now. So i would love to highlight why i love PHP and why i think others who aren't using it yet, should give it a try.

  • WAMP
                WAMP is one of the best bundled package i have seen. Right out of the box you got yourself an Apache server, mysql database and PHP core. So within a matter of minutes you are ready to write some productive code without having to deal with environment setup issues. And you have a wide variety of bundled packages to chose from which fits you needs. Need a mysql client to go through the database? No need of installing another sql client. Just type http://localhost/phpmyadmin/ and your ready to create your database schemas.

  • Its Interpreted
               All java folks know how much of a pain it is to compile your project if you are working on a large scale application. You just do a small change and stare at your command line as Maven or Ant destroys 2-5 minutes on average of your precious time. Im not emphasizing on build related problems here but the truth of the fact is there is no matter what, you do waste a portion of your time compiling code. Whats great about PHP is the fact that it is interpreted.  You just do a change, go to your browser and refresh. Thats it. Saved me a ton of time in many of my freelance projects.

              Ofcourse there are PHP compilers if anyone ever needs it. Some say it increases the performance but i have personally not been able to try it. Facebook has written a nice tool that converts PHP code to C code called HipHop.

             The information presented in this site is just out of this world. Anything and everything you will ever need when working with PHP is here so there is no hassle what so ever. When i need a function i just search it up here and the community has been very active with various people suggesting better ways of calling various functions which has been very helpful to me.

  • No need of a special IDE
             Myself and many i know just use Notepad++ for our coding with PHP.  Its just easy to use and switch between different source files. I dont think anyone ever needs an IDE when coding in PHP though there are some very useful IDEs out there as listed here.

            From PHP 5 they supported classes, object creation, constructors and the whole deal. This feature made it very easy for me in the transition phase from java to php. It was more or less a seamless transition.

  • Plethora of frameworks to choose 
           You got Zend, cake php, symphony and so many more frameworks. Its just amazing. If one does not fit your need you just move to the next one and try it out. The learning curve is also not that steep as well. The MVC architecture introduced by these frameworks make you feel at home when coming from a struts background as myself. And the DAO layer separation introduced in some frameworks is also a huge plus point for me.

Im just starting out with PHP and i believe more will be added to this list as time goes on. If any PHP pros can share their opinion on why you love the language it is highly appreciated.

Cheers Guys!!!!