Friday, September 26, 2014

How to Increase Website Traffic for Free

Many people spend a great amount of money trying to launch their website through strong advertising campaigns; however, a lack of funds shouldn't be a setback as there are many ways to get traffic without spending a dime.

 1
Optimize your website to be search-engine friendly. Submit it to various search engines and directories. In addition to major search engines such as Google, Yahoo, Ask, Bing and MSN, it's worth submitting to lesser known web directories. If your website is listed in as many places as possible, it can boost your rankings in major search engines as well. 


2
Make sure your title, description head, and header html tags accurately convey the subject of your site; search engine algorithms use these as keywords to categorize your site and direct relevant traffic.


3
Spread the word about your affiliate program by submitting it to affiliate program directories and contacting the owners of related websites.


4
Create a links page that will contain the links to other non-competing websites in the same industry. Contact the owners of other websites with your proposal to exchange links. You will add their link to your links page, and they will link to your website in return. 



5
Post in forums. Visit the online discussion forums where people in your target market like to gather. Post useful responses to people's questions, and include a link to your website at the end of your post next to your name. Although you ultimately want to get your sig file with the link to your site seen as often as possible, don't overdo it with your posts, otherwise other forumites won't respect you, and therefore won't visit your site. 


6
Comment on blogs. Visit other people's blogs on the topic related to your website. Most blogs allow you to add comments about the issues being discussed. Add insightful comments about the blog topics, and leave your website link. Your comment and your link will permanently remain on the blog website. 


7
Create an e-mail "signature" - your name, your website address and a short tag-line describing the main benefit of your site. Set your e-mail program to automatically add your signature to every e-mail that you send. 


8
Look into traffic exchanges. There are many types of traffic exchanges but the idea is the same - you team up with other webmasters, and they send you traffic in exchange for you sending them traffic. Search the web for "traffic exchange" to find those services. 


9
Create something of value that people will pass around. It can be a report with useful information that you allow people to give away. It can also be some kind of cool and unusual web-page that people will want to e-mail to all their friends. Of course, the pass-around item will include your advertisement and your link, spreading the word about your website. This is a "viral" strategy. 


10
Write articles on the topic related to your website, and include a link to your site in your author bio. Submit your articles to article directories, and allow people to publish your article in their newsletters and websites. Your articles will spread around the web like wildfire. People will read them and visit your website. The best part is that people who read your articles will regard you as an expert, and they will be much more likely to buy from you when they go to your website. How's that for a free publicity? 


11
Use accurate keywords for your content. The point of keywords is that they are the terms most people looking for your article by topic will search by. Check those with free Google terms and use the most popular relevant one in your title - a descriptive title to let them know right away what it is if it's a word with multiple meanings. Drawing blood for a phlebotomist is not the same thing as a comics artist drawing blood in a fight scene. Be very literal and then use the exact keywords several times in the article where they are relevant, as well as synonyms. Don't overdo it, or you look like you're trying to spam Google. Just use the keywords naturally when describing the topic.
  • If it is a confusing keyword phrase like Drawing Blood, link to the other meaning and mention that in the first paragraph. "This article is about drawing blood in graphic novels. Phlebotomy is drawing blood for medical tests or donations - here's the other page on "Drawing Blood." Then link to the phlebotomy page in that. By redirecting confused people you leave them a good impression and they might stop to read your article if they also like doing comics art!
12
Start an e-zine for your web site. When people read each issue they'll be reminded to revisit your web site. Submit it to all the free e-zine directories on the internet.A news letter! 


13
Start your own online discussion community. It could be an online message board, e-mail discussion list or chat room. When people get involved in your community, they will regularly return to communicate with others. 



14
Advertise your site at free classified ad sites. There are many of these on the net. Some of the more popular ones are craigslist, inetgiant, freeadvertisingforum, and gumtree. 


15
Join free safe-lists. These are lists of subscribers who have opted-in to send and receive emails to each other. You can instantly reach potentially thousands of people by sending out emails, and you don't have to worry about receiving spam complaints either because everyone on the list has opted-in to receive emails. 

16
Getting a myspace page could also increase your site traffic because hundreds of people will see it.


17
Constantly update content on your web-page, so having a news section is a great deal for search engines especially.


18
Update your Facebook status to let your friends know everytime you update your blog and create a Facebook fan page. Your friend's friends will see when they join the fan page or comment on your status. 


19
Submit your website to top social bookmarking sites to create a back link to your website, which will increase you page rank as well.


20
Sign up to yahoo answers and leave great helpful comments to questions people are asking for, leaving a link back to your site with more helpful tips on it.


21
Stay on topic. All this socializing, forum commenting and question answering ought to be on your website's main topic. The more your activity and site content match in topic, the more likely the right people find it. The more targeted your affiliate links are to the topic, the better you'll do with them too. People don't mind advertising that's on topic, it starts to look like a convenience directory rather than irritating commercials.















Thursday, September 25, 2014

IT Dress Code: 10 Cardinal Sins

 
 
 
You don't need to be a runway model to succeed in IT, but please stop making these office fashion faux pas. Remember, you work for an enterprise, not on the Enterprise.

Sandals with socks
Sandals and socks are each fine innovations in foot comfort that should never, ever been worn simultaneously. Stop it. Now. Yeah, we hear your gripes and rebuttals about comfort, yadda-yadda. What you do with your sandals and socks at home is your business; just don't strut through the halls of an actual business in them.

Sandals without socks
Some folks can pull off open-toed footwear at work. You're probably not one of them. And even if you spend your weekends in a pedicurist's chair, there's a big difference between an open-toed pair of Manolo Blahniks and a pair of flip-flops. Feet are for beaches and podiatrists, not conference rooms and daily scrum meetings. Save the Birkenstocks for your camping trip in Big Sur next weekend.

