Thread: Steps to program

  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    347

    Steps to program

    Yeah i did so much programming but every time i start writing a new program/logic nervousness comes in. Just want to know the exact steps to follow before I jump to coding. I think i am doing a big mistake by directly jumping into programming.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,778
    I think this is akin to those story/essay writing assignments they made you do in school. Some students just jump in after reading the question and make things up as they go along. It might work, but it's also likely that they will end up with plenty of plot holes or an incoherent argument. Other students take some time to write a plan, and while the plan might change as they flesh out the writing, they have a better chance of being consistent and coherent.

    Software development methodologies are basically sophisticated versions of this "student planning then writing" thing: they involve different ways to come up with the plans (i.e., unlike individual writing in school, programming is more like a long running group essay, so communication is an important factor), and different ways to structure planning versus execution and other aspects. So you could learn about them and start using them: no matter what you pick, it'll be better than "directly jumping into programming".
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,876
    I'd say that it depends on what you are doing.

    The other day I started a new project - Because it will be a large addition to an existing project, the first thing I did is slowly go through the existing code and documentation so that I fully understood what needed to be done.

    Then using a piece of paper, I broke the problem into sub-problems

    My next step was to start writing code.

    I used a "top down" approach - Start with the high level stuff (the bits that interacted with the existing code) and worked my way down to the hardware controlling software, testing each stage as I go.

    When I first started writing C console programmes I opened notepad and typed out what I wanted the programme to do:

    e.g.
    *** Multiplication ***
    Please enter the first number: 5
    Please enter the second number: 4

    The result is: 20


    ... You can then get a grasp of what needs to be done.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Best way to calculate these steps?
    By 6tr6tr in forum C++ Programming
    Replies: 4
    Last Post: 11-04-2008, 03:12 PM
  2. # of steps in sort
    By Tupcia in forum C++ Programming
    Replies: 6
    Last Post: 05-19-2008, 12:04 AM
  3. counting steps
    By muran_pling in forum C++ Programming
    Replies: 6
    Last Post: 12-18-2006, 04:27 AM
  4. newbie: steps to create and compile c program in SUSE
    By gemini_shooter in forum Linux Programming
    Replies: 12
    Last Post: 06-22-2005, 06:35 PM
  5. Sum of steps
    By Melon in forum C Programming
    Replies: 1
    Last Post: 02-13-2003, 06:52 PM

Tags for this Thread