Tuesday, June 11, 2013

Apps Teller

I have just now written another post on my blog, please check it here: Apps Teller . This is about our new website AppsTeller.com

Friday, February 1, 2013

Blog shifted at http://www.haafiz.me

This post is to just inform every one that I am going to start my blog from now at http://www.haafiz.me ,  existing articles will remain at kaasib.blogspot.com but new posts will be only posted on new site:  http://www.haafiz.me

thanks to every one who gave their time to read what I have written.

Tuesday, December 11, 2012

Coding Practices

In the name of ALLAH who is most beneficent and merciful 


Few days back , while we were working on CMS projects, I made a list of few practices that I think one need to adapt to have better code and work. May be I will add more items in following list and I think that one can do work in much better way, if take following guidelines in mind. So below are the items of my list.

  • Try to always safely remove extra code, there shouldn't be code unless there is reason
  • Try to adopt standardized approach as much as possible
  • Avoid setting criteria based on string formatting, it is confusing and sometime not as much easy to process, in terms of performance also, specially when case sensitive and not defined properly that can be very messy
  • In any software system, if filesystem and DB are being used side by side then they should either be kept seperate or need a proper way to sync them
  • try avoiding function call in condition in both control statement or loop
  • In comments tell what a function expect, what it return and what it set to other variables that are available in same request's scope
  • Naming convention everywhere whether it is table, keyword , field or variable or function , should be consistent to avoid confusions
  • In DB, whenever there is need of having only one of different option per record then in that case enum or association with another table can be better than having many boolean fields while only one field will get data
  •  A function should be only doing exactly one thing
  • Try to limit function to maximum 20 statements

  • Function should be understandable in almost 30 seconds

  • Whenever you are struggling at one problem and every thing seems fine but still problem is not fixed then may be you are struggling at either wrong solution/way or wrong problem, so need to think again

  • Avoid global variables and functions usage as much as possible, it can cause serious problems if user don't use it properly

  • If anything is changed during work , something on which other things depends, communicate about that if others team members are working around that, even it is one line of code
     
  • Even in good communication environment, there is not always time for communication, so follow standard coding practices defined as good practices or set by your team.
  • Classes and methods should have their useable data in passed arguments or there in their object, shouldn't be depend upon outside world
    I hope that using above guidelines can help you in doing your daily development work better. 
    thanks

Sunday, September 16, 2012

Installing django on ubuntu and updating to version 1.4

I know there is a way to install django on any OS is to just go to django site and download it from there but many programmers and/or linux users always want to have a command to install anything. If you have experience of installing ruby on linux then believe me installing django is much more piece of cake from terminal. To install django the simplest way in my opinion is to just type:

sudo apt-get install python-django

and Django is installed, however please note that in this way you will may be not get latest version. At the time of writing this post, the above command installs django version 1.3 while django version 1.4 is also present.  So if you want to install django version 1.4 then just copy paste the following commands one by one in your terminal.

wget "http://www.djangoproject.com/download/1.4/tarball/" -O Django-1.4.tar.gz 
tar xzvf Django-1.4.tar.gz 
cd Django-1.4 
sudo python setup.py install

However if you have django older version of django already installed then you need to first remove it via following command before installing newer version.

         sudo apt-get remove --purge python-django

To make sure that django is installed and to see what version you have open python by just typing python in terminal. And then type:
       
>>import django
          >> django.get_version()

And if there is django installed then there will not be any error and last line will show version number of django. I hope it is clearer, if not then please tell by commenting. And if there is some better way then please tell. If there is something more you want to know then please tell. Don't forget to subscribe and comment if you like the post.

Monday, February 27, 2012

Installing django on Windows

In the name of ALLAH who is most Beneficent and most Merciful