Hipster hats
Writer and satirist P.J. O'Rourke said it best: "A hat should be taken off when you greet a lady and left off for the rest of your life. Nothing looks more stupid than a hat." Ladies and gentlemen alike, we beseech you: Doff the hat before entering the office. It may look great when you're at a coffeehouse or out for drinks after work. Not so much while managing software updates or provisioning virtual machines.

Jorts
Hey, great: You work in a cool, casual office where you're encouraged to be yourself, where shirt-collars and full-length pants are seen as "legacy" attire that inhibits creativity and innovation. That's super. You still can't wear jorts, whether hand-made or the off-the-rack variety (pictured). Jeans are a great fit for a casual workplace. Shorts could be, too, if it's truly that casual. Jorts are a great fit for a trash can.

Sleepwear
Those flannel pajama pants look sooooo comfortable! They also look soooooo ridiculous when you're sitting at your desk in your place of gainful employment. Sure, the boss has been asking you to put in some long nights, but she wasn't inviting you to a slumber party. Here's a career-safety rule of thumb: Never wear to work anything that you would also wear to bed.

Star Trek attire
Hey, we love Star Trek as much as the next person. And if a portion of your closet is devoted to wearing your fandom out and about, then more power to you. Just remember that you work for an enterprise, not on the Enterprise. Dressing like a crew member would be illogical.

Cycling gear
Do you bike to work to save on commuting costs, reduce your carbon footprint, and improve your health? All wonderful things. Now please change immediately before any of your coworkers see you in your cycling outfit. It fits you, um, extremely well.

Workout attire
Make no mistake: Exercise is a wonderful thing. It will make you feel better. But like our cyclist colleagues, the clothes we exercise in should not double as the clothes we work in. There's too much Lycra (codename for Spandex) and other "stretch" fabrics. There are too few sleeves. If you feel the need to wear wicking material while monitoring the network or rebooting a server, something's amiss. Ditto yoga gear, track pants, and other fashions of the (occasionally) fit. You're in an office, not a CrossFit gym. Dress accordingly.

Sasquatch beards
There's a certain je ne sais quoi about the masculine beard. You're smart yet rugged, able to handle Hadoop clusters during the week and a chainsaw on the weekend with equal aplomb. But at some point, smart-and-rugged turned into Sasquatch. It's not a beard, it's an ecosystem. You're sending the wrong message. Are you an IT wizard or an actual wizard? Nobody's seen your neck in months. Maybe set aside a small slice of that paycheck and invest in a trimmer, Gandalf.

Nothing
The odds of you actually showing up to work in your birthday suit are, we hope, very long. But sometimes people show a little too much skin, intentionally or not, in the office. Too few buttons (men and women alike, mind you), unzipped zippers, see-through fabrics, too-shorts -- no matter the offending attire, just do a mirror check once in a while, would ya?

Wednesday, September 24, 2014

OOPS का प्रयोग करते हुए किसी Problem को Solve करने से सम्‍बंधित Basic Concepts

OOPS Basic Concepts with Examples: हम Computer पर जो भी Program बनाते हैं वो Program किसी ना किसी Real Life Problem को Solve करने के लिए बनाते हैं और हर Real World Problem में Real World Objects होते हैं। इस स्थिति में OOPS एक ऐसा Concept है जिसके आधार पर हम विभिन्न प्रकार की Real Life से Related Problems को Solve करने के लिए हमारी समस्या से सम्बंधित विभिन्न Real World के Physical Objects को Computer में Logically Represent कर सकते हैं और उस Real Life से सम्बंधित समस्या को Computer में Logically भी उसी तरह से Solve कर सकते हैं, जिस तरह से उस समस्या को Real World में Physically Solve करते हैं।
किसी Problem को Solve करने का वह System या तरीका जिसके आधार पर किसी Real World Problem को Solve करने के लिए उस Real World Problem से सम्बंधित Physical Objects को Computer में Logically Represent करके Problem को Computer द्वारा Solve किया जा सके, Object Oriented Programming System (OOPS) कहलाता है और जिस Computer Programming Language में OOPS के Concepts को ठीक तरह से Implement किया जा सकता है, उस Programming Language को Object Oriented Programming Language (OOPL) कहा जाता है।
जावा एक ऐसी ही Object Oriented Programming Language है, जिसमें किसी Real World समस्या से सम्बंधित विभिन्न Real World Physical Objects को Computer में Logically Represent करके समस्या को उसी प्रकार से Logically Solve किया जा सकता है, जिस तरह से उस समस्या को Real World में Physically Solve किया जाता है।

Problem – The Definition

दुनियां के हर काम को सम्पन्न करने के लिए हमें एक विशेष क्रम का पालन करना पडता है और जब हम किसी काम को ठीक तरीके से कर लेते हैं, तो परिणाम स्वरूप हमें कुछ ना कुछ उचित Output प्राप्त होता है। ठीक इसी तरीके से Computer से भी किसी काम को करवाने के लिए हमें उससे एक विशेष क्रम का पालन करवाना पडता है और जब Computer हमारे बताए गए किसी क्रम के अनुसार काम कर लेता है, तो हमें कुछ ना कुछ उचित परिणाम भी प्राप्त होता है।
जिस किसी भी काम को करने के लिए हमें किसी विशेष क्रम का पालन करना पडता है, उस काम को हम एक Problem कह सकते हैं। इस स्थिति में हर काम एक प्रकार की समस्या होती है क्योंकि दुनियां के किसी भी छोटे से छोटे काम को सम्पन्न करने के लिए भी हमें किसी ना किसी क्रम का पालन तो करना ही पडता है। एक उदाहरण से समझें तो यदि हमें पानी पीना हो तो भी हमें एक निश्चित क्रम का पालन करना पडता है। पानी पीने के लिए भी हमें:
  • सबसे पहले गिलास लेना पडेगा।               [ Variable Declaration ]
  • गिलास में पानी लेना पडेगा।                     [ Input    ]
  • फिर उस पानी को मुंह तक लाना पडेगा      [ Process ]
  • पानी मुंह में जाएगा और तृप्ति का अहसास होगा।   [ Output ]
