Flow Charts

I recently used a flow chart to design a slightly complex algorithm. That's the first time that I've used a flow chart as a coding aid, and I found that having that visual representation to refer to made the coding very straightforward (probably because I didn't have to struggle with holding the entire algorithm in my brain at once).

It makes me wonder what other design tools/methods I've been missing out on by ignoring them all these years. Anyone have any favorites they'd recommend?
Some people write pseudo code in order to know what they need to code before coding it. Basically, they write the logic of the code so all they have to worry about is writing working code that follows the logic.

Personally though, I do like jumping right in without a flow chart or pseudo code!
Last edited on
closed account (z05DSL3A)
I used to work with the Rational Unified Process (RUP) that had heavy use of Unified Modeling Language (UML). I now just do informal sketches of various of the UML diagrams when needed.
https://en.wikipedia.org/wiki/Unified_Modeling_Language
This post has peaked some interested in my to finally start exploring design
tools. I think flowcharts are the nicest when it comes to designing a program
or visualizing an algorithm.

Since I do most of my work in the CLI, I figured a CLI tool would be good. I
have been mucking around with Graphviz and the DOT graph description language
for a few hours now.
https://www.graphviz.org/
https://www.graphviz.org/doc/info/lang.html

You make a file labeled with a gv or dot file extension and then you can feed
this file into a program called "dot", which will create a hierarchical layout
of a graph.


/* It even supports C styled comments! */
// C++ styled comments as well!

/* Create a directed graph called LinkedList */
digraph LinkedList {

  rankdir=LR
  node[shape=record]
  Node0 [ label=" { <info> data | <link> nextNode } " ]
  Node1 [ label=" { <info> data | <link> nextNode } " ]
  Node2 [ label=" { <info> data | <link> nextNode } " ]
  Node3 [ label=" { <info> data | <link> nextNode } " ]
  Node4 [ label=" { <info> data | <link> nextNode } " ]

  Node0:link -> Node1
  Node1:link -> Node2
  Node2:link -> Node3
  Node3:link -> Node4
  Node4:link -> nullptr

}


And then we can just turn the gv file into a jpg (or whatever supported file
type) by doing.


$ dot linkedLists.gv -Tjpg > linkedListsGraph.jpg


See the preview here:
https://imgur.com/a/NsFmvUP

It's a pretty neat tool. It has a similar feeling to writing in LaTeX.
@fiji885, not another language to learn, PLEASE! ;)

Seriously, Graphviz does look very helpful for graphically charting flow. You piqued my interest. :)
I've used UML in the past, to document design, although quite informally; I'm no expert on the intricacies of the language. Class diagrams and sequence diagrams have been the ones I've found most useful, and occasionally state diagrams too.

Enterprise Architect is the tool I've used to do this. I have no idea whether it's possible for individual developers to get it affordably.
Last edited on
Topic archived. No new replies allowed.