Salaam ,

   If you are web developer who have done lot of work in PHP, Joomla, CI and wordpress e.t.c. and you think that you can be a better web developer only by doing more and more work in PHP then think again. PHP have lot of good frameworks but there are lot of things that are used to determine a better framework. Also a single language dependent framework is not as good as developer who have tasted different frameworks. Then why not start a framework that is much better than many other frameworks present there. I am talking about Django and going to tell about installation of Django on windows while there is xampp already installed, as there are some people who find some difficulties in installing.
 
  So following are steps to follow.
1. Go on http://python.org/download/  and download python 2.x  not python 3 as Django right now at the time of writing this article, don't support Python 3. So download python 2.x  windows installer version and install it and restart your command prompt before next step if it is already running and more better to once restart system.
2. Go to Django website, download page: https://www.djangoproject.com/download/  and download latest official release. Currently it is Django 1.3 . Then extract it and navigate through that extracted folder using command prompt.
3. Type " setup.py install " and it will install django. To check if  it is install correctly, open your python console and type "import django" if it doesnot give any error then it means that django is successfully installed. But remember that normally MySQLDB module that is used by django don't come by default. So you will need to do some thing to connect django with mysql.
4. MySQLdb is just a connector for MySQL. When I tried installing it, it didn't find it easy to get and install MySQLdb. But thanks to pymysql another connector that can be used as an alternative of MySQLdb and there is no difference in using any of these. I found about pymysql from here:
http://web-eng-help.blogspot.com/2010/09/install-mysql-5-for-python-26-and.html
Please go to this site to know the way of installing pymysql in detail.

Please ask any question if you find any problem installing Django on windows. I will try to solve your problem.

thanks

Wednesday, August 31, 2011

Hiring decisions and HRM for Software Developers

           There was a time when hiring was thought to be so simple task unlike today. But actually it is really a simple thing. If you think in such simple way. When I was younger, I thought that a good guy can learn new things with his honest hard work while a person who is not honest with some thing , is not useful no matter how much he is intelligent. But with the increasing demand of variety of IT professional skills that a layman can't adopt in a day or two. So at the time when many people are looking for jobs, at the same time HR managers are also looking for human resources but it is difficult to find right person.  I am actually talking about IT industry.
     
          Due to above reasons, many of our HR managers and company owners have to take tough decisions. And I would like to mention that many of HR managers and company owners are not IT people. However it is important to note that there are still even after understanding all these things , we still faces many difficulties while finding and managing human resources specially when it comes to remotely managing your resources. Yes it is not all about just finding good people, it is also about managing them correctly. One of the problem is the fast job switching of good developers. But, good developers/employees are not only responsible for their fast job switching. There are many management's decisions that actually make their job switching happen. Due to some wrong attitude of some owners, most of employees don't trust their employers now. So overall, the work of HR managers specially in IT industry have become more tough.

         I was some time ago (not much time ago) managing remote developers, and then in some projects, I have to face really tough situation when developers were not doing their work properly. And at the end, I paid to developers for their incomplete work and due to delay in work delivery , it became also financially a bit bad time, however as I am also a developer so I quickly jumped into development of that work and solely did the rest of work to avoid losing a good client and worse situation. Overall that situation and some of solutions can be seen here: http://programmers.stackexchange.com/questions/97660/what-recommendations-can-you-give-in-managing-a-team-of-remote-software-engineers

         So the solution, I got from these replies is that every skill person who is good at work and office isn't essentially fit for remote work also because in that situation there is also a skill required that is "time management" and it is important as other skills are.

         So what about deciding if a candidate is a good match to be hired or not? If we will try to become over smart or greedy then obviously that will be bad for hiring decisions. No doubt, we all want people who can make our team better than before but at the same time never think that all other people should be best as you are, because there are many people who can perform well but can't be smarter than you. And it is because for judging this in interview, you are asking him the things that you know, may be there are also things that he know and you don't but unknown to you because you are interviewer not him.

     However as I once read from blog(s) of Joel and/or I think Jeff (both stackoverflow CEO and CTO respectively) , that you shouldn't hire the people that you say may be he is good for us. You should only hire people, about which you say yes, this is good fit for us. Because if miss some good person then may you don't go one step up but if you will hire some wrong person then most probably due to consumption of resources as well as most important thing, time of your important people can be wasted on that wrong person so in that case you can obviously go one or more step down.

     That was all about hiring decisions but if you are interested in interviewing techniques, then these some blog posts are interesting: http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html