यानी पानी पीने के लिए भी हमें एक निश्चित क्रम का पालन करना पड रहा है, इसलिए पानी पीने को भी हम एक प्रकार की समस्या के रूप में देख सकते हैं।
मूल रूप से देखा जाए तो Computer के लिए किसी भी प्रकार का मान या मानों का समूह Data कहलाता है। Computer में हम किसी भी मान को मुख्‍यतः तीन प्रकार से Specify कर सकते हैं।

Integer

जब हमें Computer में किसी ऐसे मान को Store करना होता है, जिसमें केवल पूर्ण संख्‍याएं ही होती हैं, तब उस Value को Integer प्रकार की Value कहा जाता है।

Float

जब हमें Computer में किसी ऐसे मान को Store करना होता है जिसमें दसमलव वाली संख्‍या होती है, तब उस Value को Float प्रकार की Value कहा जाता है।

Character

जब हमें Computer में केवल Characters Store करने होते हैं, तब इस प्रकार के मान को Character प्रकार का मान कहते हैं।

Object – The Definition

दुनियां की हर उस चीज को Object कह सकते हैं, जिसे Physically देखा जा सके या Logically किसी दिखाई देने वाली चीज के Reference में महसूस किया जा सके। जैसाकि हमने कहा कि Object को देखा जा सकता है, इसका मतलब ये हुआ कि हर वह चीज जिसका कोई रंग, रूप व आकार हो वह Object है। जैसे कि Keyboard, Employee, Client आदि। इसी प्रकार से हर वह चीज जिसे किसी दिखाई देने वाली चीज के Reference में महसूस किया जा सके, Object है। जैसे Bank Account.
हर Object की कुछ विशेषताएं होती हैं, जिसकी वजह से कोई एक Object किसी दूसरे Object से अलग पहचाना जाता है। किसी भी Object की इन विशेषताओं को हम उस Object के Attributes या उस Object की Properties कहते हैं। किसी Object के Attribute के मान में परिवर्तन करने पर वह Object बदल जाता है।
उदाहरण के लिए किसी Account Object की एक Property, उसका Account Number हो सकता है। अब यदि किसी Account के Account Number Property का मान Change किया जाए, तो वह Account किसी दूसरे Account Object को Refer करने लगता है। यानी Object के Attribute के मान में यदि परिवर्तन कर दिया जाए तो Object बदल जाता है।
जिस तरह से हर Object Uniquely Identify होने के लिए अपने कुछ Unique Attributes का प्रयोग करता है, उसी तरह से हर Object किसी ना किसी तरीके से कोई ना कोई काम करता है। Object के इस काम करने की प्रवृति को Object का Behavior कहते हैं।

Objects – Based on Problem

वास्तविक जीवन (Real World) में हम किसी भी समस्या को जिस प्रकार से देखते हैं, उसी प्रकार से हम उस समस्या को Computer में भी Represent कर सकते हैं। समस्या को Computer में Logically तभी Represent किया जा सकता है, जब समस्या को ठीक प्रकार से समझा जाए और ये पता किया जाए कि समस्या के मुख्‍य Objects कौन-कौन से हैं।
उदाहरण के लिए मान लीजिए कि एक Company में उसके सभी Employees के Bio – Data को Manual Register से Upgrade करके Computerized करना है। अब हमें सबसे पहले इस Real World समस्या से सम्बंधित सबसे महत्वपूर्ण Object को Identify करना है। चूंकि, विभिन्न Employees के Bio – Data को Computer पर Store करना है, इसलिए इस समस्या से सम्बंधित जो सबसे महत्वपूर्ण Object है, वह Employee ही है। Employee एक Physical Object है और इसे जब Computer में Represent किया जाएगा तो, Computer में वह Employee Logical Object कहलाएगा। (OOPS Basic Concepts with Examples)


How Indian politicians are using social media to build personal brands

The revolutionary 2014 general elections in India saw social media as a new battleground and Narendra Modi emerged as India’s Obama. Unlike the conventional ways of sending messages, recorded calls and public gatherings, this election saw politicians leveraging social meda to reach out to their constituents like never before. Even those who were reluctant earlier have now become active either out of necessity to keep up with their peers or as mandated by their political party.
Twitter recently released a blog on the 100 days of Twitter diplomacy by Narendra Modi, with an interesting heat map of tweets with geotags that had mentions of his name. Here is a look at the social media profiles of some of the noted politicos and an attempt to classify them into various buckets based on patterns of their engagement.

Social Media Leader: Some politicians have nailed the art of social media engagement, with an amazing mix of personal feelings, nationalist pride and smart positioning.
PM Narendra Modi, for one,  has mastered the art of using social media with nary a false step. In the first 100 days of his being India’s PM, he has added over 2 million followers, taking the tally to 6.2 million followers and making him the second most followed politician in the world behind only Barack Obama. Including the followers on the official twitter handle of PMO, the follower count is close to 9 million. Modi seamlessly keeps foreign relations (wishing Nishikori on being the first Japanese and Asian male to enter US Open finals), nationalist pride (wishing Sania Mirza on the mixed doubles win), engaging with young India on the occasion of Teachers’ Day and sharing with the world how he gifted the saree from Pakistan PM Nawaz Sharif. The tweet that shared his most human side and made him seem more accessible and create his brand new persona was of course the selfie of him seeking his mother’s blessings after winning the mandate.


Despite knowing that there is an army of social media experts who handle and guide Modi’s online presence, it still is quite an achievement to share opinions and truly converse with the masses.
Party Mouthpieces: Undoubtedly, we all believe that this is one of the primary goals that every politician aims to achieve. In any case, they cannot afford to tamper with the party identity and defame their current status. However, it seems some of their social media accounts are filled with such posts and tweets.
Sushma Swaraj, however, plays it well on both fronts – maintaining her and her party’s political image. She uses Twitter to convey her opinion on matters relating to her and her party’s identity. Furthermore, this may seem to be the only reason why she has joined the Twittersphere.
Interestingly, Mr. Yadav’s Twitter handle (@AAPyogendra) is enough to say what means to him more: his party or him? His twitter wall is filled with a plethora of tweets/retweets on the flaws of the current ruling party. He maintains a strictly political profile and makes sure his party identity is fenced. Here’s a tweet of his targeting the BJP when Amit Shah was announced the party president, despite the accusations on him.

Looking at Priyanka Chaturvedi’s twitter profile, you will find that, all that she has got to offer to her 56 K followers are insights on Congress and the importance of women empowerment. Her opinionated tweets or retweets which interest her, revolves around such ideas. Probably just like the epic Rahul Gandhi interview at Times Now.
Controversy’s Children: Probably this is the next best category that can fall after ‘upholding party identity’ section. Today, controversy seems to be an apposite synonym for the word politician. Going hand in hand with what happens on-field, some politicians have taken social media as a virtual battlefield aiming hard to keep their followers updated on the recent happenings of the other parties.
Moving on, in case you are looking for points against Narendra Modi, hop onto Digvijaya Singh’s Twitter page and you can find an accumulation of information against him and his minister’s. His page is more about the rosy image of his party and less about him. The biggest controversy of course was around him, not by a tweet of his. It was when his relationship with the journalist Amrita Rai was made public in the election build up and he was forced to respond to it. There hundreds of tweets mocking him and his political party’s take on women empowerment in the backdrop of this event.


Subramaniam Swamy’s twitter wall has often been transformed into a controversial forum with his ardent Hindu beliefs. A recent example could be of him referring to Modi as ‘Brahmin’. However, he often indulges in spreading awareness amongst his followers on his appearance on television, his articles and his speeches. Other than that, he retweets on topics that interest him.
For Shashi Tharoor, Twitter has been a two-edged sword from the beginning. One of the early adopters among India’s politicians (joined March 2009), he has built over 2.34 million followers. But his gaffe of implying that economy class flyers were cattle class and the subsequent explanation happened just 6 months after that. There was then a quiet period until his wife, the late Sunanda Pushkar took to Twitter to refer to his ‘alleged’ affair and proximity to the Pakistani journalist Mehr Tarar.


I, Me, Myself: Like most of us are on social media, many politicians are deeply concerned about themselves more than anything else around. Almost all of their tweets have their stamp on it, whether related or not.
Even though Arun Jaitley joined Twitter in December 2013, he is working hard to make sure that his identity is in the forefront. The same can be said about Shivraj Chouhan. Both of them tweet festival greetings, encouragement messages or even other announcements with their large pictures and the message itself present somewhere on the picture almost as an afterthought. Chouhan’s profile also talks about development initiatives of Madhya Pradesh.

Recharge your programming batteries

Many of us in the field of programming and development go through a phase where we completely blank out. Our minds don’t work, our logic seems to have lost its track and we are not able to make any progress with projects. If this has happened to you and continues to happen to you… then you are not alone.
A lot of programmers and developers go through this phase on a continuous basis. I go through it at times. You could blame it on the module, your stress levels, family & personal issues, etc. But, no matter what; we still need to deliver projects on time. Clients are least interested to know what your personal problems are. They want their deliveries on time. Wouldn’t you?

Over a period of time, I have come across some tried and tested tips that will help you recharge your programming batteries. I recommend that these tips be made part of your regular programming practice, as this not only helps you to get a solution where you are badly stuck; but also relaxes your mind from the stress of thinking too much.

1. Switch off the monitor and take your book
If you cannot get a solution on your machine; try to resolve a logic issue on a book or a piece of paper. Draw flow charts and other diagrams to help you arrive at logic. Doing this will give you a new direction to look at; probably you missed a point or never thought that way.

2. Leave your development environment
At times, going away from your computer helps, as it changes the mood and freshens your mind. Continuous working on the computer at times drives you to focus on the problem so much that it keeps getting bigger. Changing the environment by either taking a walk, discussing with friends or watching some TV will help you get out of the monotony of breaking your head on a problem.


3. Play computer games
Yes, this works. Atleast for me, it always has. You can try it too. Like I mentioned earlier, it helps break the monotony of deriving a solution to your problem. Play games that get you to think and react instantaneously. A action game like Quake, DOOM, etc or a strategy based game like Age of Empires, SimCity, etc will help you in a big way

4. Meditate
Close your eyes and meditate. Taking deep breaths will help you calm down. While meditating, clear your mind of all thoughts (including the problem at hand) and relax. Feel the stress getting out of your body and mind. Think positive thoughts, visualize a place that you would like to visit for vacation.

These are some tips that I follow and hope it helps you as well. I would like to know what you do to recharge your programming batteries. Please feel free to leave behind comments for questions or if you have some tips of your own, please share; you could help others by sharing.

12 common programming mistakes to avoid

Programming is an art and science and like all art and science the only way to learn is from mistakes. I have made many… and I would like to share with you the mistakes that I have made over my journey with development.
These are some of the most common programming mistakes made by developers (including me) and how to avoid them (not listed in any specific order)
1. Improper or No comments
Can you imagine a program without comments. Just imagine how difficult it would be to read someone else’s code without comments. The reason why we as developers miss out on comments is because when we write code, we are so engrossed in developing logic that we forget this essential step. I recommend that let you develop with the flow of logic that you have and plug in comments after you finish coding. Write comments for any and all complicated logic and SQL queries. Comments will help you a long way in reviewing your code.

2. Not reviewing your codeOnce you get that big ‘AAha’ feeling looking at your code after you have completed it, it’s best to review your code immediately and try finding issues if any. You should not only review your logic but also your SQL queries. Look for instances where you have executed SELECT/UPDATE/DELETE without a WHERE clause (not a joke… this happens). For logic that is complicated you should dry run that piece of code to test if it works well.
3. Assuming Business Logic
What do we all do when we have no one from the business side to help us with Business Logic… we assume. Being proactive is good, but it could cost the client his business if you assume business logic. In situation like these its best to escalate your issues and concerns along with your assumptions to the business side and seek clarifications.

