7 Tips on How NOT to do BAD Programming

By Ashish Mohta

 As a I promised in the evolution of techspot, from now on I will be including posts on programming also.I am not a big experienced programmer but I will surely make a difference on this.

Bad ProgrammingAs this is the first post of this category, I would like to draw attention of programmers who are crazy about programming (like me).Here are some tips out of my experience for not being a BAD PROGRAMMER.

  1. Dont Start coding as soon as you get to know what you have to make : When I started coding i was a cowboy ,I know C , I know sytanxes lets do it.And to be honest it used to take hours of trial and hits to get to know what I have to do.So “Have a roadmap like a sketch or flowchart, before you embark for programming.It will save time and frustration both”
  2. Dont Make your programme look like an essay: If you have written a code which has low readability, like you have to move the screen left and right to see the code, the alarm should be ringing.Make your code readable so even you can understand what you have written.
  3. Dont forget to add comments: Whenever you change or add something new, make some comments so you can undestand what you did, why you changed.Trust me it will help you when u get back to it again.
  4. Dont Name the variables and functions as “a “b”: Dont make you program constructs like variables and functions like “variable a” “function b”.It is highly recommeneded that you name them properly so its useability is clear.
  5. Dont make longer programs, break them down: If you have written programs which is too long, alarm should be ringing.Breaking down the functionality will not only give you, reuseablity but easy reading.
  6. Dont have too many break points: If your control construct(selection, iteration and sequencing) have more than one entry and exit points, alarm should be ringing.
  7. Dont forget to catch exceptions and errors: If your programme is crashing too often, you have surely forgotten to catch the overflow exceptions and other things.Remember no matter how you good your programme is, if it crashes you are a looser.

So what mistakes you make ? Do you have more tips? Share your experience with me and other readers to let them know and become a better programmer.I hope you liked the post.

If you enjoyed this post Subscribe to the Free TechSpot Newsletter or Feed It through RSS Feed it to your home page .Leave a comment to this post tell what you think about the post and other readers.and do subscribe to comments to this post so you get ideas by other readers and bloggers.Its a great way to find

 

About The Author of this article:
Ashish is one of the co-author of this blog and writes on various interesting softwares, PC tips and more. You can read more of his articles here.

Enjoyed this article? Download our Toolbar ( for Free ) and read us more quickly or Free Subscribe to the Full RSS Feed or Get Post like this in your Inbox Click to get via Email ( You will have to confirm by checking you Inbox)


Readers Play Ground


11 Comments and Link-Backs to “7 Tips on How NOT to do BAD Programming

Click Me and Jump to Add your Comment :)

11 Comments from Friends and Readers

  • Nym, January 10, 2007:

    Hi !
    No matter with your post and no matter with the topic of your site either but…you’ve been tagged !! Click here and answer the questionnaire.
    Ask me if you’ve got pbs with traductions from french ;)

  • Ashish Mohta, January 10, 2007:

    @Nym: Thx for tagging me nym.I will be transalting your page and responding you soon!!

  • Nym, January 10, 2007:

    and now a comment for your post (lol) :
    i’m a bit programmer myself (C, Java, ada and a few others) and i learnt the languages at school. Your advice are really the advice our teachers gave us and i think you forgot nothing :). In fact, we were evaluated on these criteria.
    And good thing : you give an explicit way to evaluate a program (no ‘a’ or ‘b’, no need to scroll the code from left to right etc.).
    One more thing, i heard that in some firms, they want about 10% of comments int the code. It can help to knox if you have enough comments or not.

  • Madhur Kapoor, January 11, 2007:

    And always use GOTO less in programming .

  • Tim, January 13, 2007:

    That “no a b” brings back a lot of memories from when I used to program in BASIC. Since my father had showed me examples using $a and $b, I thought that I had no choice and thus only used those variables (starting at $aa after $z). The code was a hell to read, and I needed a separate paper for writing down the function of every variable when I started working on a relatively large project.

  • Ashish Mohta, January 13, 2007:

    @Tim: Thx for the comment.It has lot of memories for me too.As i was going to start cover programming topics too, I thought of starting with this.I hope you Enjoy it and keep coming back

  • Dan Singleton, August 1, 2007:

    Being in the biz for over 26 years as a programmer, basicly it’s all about style. Everyone has their own. The key to being an successful programmer is understand the requirments, plenty of comments, yes, don’t create longer programs but sometimes it’s necessary. Overall, make it easy to read and have a great flow.

  • Ashish Mohta, August 1, 2007:

    @Dan: I definetly agree with you on this. specially lot of comments help any other programmer to understand your coding better and reduces time when the upgrade has to be done . Thanks for sharing your experience with us :)

  • praveen, September 2, 2007:

    Addition to the move

    Design is the fundamnetal boost for programming.

  • Ashish Mohta, September 3, 2007:

    @Praveen: Agreed, Thanks for sharing your views with us

  • Manoj Shinde, October 17, 2007:

    Hi,

    Exception Handling is what i used to while writing my programs. It made my customers find themselves in worst situations while using the programs. But Now I learnt a lot and use a central error handling system.

    I would like to suggest following

    1. Code should be reusable.
    2. Less use of global variables.

Leave a comment Share your thoughts with the world

Scroll Down and Check footer for more details

Search




  • Recent Comments:

    • Red@: Never minde … by the way my name is Reda ;)
    • Rakesh: Golden Park, Green B2/10,beturkar pada, kalyan (W) Dist: Thane, Maharashtra
    • Red@: i found the true Adress , it’s : monitter.com/
    • Red@: i’ve nothing with that link !!!
    • Keith Dsouza: I used to visit this site quite a lot earlier, never really get much time these day but I do get email...
    • Tharma: Hey if anyone has any spare invites, I would love one! Thanks a bunch.. med5056 at gmail dot com
    • Brian Toomey: Would love an invite to this service to automate the annoying task of emailing 50 versions of an...
    • Aaron: Hi, It looks like dropbox will give me the space and tools I need. Please pass on an invite, if you have any....
    • Deep Throat: hey ashish mohta, ive done the rec 2 dx10 installer and i have DX10 working (although some games dont...
    • Dale Bell: Could it be that Yahoo gets paid for Bots? Did I say that? hummmmm

Technology Blogs - Blog Top Sites