Raj Agrawal

Learnings from software and technology

  • Home
  • Technology
  • Software
  • Work
  • Play

Connect

  • GitHub
  • LinkedIn
  • YouTube

Powered by Genesis

You are here: Home / Archives for Raj Agrawal

A Comprehensive Guide To Hone Your Programming Skills

July 14, 2011 by Raj Agrawal Leave a Comment

For a beginner, programming has always been a tricky proposition. Learning a new language is never easy; one which is used to refer computers is even more difficult to grasp. Programming can only be mastered with proper understanding and training.

As an aspiring programmer, it can be really difficult to get the hang of things right away. It is very easy to be intimidated by a 1,000 line code. Most people give up before even trying their hand at a particularly complicated program; as an aspirant, the minute you start doubting your abilities, you lose the willing to even try. Its a defense mechanism etched in the human brain; one which must be dealt with inorder to become a better coder. In the programming world, nothing is impossible. Once you have an idea, you can implement it in multiple ways. It can a be difficult to comprehend this concept in the initial stages, when all you’re trying to learn is the syntax of a particular language. But, the real challenge begins when you become adept to a particular language and try to apply it to create a working program. This transition from syntax oriented to application oriented approach is the most difficult one. Once you get the hang of it, no program is difficult.

For a programmer of any skill level, there are few practices to significantly improve the learning curve and set you apart from the average devs. These practices are not related directly to syntax, but rather with the skills one has to develop to be a better coder. They will act as an aiding mechanism for the programmer to develop software in a more efficient manner.

Debugging

debugging bugs

This is the a crucial skill any programmer must possess. A program code is bound to have errors; this is especially true in the case of large programs. The errors might either be syntactical or logical. The syntactical errors will be detected by the compiler which will issue a warning message along with the line at which the error occurred. Logical errors are not so easy to detect. Most of the logical errors occur during assignments, conditions and looping. Hence, it is important to thoroughly check your logic for those respective blocks. Often the best way of debugging is to print dummy statements just to see if a particular condition is getting executed or a loop is looping the intended number of iterations. Consider the following piece of code,


#include<stdio.h>main()

{

     int i;

     for(i = 0;i<9;i++)

     {
             printf("%d",++i);
     }

}

The above program should print values from 1  to  10.  But the output is 13579

This output might be confusing for some beginners. The error is that i is getting incremented twice, first in the loop, and then again in the printf statement. In such situations, take a pen and a paper and write down the obtained value of i on each iteration. Understanding the code line by line is the best way to debug a program.

Efficiency

chicken comic
!

With the ever increasing capacity of hard disks, efficiency with respect to source code’s file size has become less important now, but its important nonetheless. As a programmer, you will always have multiple ways of solving any given program, but you must choose the one which is the most efficient and time saving. A program might not require much processing power, but there are many such programs running simultaneously in the system, hence it is important to maintain a level of efficiency. Certain aspects of programming like loops, use of decimal numbers, the excessive use of files etc can be quite taxing on the system and hence should be avoided as much as possible. Always refine the code so that it executes the least number of lines possible. Always be on the lookout for alternate methods to solve a program, and evaluate each one of them to find the best possible solution.

Confidence

funny cat confidence
That’s a key

This is not directly associated with programming, but is possibly the most important quality a programmer should have. To an amateur, writing a complex code can be quite a daunting task. Plus with deadlines to meet, one can be easily intimidated with the prospect of failure. In order to solve any program, one should have a clear and calm attitude, which can only happen if one is confident about his skills. As long as you know the syntax, no program is unsolvable. All you need to do is to be patient and look for a solution without getting restless about your inability to do so. The human mind has a tendency to give up on a particular train of thought and look elsewhere if nothing is to be gained from it. The only difference is how much time it takes. For some, its like an epiphany. For others, its a progressive realization. That’s why confidence in oneself is critical for success.

Practice

bart practice
Will you?

Practice makes perfect! The more you practice, the better you will get with programming. There are many standard workarounds for each problem, and it becomes easier to remember them if you practice. It gets you acquainted with several debugging and time saving methods which can be used again and again. It also makes you think out of the box and try different methods to deal with different programs.

Naming conventions

Often you will have to use a large number of variables for different aspects of your program. If their names are not probably defined, then it might get confusing to keep track of all of them. Hence, it is important to name the variables in a manner that makes them relevant to the program. This makes it easier to identify and differentiate between them. It also makes it easier for the other users to understand the code.


#include<stdio.h>
main()
{
     int add1,add2,result;
     add1 = 10;
     add2 = 10;
     result = add1 + add2;
     printf("%d",result);
}

Code documentation

It is critical to document each and every piece of code that you write. Add comments where ever possible; this makes it easier to understand the code, which is especially useful in the case of a large program with several lines. Once a particular program is well documented, it can be distributed to other people, without the need to explain them the purpose and working of the code. A succint code will always have more efficacy than an ambiguous one.


#include<stdio.h>
//This program helps to find the average of 5 numbers
main()
{
     //Declaring variables
     int temp, sum=0, average,j;
     //taking input and adding it
     for(j = 0;j<5;j++)
     {
          printf("Enter input no %d",j+1);
          scanf("%d",&temp);
          sum = sum + temp;
     }
     //taking average
     average = sum/5;
     //Displaying average
     printf("%d",average);
}

If a programmer can incorporate all these skills in his/her repertoire, then he/she should have no problems in solving any code. Its not possible to bring about a sudden revolution; changing your manner of thinking in a fortnight is impossible. Take one step at a time and work on it, and success shouldn’t be far off.