4. Not refactoring codeA silly question to ask, but here it is. How many times have our clients asked to take our sweet time to deliver a code? Well, never for me. So what do we do as developers? Develop code at the speed of thought, which results in the code being completely messed up and duplication of functions being created. I recommend that once you are done with your project and before the phase of QA begins, spend some time to refactor your code and optimize it as much as possible. This will ensure that your code is stable, reliable and reusable.
5. Not unit testing your code
Completing your code and getting ready for integration is the good part, but not unit testing your code bounces back on you when you start getting a series of integration errors. Its always better to unit test your code before you move ahead with SIT (System Integration Testing). Test functions and code separately to check if it works as desired with a range of parameters and try to automate it. Automating your unit tests will help you to execute tests whenever you make changes to your code.

6. Not maintaining list of changesNot every developer is blessed with a code repository, though it is best to have it. In development environments where code repositories don’t exist it’s important to maintain a list of changes done on the project. Changes to files, configurations, databases, images, environment settings, etc are all important pieces of informaiton that will be required at the time of deploying to staging or production environments and its a must to record these changes in a text file. Without such a text file you can imagine the outcome of deploying to production environments and missing some changes.
7. Not indenting your code
Indenting your code is very important, its ultimately you who will maintain it later. Indenting code not only helps you to structure your code better but also helps you to read and debug your code better. You should try and get a code beautifier that will help you indent all your code as per the rules defined, thus saving you time on bigger projects.

8. Not modularizing codeNot breaking the functionality into multiple modules/functions is a big crime. Break your code into as little form as possible to complete one logical set of functionality. Your function should do what it is intended to do, nothing more – nothing less. As a rule of thumb your code per function should not exceed one page of your screen. Exceptions to this rule do exist, but keeping this rule in mind from the very beginning of development will ensure that your code as modularized to a great extent.
9. Hard coding messages and configurations
Its bad to hard code messages and configuration parameters. This effects the flexibility to change the behaviour of the application at runtime. With scripting languages like PHP it is easy to make such runtime changes. But for applications developed in Java or .NET that are compiled and deployed, it is a daunting task that can take as much as 30 – 40 minutes for deployment.

10. Not optimizing queriesI have been guilty of this too. We as developers think that writing the best code and using the most optimum function provided by the API is the only thing to do. But, we don’t realize that the time taken to execute the script is entirely dependant on how sooner your database can serve results. Therefore, I recommend that you check all your queries with the query optimizer tool that comes along with most of the database engines.
11. Not comparing files
You should always compare the modified files with the original source base. This gives you an addition opportunity to review the code and changes done and if it confirms to business logic. Configuration and function files should always be compared to see and validate the changes that have been made.

12. Not having a backup of files before uploadWithout a source control software it becomes important to that you backup important files before you upload changes. Such files should include but not limited to – configuration, database and important function files.
Please feel free to share your programming experiences and write comments if you would like to share other mistakes not listed above so that developers like you and I can learn from it.





7 habits of highly effective freelance programmers






I have developed these based on my freelancing experience. Though I have discontinued freelancing, but would like to share my practices with you. These are basic practices and have been developed over time with experience (good and bad). Please feel free to leave your experiences and comment on this article.

1. Communicate with your clients frequently

This I believe is the most important habit that you should inculcate. Keeping the client in the loop ensures them that you are on top of things and that you are working on their project. Think about it! what if you were the client and were paying someone to develop something. Wouldn’t you want to hear from your vendor frequently?
Issues, slippages, project statuses should be frequently updated to the client (irrespective if your client asks or not). It’s professional ethics!

2. Document interactions with your client

Following point 1, you will have a lot of interactions with your client. You should record/document these interactions as a habit. These interactions could either be in the form of a chat message, emails or function specification documents. Maintaining a history of such interactions will help you during the closure of the project and mainly towards User Acceptance Testing (UAT).

3. Maintain on-going relations with all parties

Just because a project is over does not mean that you should not maintain relations with your clients. Greeting your client on birthdays, anniversaries, etc makes them feel good. This exercise is good to build rapport with clients. It always keeps you fresh in their minds. So, the next time they have a project; guess who gets called first.
In addition to above, you should also maintain relations with suppliers or other freelancers who you outsource work to. In the long run it helps build trust and gives you a good bargaining power. Think about it.

4. Get yourself a professional identity

So what if you freelance, it doesn’t mean that you should not carry yourself professionally. Create professional looking logos, business cards, stationery and website (very important).
Get a professional copy writer to help you with the content of your website. You should mention the projects that you have done and the skills that you have. Always have a contact form on your website where prospective clients can contact you (and when you do get contacted, reply immediately).

5. Seek testimonials from your clients

Seek testimonials from your clients after closing a project. Get this on email and catalogue it for future reference. Also seek their permission to publish their testimonials on your website. In addition to this, you should consider requesting permission from your clients if its ok to give their contact information for reference checks. Some prospective clients would like to talk to your old clients and gauge the experience they have had with you.

6. Create reusable libraries

Creating reusable libraries makes you more profitable. Think about it! If you have been creating email validators on forms for nearly all projects, it makes more sense to create a reusable library and import that library in your current project and make use of it. This way your effort on the project in the long run is reduced and hence you get paid for something that has already been done.
In addition to this, if you discover a bug and fix it, you can apply a patch immediately to all your projects. Saves your time there too and helps all your clients with the bug fix in one go.

7. Maintain proper accounts

Many freelancers (including me) have failed at this. We fail at this not because we don’t know how to handle finances or accounts, but because we are programmers… we love to write code… not books. Do you agree with me?.
But the hard reality is that at the end of the financial year we need to pay taxes. To pay taxes properly we need a good accounting system. The choice is up to you, either be disciplined and maintain proper accounts from day one or waste a lot of time towards the end of the financial year doing it.
I recommend that you do it as you go along. I recommend that you dedicate a weekend to file your papers/accounts properly.
Please feel free to post your comments or add to this list your experiences and best practices.

