Thread: drawing flow-charts for every single program??

  1. #1
    Registered User LogicError's Avatar
    Join Date
    Aug 2003
    Location
    г. Магнитогорск
    Posts
    76

    drawing flow-charts for every single program??

    I'm on first course in College.. We're studying VB.. Our IT teacher makes us draw a flow-chart for every single program.. I ask her why, and she says that when we'll be writing more complex programs, flow-charts will help a lot.. but I don't see it.. I wrote loads of complex programs and games in C++, NEVER used any flow-charts.. Design yes.. but no flowcharts.. Your opinion?

  2. #2
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    I'm currently writing a design document that will end up well over a hundred pages. Therefore, I have no sympathy for you. Sorry.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  3. #3
    Registered User LogicError's Avatar
    Join Date
    Aug 2003
    Location
    г. Магнитогорск
    Posts
    76
    I have nothing against design documents.. But I'm talking about flow-charts of a program.. What if the programs is like over 10,000 lines.. how do I draw the flow-chart and why do I need it.. Then what if I want to change some code?

  4. #4
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    > why do I need it..

    When you write a program, consider what someone else will think when they try and maintain it. With very large programs, it's a lot easier to determine what's going on if you've got a general idea already.

    > Then what if I want to change some code?

    If the design of the code changes so fundamentally, update the flow chart.

  5. #5
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    For large programs, your flowchart should have a high-level viewpoint, probably only depicting how various modules interact.

    You don't need it here and now while you're programming something that you designed, programmed and tested. But other people will need all the help they can get to understand your program in the future when it's their job to maintain and extend your program. Heck, even you probably won't understand your own code a few months from now.

    Furthermore, it's often the case that in professional situations, the designers, coders and testers are all different people.

    As for how changes in your code, there are at least two schools of thought on that. According to some software life cycles, the design should be etched in stone before coding is begun. According to others, the design and the code should influence each other until both reach a high level of quality. Then again, in business applications, you might very well find yourself programming a whole application based on an e-mail from your boss and a drawing on a whiteboard and then writing a whole design document after coding is complete. Not that that's ever happened to me *grumble, grumble* ...
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  6. #6
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    I used to hate flow-charting in college... I thought it was a complete waste of time, but for more complex programs, it helps you to visualize the flow of the parameters and understand what should be happening when.

    Where I work, documentation is almost a 4-letter word. We're so understaffed and no one collaborates on projects, so we all just write our own stuff and hope no one ever has to modify it. I do try to add a lot of comments to my code, especially if it is fairly complex. But I don't honestly have time to sit here and flow-chart everything and spell out all the details of my programs. Right now I have at least 7 major projects going on at once, so my time is precious (which is why I'm sitting here responding to a thread on a board that is meant to help people with a language I don't use at work... HAHA ..... ).

  7. #7
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Ober, are you sure you aren't working in Hannover, Germany ? Your work description seems vaguely familiar.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  8. #8
    you could always drop the class if you hate flowcharting so much ....
    DrakkenKorin

    Get off my Intarweb!!!!

  9. #9
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    Quote Originally Posted by nvoigt
    Ober, are you sure you aren't working in Hannover, Germany ? Your work description seems vaguely familiar.
    Hmm.... does Volvo Trucks have a plant in Germany? (actually, I think we do )

  10. #10
    Registered User
    Join Date
    Aug 2003
    Posts
    470
    m on first course in College.. We're studying VB.. Our IT teacher makes us draw a flow-chart for every single program.. I ask her why, and she says that when we'll be writing more complex programs, flow-charts will help a lot.. but I don't see it.. I wrote loads of complex programs and games in C++, NEVER used any flow-charts.. Design yes.. but no flowcharts.. Your opinion?
    For requirement gathering, flow charts(or activity diagrams) can be used, especially if there's a lot of conditions. But usually English is just fine. And you even have a few benefits because English forces you to use concepts whereas the flow chart doesn't. For design, you could use flow charts maybe by showing the actual function calls or perhaps showing the inner workings of a function.


    I have nothing against design documents.. But I'm talking about flow-charts of a program.. What if the programs is like over 10,000 lines.. how do I draw the flow-chart and why do I need it.. Then what if I want to change some code?
    You wouldn't use a flow chart of the entire program. Maybe each scenario through the program could be flow charted.

  11. #11
    Bob Dole for '08 B0bDole's Avatar
    Join Date
    Sep 2004
    Posts
    618
    I love UML class diagrams, especially for Java, by the time I'm done designing all I have to do is code in functionality.
    Hmm

  12. #12
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986
    What flow charts are we talking about? The stupid kind where you have a box for each function, then a line going to a diamond for an 'if' statement, then a circle as a 'for' loop? Or the useful kind where you have a box for a class or module and specify how they interact?

  13. #13
    Registered User
    Join Date
    Aug 2003
    Posts
    470
    What flow charts are we talking about? The stupid kind where you have a box for each function, then a line going to a diamond for an 'if' statement, then a circle as a 'for' loop?
    This kind is a flow chart, though the each box doesn't necessarily have to be a function.

    Or the useful kind where you have a box for a class or module and specify how they interact?
    I don't think you mean a flow chart here. Maybe a sequence or object diagram.

  14. #14
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986
    Correct, I guess thats not a flow chart.

    In that case no, flow charts are stupid. If something is so complex you need a flow chart to understand it, you haven't broken it down enough.

  15. #15
    Registered User LogicError's Avatar
    Join Date
    Aug 2003
    Location
    г. Магнитогорск
    Posts
    76
    Hmm.. talking about complex.. Here's the task: A guy gets into a building.. it has N floors with 3 flats on each floor.. The lift can stop only on odd floors.. What floor does the lift "deliver" the guy to if he wants to get to flat number X? .. So I wrote the program.. Showed my teacher my coding style (I didnt know a function in vb that would convert 1.01 to 2 so i wrote one myself..) .. she looked at my code and said.. "Oooh.. draw a flow chart please.. I don't understand what's going on" ... Unbelievable.. complex....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program flow
    By Ducky in forum C++ Programming
    Replies: 4
    Last Post: 04-20-2009, 08:27 AM
  2. Simple C Program with Flow Statements
    By rory-uk in forum C Programming
    Replies: 16
    Last Post: 02-06-2008, 01:12 PM
  3. Program flow
    By Ducky in forum C++ Programming
    Replies: 22
    Last Post: 01-09-2008, 11:18 AM
  4. diagrams \ flow charts
    By rip1968 in forum C++ Programming
    Replies: 2
    Last Post: 07-23-2002, 03:49 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM