none
Programming RRS feed

  • Question

  • I am a fresher in the programming field. While coding i get much more confused about what to write what not to... would anyone can suggest about how to code efficiently?? please do help me out.
    Thursday, February 7, 2013 9:18 AM

Answers

All replies

  • I would say first start writing, only then you can come to know how to code efficiently . Happy coding.

    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    • Marked as answer by brajesh karna Friday, February 8, 2013 4:05 AM
    Thursday, February 7, 2013 9:47 AM
  • Hi,

    I think the best way to get help is to simply come back and ask with real code. What did you write where you are not sure if it should be written that way?

    Then we can directly help you and give reasons why it could be done different.

    The core rules are:
    - Try to keep code easy (easy to read, easy to understand). Complex code is always a sign that you might have placed logic in the wrong locations or that you have to redesign the solution.
    - Avoid double code - If you find that you have the same code at 2 places then you should check if it is possible to merge it so you only have it once.

    That are 2 rules that come to my mind right now regarding how to write code. There are a lot more things but I think they fall back to those or simply belong to some other area i.e. object oriented design and such things.

    Also important: Use the correct tools. So one core requirement is source versioning tool. That way you can keep code clean e.g. if you rewrite a part you simply remove the old one. Another requirement are unit tests. You can refactor (change) existing code to improve it and simply check that you didn't break something trough the unit tests (if you have good unit tests). Without unit tests you end up with code that you do not want to touch because you never know what you might break...

    With kind regards,

    Konrad

    Thursday, February 7, 2013 9:59 AM
  • Thanks a lot for the Suggestion. I will follow the direction as you have provided.
    • Marked as answer by brajesh karna Friday, February 8, 2013 4:05 AM
    Thursday, February 7, 2013 12:07 PM
  • thanx
    Thursday, February 7, 2013 12:08 PM
  • Hi,
    apart from Konrad Neitzel's suggestion you must follow some guidelines as well.
    Follow the link : http://www.codeproject.com/Articles/8971/C-Coding-Standards-and-Best-Programming-Practices

    Hope this helps.


    One good question is equivalent to ten best answers.

    • Marked as answer by brajesh karna Friday, February 8, 2013 4:05 AM
    Thursday, February 7, 2013 12:21 PM
  • Start your coding automatically it will teach you.
    Sunday, April 6, 2014 1:13 PM
  • Hello,

    Nice to meet you here, 

    Do not worry, Just think about "I CAN DO IT" & first just try it simply. 

    Experience will make you to do code efficiently.

    • Proposed as answer by Sabeen Shamli Wednesday, November 12, 2014 8:36 AM
    • Unproposed as answer by Sabeen Shamli Wednesday, November 12, 2014 8:36 AM
    Wednesday, November 12, 2014 8:35 AM