Tuesday, September 23, 2014

12 Things That Would Make You A Better Software Developer

The 12 points discussed in the post are the following:-
1. Know your tools
2. Modularize
3. Error messages are your friends
4. Plan, Plan, Plan
5. Maintain predictability in code
6. Write beautiful code
7. Refactor
8. Central location for configuration/settings
9. Push towards automation
10. Keep the comments updated
11. Write jokes in comments
12. Choose the right team

1. Know your tools

Programming is no longer just typing code out of the air into your text editor and compiling it after you are done. Programming is more of an interactive process now.
Lots of tools are available now, that can boost developer efficiency. Most programming languages have rich IDE’s with features such as “intellisense”, auto-complete, realtime syntax checking, profiling and debugging assistance, source control integration etc built-in. Knowing these various tools and features are not a must to be a great programmer, but, without a question, better tools can boost your efficiency as one.
There are programmers who swear on their text editors.
When I started out as a programmer, I didn’t know that you could trace (execute) your Javascript code line by line and watch the values of variables in realtime, as they change.
I found it accidentally one day. And I still remember that moment. It felt like pausing time. I felt like I was using magic sands to stop time. (When you play the game, Prince of Persia you can pause time using these magic sands. When you do this in the game, everything except you are frozen in time, and when everything including your enemies are frozen, you can go around killing your enemies and doing stuff.)
It was amazing! Anyway, what I was telling was that, if you find out and utilize such features and tools, you will find life much more easier. Learning little tricks like these are like collecting those magic mushrooms in Super Mario. They give you super powers, and hopefully, you will be able to knock down your enemies more easily.
“If I had eight hours to chop down a tree, I’d spend six hours sharpening my axe” – Abraham Lincoln.
So, get sharpening your axe!

2. Modularize

All software projects start small and gradually grow over time, adding features and getting fat. So when you start planning a project, modularize it – divide it into modules.
A module can be a section doing a particular task. Or a module can be a semantic group of functionalities. For instance, if you were making a program like Micosoft Word, then you can put together all the code for text formatting (coloring text, making it bold, italics, changing font etc) together into a single module.
Such breaking up of a project will make assessment, assignment, development, management and maintenance easier.
An important thing to note about when you modularize your project/program is that, modules should be be as independent as possible. In computing, this design principle is known as Separation of Concerns. Later, the different modules can be plugged together to achieve the full program.
Also, make sure your modules make sense in a semantic and/or functional way. You can have sub-modules and sub-sub modules inside your module.

3. Error messages are your friends

Error messages thrown by the programming language or its environment are immense help in identifying and solving issues.
Consider a Javascript program with just 100 lines of code. You, the programmer mistyped a variable. Say this variable was being used only in a special case. As a result, the program is not working as intended in the special case. If an error console is not present and you don’t see an error report, you are very unlikely to even find out that there is an issue.
So when you develop/debug/test, always enable error reporting. Error reports usually have all the information you need to fix most of the issues, down tho the line number where the problem is.
All languages (that I have ever encountered so far) have one way or another to report issues. If it is browser-side Javascript code, check the error console of Firebug or Webkit’s Inspector. If it is a PHP program, make sure error reporting is enabled for E_ALL and monitored.
If you are working with PHP, here is a nice article to help you tailor error reports the way you want. So make sure you learn more about error reporting for your particular programing environment.

4. Plan, Plan, Plan

“Weeks of programming can save you hours of planning” – Author unknown.
When I first learned programming (C language) in college, whenever a programming question was given to me, I would start up my IDE (Turbo C) and start typing #include<stdio.h> void main() ….  etc. I would just type furiously, until I get blocked. Then only I would start to think where I’m going next.
Well, actually, this approach worked for me, in college. I would like to quite humbly :P let you know that in our batch, I was the first one to compete the programming task and exit the lab on our C programming lab examination. (Its my blog, I’ll brag ;) )
The thing is, proceeding without planning will work when you are writing a program in school to check if a string is a palindrome or not. But the case is very very different when you are building a large application for real-world use. Without proper planning, you will overlook issues, write crappy code and waste time and resources. Let alone the later feeling of self pity.
Let me tell you what happened to us in one project. In this lame social network application that we were making, the site’s users were able to message each other, naturally. When user A sends user B a message, we inserted one row in the messages table with from=A, to=B. User A could see this message in his ‘Sent messages‘, and user B could see this message in his ‘Inbox‘. Everything worked quite well – until user B decided to delete the message from his damn Inbox. Well, when B deleted the message from his Inbox, bam!, the message was deleted from user A’s ‘Sent messages‘ also.
The problem was that, each message was a saved as a single record in the messages table, and actions from both sender and recipient were directly applied to it. So if either its sender or recipient deleted it from his mailbox, it would disappear from the other person’s mailbox too. Oh, and let me regretfully confess that I was was the one designed the above said database. All because I jumped in without planning properly. Well, there is a lesson learned, and a couple of sleepless nights :)
Anyway, what I do now is that, when I get a problem, I analyze and understand it well. Then I outline a plan to tackle the issue. Once I’ve outlined the solution/algorithm I’ll try to see if there is anything I overlooked. Once I’m happy with my plan, I’ll go ahead and implement it. If the problem is complex, I’ll ask somebody to take a moment and review my plan.
As humans, we are prejudiced about things based on our very limited knowledge. As a programmer, it is always good to ask your friends or ask in StackOverflow or somewhere to see if anyone else has a different solution for the same problem.

5. Maintain predictability in code