However I would also like to add some thing that I learn after reading from Joel's blog post, is that during interview you should ask him questions in normal way like you assign tasks, because if developer can't understand things easily then it can be problematic to clarify things while doing actual job.

  So these are just some of my opinions about hiring decisions and HRM for software developers on the base of some of my knowledge and experience. I would also like to hear your words, so you can tell your opinions in comments to this article.

thanks for reading and giving your time.

Monday, August 29, 2011

Core technologies and technologies like FB. apps, FBML e.t.c.

In the name of ALLAH

Salaam and hi guys,
          When I first time worked on Facebook application development in FBML and FBJS environment, I really missed JQuery effects like show, hide, toggle and other JQuery plugins. But now I was glad to know that there is FBJS animation library which helped me a lot to work on Facebook with simple FBJS.  FBJS Animation library does not give some hide, show like functions but it gives me the way to do CSS tweening. I can manipulate it to anything that I can do with CSS tweening. If I was publishing this article some months back, I was going to write a small tutorial on it.  But after some months of learning that , it is ended. I mean now no FBJS is in demand. In fact, now FBML that was hot some time a ago is now depreciated.

    There were some people who spent much of there time on learning FBML, FBJS and such things but now those skills are not required. Even now in months or weeks or may be in days, FB APIs are changing , many things are depreciating fast and many of functions don't work as they are expected to. If a developer start developing an app., he came to know that one API and working way was old so he started with new SDK e.t.c.  and with new methods. So if after a month or two, he again start another app. then while using that new SDK he came to know that , it is now old SDK and some of methods he is using are now depreciating and now for finding new methods he have to again search the whole documentation and while doing this many time  when he tried to find way to do some thing in one page of documentation, he came to another page and learn that this is again depreciated or older SDKs method while he is using newer. So a developer is so confuse in whole this badly documented APIs and SDKs of Facebook. :( .

    Overall , the agencies who work on FB. apps., some time can have a good market because it is ever changing and a sort of unique skills that not every agencies can have as it is changing so fast. But I want to raise a point here, Is this good and favorable for developers also? There were many of developers who worked for a long time on FBML and FBJS and faced the above problems. And just imagine wasn't it a bad news for them that "FBML and FBJS skills are now not in demand any more. Now iframe based apps. are required".  So should developers still work on such technologies and should rely on them? I think learning and working on such technologies are always fine but one shouldn't rely on these skills and shouldn't take it as a technology on which (s)he can rely, as these things are changing in weeks and months.

  There is also a group of people who think that nothing in IT is evergreen , even full fledged technologies  and programming languages are not permanent. Every things is being replaced. One should only know how to learn. I think learning skills are more important but if you will learn more about Core Concepts and Core Technologies then you can even learn more better.
         If you know how to write a server or client without using any  high level lib. then it will make one's concept better and after once doing that he will be able to write server in any language better and will be able to use any lib. If one can develop a CMS in simple PHP then he will be better able to understand other's CMS and other's written Frameworks also with better understanding.
         So that's why I prefer to start young developers with Core level things some times (depends upon situation and developers), as it is also good for them. There are many web developers who start working from Joomla or WP or FB. apps. or some sort of design intergration but I recommend them to also look into Core things that how these things work, because in fact (after ALLAH Almighty's will and problem solving skills e.t.c.) these will make your foundations strong. High level things like FB apps.,  WP, Drupal  and Joomla e.t.c. can increase your chance to once get a better job for you but not job safety that you can have if your foundations are strong. Strong foundations increase the chance that whether you start from a small job but you will most probably go up.

  Above is how I think , I want to know that how you guys think, so please comment.

thanks,
Hafiz