Filed Under: Software Tagged With: Programming

How To Be A Fanboy Without Being A Troll

July 10, 2011 by Raj Agrawal 3 Comments

Trolls have been plaguing the internet gaming community for years now; rather the entire internet. Its time we did something about it and take steps to avoid this bothersome concept and its connoisseurs. 

cant-tell-if-stupid-or-trolling
Err

Gamers can be broadly classified into two categories, the ones who love gaming, and the ones who love their hardware. The former cares about nothing other than games and it’s related news. The latter, on the other hand, cares for the system they play their games on. Because of the wide segregation of gaming hardware, each system has their own army of followers. For them, gaming is like a battlefield, and games are like the territories you control. The more territories you control, the better your position on the battlefield.

Now that’s fine. The world wouldn’t be as much fun without fanboyism. A little bias is never a bad thing, and actually works as a social phenomenon, bringing people with similar views together. When any object attracts a fanbase, the people controlling the object and the fans of the object can interact on a creative and productive level which usually results in refinements in future iterations of the objects(the only exception being Apple Inc i guess). In case of gaming, there have been numerous games which were improved upon based on the feedback received from the gamers. The only downside of this is that some people can take this concept a bit too far. Such people in the gaming world are called “Trolls”

Trolls are self employed ambassadors of their respective systems whose level of comprehension about gaming far exceeds that of any normal human being. Their mere presence is destined to bring about biased conclusions in a healthy-non-biased-argument and brings about a very distinct change in the thinking of the subjective society. They are not paid to do the things they do, but the “cause” they are fighting for far exceeds the need for any monetary gains. The funny thing is that even for this one dimensional train of thought, there are many categories. There are some who troll on a very light note; its like drawing a line in somebody else’s book just to irritate them. They troll just for the heck of it. Then there are others who actually go that extra mile and try to justify. The basis of all justification is logical reasoning, and when you try to juxtaposition trolling and justification, that’s the kind of thing that would give any tutor about having to teach you all over again.

I’ve listed a few key points for you to consider while posting anywhere on the web. You may follow these at your will, but i’m sure they’ll easily help you to hover against the bewitched land of trolls:

  • Justify your bias
bias
Bias?

Being biased about something is fine. But you have to back it up with reasoning . If you like gaming on your favorite platform, good for you. Give reasons for it. But for that you don’t have to demean any other system.

  • Be reasonable
calvin on reasonable doubt
Calvin on reasonable doubt

Your opinion should have a unique personality trait. But don’t let it look something like:

XXX is at the upper echelon of the gaming community. XXX does not waste his time and potential playing games on the crapbox or the pc. Those are for people who do not enjoy the pleasure gaming has to offer. XXX only games on the playstation 3, the true gaming platform. Playstation 3 is the only system that can give XXX and gamers on a similar level the quality that people like XXX deserve

You just can’t have any hopes of reasoning with someone who says something like that.

  • Don’t feed the troll
trolls suck
Do not. Ever.

Most topics on game forums go out of hand because they’re given more attention that they deserve. If somebody is trolling and you know it, at least don’t let them be successful. Trolls are usually not open to reasoning. This is probably the only reason someone would reply on a troll topic is to get that satisfaction of not letting him/her have his/her say. But that only makes the conversation worse.

  • Ignorance is bliss
dubya ignorance bliss
Yup

This is the golden rule of the internet. The notion of free speech has never been exploited in as bad a way as it has been on the internet. People can get away with everything. There really isn’t any point in trying to change their thinking, cause they themselves don’t care. The most important lesson one can learn is to let things go.

The above points are not for the trolls. A troll would understand what he is doing and still do it. I wrote this for those who don’t know when they might cross the line. Many people cannot differentiate between opinions and facts and try to ‘speak for the society’. An opinion is a perspective and it should stay that way and the amount of trolls that exist in the gaming world. This becomes even more important. As long as we don’t let things as mundane as news related to gaming get to our heads, everything should be fine. And lastly, contrary to what this article might suggest, trolling is not a crime. Its just a major nuisance which might have bothered a lot of you and it should be eradicated.

Filed Under: Gameology

Is Spintronics A Potential Successor To Transistor Technology?

July 9, 2011 by Raj Agrawal Leave a Comment

UPCOMING TECHNOLOGY – The trend paths laid down by the Moore’s law is gradually nearing it’s end; this basically suggests we need to find an alternative to the conventionally used transistor technology in order to continue making better computer chips. Spintronics, also known as Magnetoelectronics, is an emerging technology that possibly has the answer to the indigent alternative.

moore's law joke
Image Credit [IntelSinSides]

Transistors (being a part of the semiconductor family) are dependent on electrical charges to perform the computational duties. While a research based on Spintronics, led from the University of Cambridge’s Department of Physics, is designed to develop a spin-based electronic technology to replace this charge-based technology of semiconductors. Spintronics technology is being said to succeed the transistors technology for all the good reasons, much need for better computing needs.

Spintronics technology relies on manipulating the electron’s magnetic ‘spins’, when applied to computers could drastically improve their speed with reduced power consumption. This new research talks on making the ‘spins’ more efficient. One of the most intriguing facts about Spintronics is that it does not use electric currents to transfer the spins, the spins can rather transfer information without generating any heat in the electrical devices.

VIA [ScienceDaily]

Filed Under: Technology Tagged With: spintronics, transistors

  • « Previous Page
  • 1
  • …
  • 38
  • 39
  • 40
  • 41
  • 42
  • …
  • 79
  • Next Page »