When you are working in a project with more than one developer, discuss with your team and decide upon the conventions you will be using. Conventions include, but not limited to, naming of variables, classes, functions, database tables etc, interfaces of modules, coding style, documentation practices etc.
When commonly agreed upon conventions are used in a project, it gives the advantage of predictability to the programmers. Predictability probably sounds unimportant, but believe me, it is important.
For example, in a project, we agreed that entity classes will be the singular form of the entity name in UpperCamelCase. We also agreed that all tables will have a method such as get_entity_details(entity_id) to get a particular entity’s details. So naturally a person can expect that User->get_user_details($user_id) will give a particular user’s details, without checking the code or documentation. Do you see the beauty of predictability? May be you don’t yet. But take this, such perks are huge bonuses when working in big projects.
And a little rant, I once worked with a programmer who made frequent careless spelling mistakes. In code. If he was creating a User class, he would probably write a misspelled member function like this get_uesr_details(). When someone else tries to call the function in their code, they will, out of instinct, use the correct spelling, which is get_user_details(). Of course it will trigger an error somewhere saying that “function get_user_details() does not exist”, and the second programmer will have to refer the my dear buddy’s code/documentation to see what the wonderfuck is going on.
Man, did that guy give me enough headaches for a lifetime or what!
Checkout the coding conventions for PHP, by the Zend Framework people. Even if you are not working with PHP, you can get some ideas from it.

6. Write beautiful code

“Programs must be written for people to read, and only incidentally for machines to execute.” – Abelson / Sussman
When you write a piece of code, keep in mind that it is very very likely that you or someone else will be coming back to the code in some point in the future. May be someone will want to modify the code and add a new feature, or may be someone will need to fix an issue in it or may be someone just need to look at your code and study it. If you write clear, readable code, your colleagues will hate you less for it. And there is a good chance that you will go to programmer heaven when you expire :)
There was this buddy of mine who never ever use consistent indentation. I have a screenshot of his code below.
Code with inconsistent style
If it missed you, indentation, brace positions and everything else is inconsistent in those 6 lines given above.  The above code might still seem ok for some of you. But a real program is almost never 5-6 lines like this. Imagine a source file with 2000 lines of code like this, where complex logics are implemented.
Jeff Atwood in this essay says that “beauty isn’t just skin deep, so beauty of a piece of code lies in the underlying ideas and algorithms represented there, not just in the code itself”. He’s right, but it doesn’t hurt if the code itself is beautiful and readable, does it?
Here are some pointers to write beautiful code:-
1. Consistency is a key factor in writing elegant code. Decide on a style and follow it.
2. Proper & consistent use of white space (indentations, space between tokens etc)
3. Proper use of comments.
4. Stick to conventions.
5. Meaningful names for variables, methods, classes, tables, files etc.
These are a few points that just came of the top of my head. Here is a well written article with guidelines on writing beautiful code.

7. Refactor

Refactoring is making slight changes in the existing code to improve it. Continuous improvements will make the code more understandable and maintainable.
“By continuously improving the design of code, we make it easier and easier to work with. This is in sharp contrast to what typically happens: little refactoring and a great deal of attention paid to expediently adding new features. If you get into the hygienic habit of refactoring continuously, you’ll find that it is easier to extend and maintain code.”
- Joshua Kerievsky, Refactoring to Patterns (From Wikipedia)
But at times, you will face situations where just refactoring isn’t enough. At those times, a complete rewrite could be the only solution. Joel Spolski, CEO of StackOverflow and the renowned author of Joel on Software, writes in an article named Things You Should Never Do, Part I, that one should never rewrite code. He reasons that the project will be set back in its schedule if gone for a rewrite. Ok, never rewrite is a little too strong a choice of words here, imo. So, lets take home this:- 1) refactor continuously, 2) rewrite only when there is no other option.

8. Central location for configuration/settings

In typical PHP projects, there is a file called config.php, which holds the configuration settings. I’ve seen projects in other languages also employing similar configuration files. It is always a wise choice to store all your configuration settings grouped together in a central location.
This is helpful in deployment, because there are fewer files to edit and configure. Also, it is hard to miss one of the settings when you are grouping them together.
The optimal scenario is to save configuration in a separate dedicated file which is exclusively for saving configuration. It is best if you could avoid adding application or business logic into these configuration files. When Version Control Systems (VCS) are used for managing the source code, we will usually need to keep the configuration files outside of source control’s tracking. If you had other code or logic also included in your configuration files, excluding these files from source control will be messy.

9. Push towards automation

Lots of things at different stages in a project can be automated. The most commonly seen automation scenario was automation of test case verification. Deployment automation is also on the rise now. Previously shell scripts and similar techniques were used for automated deployment.
Now there are tools such as Capistrano for deploying web applications which allow sophisticated level of control with ease than the shell scripts.
In a project I did, we wrote a script to sweep over the United States to pick up business listings and save them to a database. The script took around one week to complete one full scan over the U.S. When one sweep was over, we had to manually reset the script with new start points (latitude and longitude) for the script to start again. This was ok initially, because we had to do it only once a week. But later we were running multiple script instances at the same time from multiple servers to speed up our gathering of data. So we had to manually reset the completed scripts more often, usually once every day, which soon enough became very cumbersome. It was an unnecessary process that wasted several of our precious man-hours.
Later we automated the script-reset process and things were swift.
Quora Engineer, Edmond Lau in his insightful answer to “What makes a good engineering culture?” says:-
In his tech talk “Scaling Instagram”, Instagram co-founder Mike Krieger cited “optimize for minimal operational burden” as a key lesson his 13-person team learned in scaling the product to tens of millions of users. As a product grows, so does the operational burden per engineer, as measured by the ratio of users to engineers or of features to engineers.  Facebook, for example, is well-known for touting scaling metrics like supporting over 1 million users per engineer.
When repetitive tasks are automated, we are making the system take care of itself with least manual interference. Edmond Lau continues to say that automated tasks must be logged and measured:-
Without monitoring and logs to know what, how, or why something is going wrong, automation is difficult. A good follow-up motto would be to “measure anything, measure everything, and automate as much as possible.”

10. Keep the comments updated

It is better to have no information rather than having wrong information“. When I ask someone for route, I would rather have them say “I don’t know” than pointing me in the wrong direction.
Comments are like signboards. Comments, when properly written, are as good an asset as the code itself. They will help the reader get a grasp on what is going on in the code faster.
Now imagine the case where this nice programmer wrote a well commented program. Anther guy, when modified the program didn’t bother to update the comments to reflect the new modifications he made. Now the program has comments that are no more valid. Now the program is going in one direction, but the comments are pointing the other way. Well, what more can be said. The third person trying to understand the code is in for a serious brainfuck.
Don’t ignore comments and leave them wrong because they do not affect the program’s working. A program is already difficult to read than it is to write it. So, keep your comments updated and accurate.

11. Write jokes in comments

Another one:-
// I dedicate all this code, all my work, to my wife, Darlene, who will
// have to support me and our three children and the dog once it gets
// released into the public.

If you can light up a moment of another miserable programmer treading through your code, please do it :)
The best thing about writing jokes in comments is that, your joke doesn’t even have to be explicitly funny or witty. Almost anything light hearted or foolish you write there will seem funny to someone.
// If this code works, it was written by Paul DiLascia. If not, I don't know
// who wrote it

(Comments collected from StackOverflow)

12. Choose the right team

Last, but not the least, choose the right team. This applies especially if you are a team lead or something of that sort. Do not pick people into your team just because you like them or cuz they are friends with you. If you do, take my word for it, you will ruin the project as well as the relationship.

Polymorphism व Overloading, दोनों के बीच का अन्‍तर जानना जरूरी है एक अच्‍छा OOPS Programmer बनने के लिए।

Difference between Polymorphism and Overloading in C++: जैसाकि हमने पहले भी बताया कि एक Class “C” के Structure का ही Modified रूप है। यानी हम Structure प्रकार के Variable तो Declare कर सकते हैं, लेकिन जिस प्रकार से Built – In प्रकार के Data Type के दो Variables को हम आपस में जोड सकते हैं, ठीक उसी प्रकार से किसी Structure के दो Variables को हम नहीं जोड सकते। इसे समझने के लिये हम एक उदाहरण देखते हैं। माना एक Structure निम्नानुसार है-
?
1
2
3
4
5
6
7
struct Add
{
    int num1;
    int num2;
};
 
struct Add A, B, C ;
यदि हम C = A + B ; करें, तो ये एक गलत Statement होगा। किसी Class के Objects को भी हम ठीक इसी प्रकार से नहीं जोड सकते हैं, क्योंकि Class, Structure का ही Modified रूप है। इसका कारण ये है कि Compiler ये नहीं जानता है कि User द्वारा Define किए गए Variables के साथ किस प्रकार से जोड किया जाए।
जबकि Built-in Data Types में जोड करने के इस तरीके को Compiler में पहले से ही निश्चित कर दिया गया है और + Operator ये जानता है कि इन Variables को कैसे जोडा जाए। इसलिये User Defined Data Type के Variables या Object को जोडने का तरीका Operators को बताना पडता है।
यानी + Operators को ये बताना पडता है कि किस प्रकार से User Defined Data Type के Variables या Objects को ये Operator जोडेगा। इसके लिये हमें नए प्रकार के Operations Define करने होते हैं।

इस प्रकार से Operators व Functions को अलग-अलग तरीके से इस बात पर निर्भर करते हुए कि वे किस प्रकार के Data पर Operation कर रहे हैं, Use किया जाता है और इस प्रक्रिया को Polymorphism कहा जाता है।
किसी Existing Operator जैसे कि +, = आदि को इस लायक बनाया जाता है कि वे User Defined Data Type के विभिन्न प्रकार के Variables या Objects पर क्रिया कर सकें। विभिन्न Operators को इस लायक बनाने की क्रिया को Operators की Overloading करना कहा जाता है।
जब कई Functions के नाम समान होते हैं, लेकिन उनके Arguments या Parameters की संख्‍या या फिर Formal Arguments के Data Type में आपस में अन्तर होता है, तो इसे Functions की Overloading होना कहा जाता है। Overloading से एक Programmer के लिए Program लिखना व समझना आसान हो जाता है। यह भी Polymorphism का एक तरीका है।

Dynamic Binding

किसी Object के Reference में कौनसा Function Call होना चाहिए, जब ये बात Program के Compile Time में तय होती है, तो इसे Early Binding कहते हैं। जबकि किसी Object के Reference में किसी काम के लिए कौनसा Procedure Execute होगा, ये बात जब Program के Runtime में तय होती है, तब इसे Late Binding या Dynamic Binding कहते हैं। Polymorphism के अन्तर्गत Dynamic Binding का काम होता है। इसे समझने के लिए निम्न चित्र देखिए-



इस चित्र में हम देख सकते हैं कि Shape Class एक Base Class है, जिसे Inherit करके तीन नई Classes Circle, Box व Triangle को Create किया गया है। चूंकि ये तीनों ही Classes Shape Class से Inherited हैं, इसलिए Base Class Shape का Draw() Method तीनों ही Classes में Inherited है।
अब मानलो कि हमने तीनों Derived Classes का एक-एक Object Create किया और उस Object को Draw करने के लिए Draw() Method को Call किया। ऐसे में जब हम Circle Class के Object के लिए Draw Method Call करते हैं, तब Compiler Circle Class के Draw Method को Call करके Circle Draw करता है।
जब हम Box Object Draw करने के लिए Box Class के Object के Reference में Draw() Method को Call करते हैं, तब Compiler Box Class के Draw Method को Execute करता है।
इसी तरह से जब हम Triangle Class का Object Create करना चाहते हैं, तब Compiler Triangle Class के Draw Method को Execute करके Triangle Draw कर देता है। यानी एक ही नाम का Draw Method Create हो रहे Object की Class के आधार पर उसी Class के Draw Method को Execute करता है, जिस Class का Object Create किया जा रहा है। इस प्रक्रिया को Object के साथ Method की Binding होना कहते हैं।