A Visual Guide to Understanding Programming Logic

Noran Saber Abdelfattah
8 min readMay 27, 2023

--

I.Inroduction

A flowchart is a diagram or visual representation that depicts the sequence of stages or events in a process or program. It employs a variety of forms and symbols to represent distinct components and decisions in the flow of the program. Flowcharts are often used in programming to assist developers in comprehending, designing, and communicating the logical flow of their code.

Consider a difficult task that must be broken down into smaller parts. A flowchart visualizes and organizes these stages in a clear and ordered manner. It serves as a road map, directing you through the program’s execution from beginning to end.

Flowcharts display several components with basic forms such as rectangles, diamonds, and arrows. Rectangles indicate activities or processes, diamonds represent decision points or conditional expressions, and arrows represent the program’s flow or direction. You may develop a graphical depiction of how the program should behave by connecting these shapes.

The fundamental advantage of using flowcharts is that they make the logic of the program easier to comprehend and analyze. They enable you to detect potential mistakes, bottlenecks, or places for development. Flowcharts may also be used as a communication tool, allowing engineers to explain their code to others and interact with team members.

Flowcharts are a visual approach to understanding the general structure and flow of a program, even if you’re new to programming. They aid in the breakdown of difficult processes into manageable phases, making the intended functionality easier to follow and accomplish. Understanding and developing flowcharts will become a crucial skill in building efficient and well-organized code as you progress in programming.

What is flowchart?

A flowchart is similar to a map in that it illustrates the stages to be taken in a process or program. It uses images and symbols to represent the many acts and decisions that must be taken. It assists individuals in comprehending and following the sequence of steps in a clear and organized manner. It’s similar to sketching a picture of what has to be done to help visualize how things should go.

Let’s take a simple example

Let’s say you want to take a road trip to a new city. Before you go, you should plan your itinerary and decide on your stops. You may use a flowchart to aid you with this.

Each step in the flowchart is represented by a symbol or form. A rectangle, for example, may symbolize “start,” a diamond shape could indicate a choice point, such as “choose the route,” and a rounded rectangle could represent an activity, such as “stop for lunch.”

You begin with the “Start” sign and proceed by following the arrows that link the symbols based on the decisions you must make. If you have two route possibilities, for example, you may draw arrows from the decision diamond to depict each alternative path. If you pick Route A, you go to the next stage by following the “Route A” arrow. If you select Route B, you must take the arrow labeled “Route B.”

The flowchart will continue to lead you through the many options and activities until you arrive at your final destination, which is indicated by a “End” sign.

The flowchart provides a visual depiction of the full road trip itinerary. It assists you in understanding the order of events and ensures you don’t miss anything vital, much as following a map ensures you get at your goal quickly.

In essence, a flowchart is a visual tool that assists you in planning and understanding processes or programs by breaking them down into simple phases using symbols and arrows. It’s similar to creating a road map for your tasks or operations, making complicated procedures easier to understand and traverse.

You can think about it like the map to your code world to know what is the next step to take and to have a clear picture on what you should do

Why flowchart ?

Flowcharts are diagrams that depict the stages required to solve a problem or build a program. A flowchart, like a map, assists you in understanding and planning how to make your program operate. It depicts the sequence of activities and decisions using simple symbols and arrows. Flowcharts simplify programming by providing a clear picture of what to accomplish and how everything fits together.

Flowcharts can help with issue resolution and troubleshooting. They enable programmers to spot possible problems or bottlenecks in a program’s logic, making it easier to analyze and debug code.

Logic Validation: Flowcharts allow logic to be validated prior to implementation. Before creating the actual code, programmers can detect weaknesses or holes in their reasoning and enhance their algorithms by graphically mapping out the program flow.

Documentation and Upkeep: Flowcharts serve as program documentation, offering a visual reference for future maintenance or upgrades. They make it simpler for programmers to reread and understand their own code, as well as for new developers to join and grasp current programs.

Flowcharts serve as a global language for communication among programmers, project managers, stakeholders, and other team members. By presenting a clear and succinct picture of the program’s flow, they help bridge the gap between technical and non-technical users.

Flowcharts are useful in the planning and design phases of programming. They enable programmers to sketch out the structure and logic of their programs, allowing them to organize their ideas and make educated judgments regarding the architecture of the project.

Educational Tool: Flowcharts are commonly used in the classroom to teach programming principles. They simplify difficult ideas and methods, making them more approachable and clear to novices.

II. Flowchart Elements

a. Start and End symbols

The primary elements used in flowcharts to denote the starting and finish points of a process or program are start and end symbols. They act as markers that define the flowchart’s bounds.

The start sign is a shape that is typically labelled with the phrase “Start” or a similar command. It denotes the start of the flowchart and the commencement of program execution.

The end sign, on the other hand, is a shape that is typically labelled with the words “End” or “Stop.” It represents the flowchart’s end point and the completion of the procedure or program.

Consider the start sign to be the beginning of a journey, and the end symbol to be the endpoint or finish line. They assist in providing a clear framework to the flowchart, helping you to understand where the process begins and concludes.

b. Process symbols

A flowchart’s process symbols reflect particular activities or tasks that must be completed as part of a process or programe. They depict the sequential execution of actions or processes to achieve a certain objective.

Rectangular boxes with rounded corners are commonly used to illustrate process symbols. A brief statement or label inside the box outlines the action to be executed.

Consider the following flowchart for brewing a cup of tea:

Start: This is the first step in the flowchart.

Fill the kettle with water: The process of filling the kettle with water is represented by this phase.

Boil the water: The process of heating the water in the kettle until it reaches boiling point is represented by this stage.

Fill a teapot with tea leaves: This step shows the process of filling a teapot with tea leaves.

Pour boiling water into the teapot: This step illustrates the process of pouring the kettle’s boiled water into the teapot.

Allow the tea to steep: This step symbolises the process of allowing the tea leaves to steep in hot water in order for the flavour to be released.

Pour tea into a cup: The procedure of pouring the brewed tea from the teapot into a cup is represented by this step.

End: This is the flowchart’s conclusion, indicating that the procedure has been completed.

Each of these phases is represented by a process symbol, which is graphically displayed in the flowchart as rectangular boxes. They assist in breaking down the whole process into smaller, more manageable acts, making the sequence of steps necessary to reach the intended goal easier to grasp and follow.

c. Decision symbols

A flowchart’s decision symbols identify locations where a choice must be taken or a condition must be evaluated. They aid in controlling the flow of the program based on various scenarios or possibilities.

Diamond-shaped boxes are commonly used to depict decision symbols. A question or condition is typed inside the box, and arrows are used to represent the alternative courses dependent on the decision’s conclusion.

d. Input/output symbolsis

It represents what information or data you have and enter, and what the data or result you will get after processing this data. so for example if you have a program sum two number the input is the first number and the second number and the output is the result of the summation.

e. Connector symbols

In a flowchart, connector symbols are used to connect distinct elements of the flowchart and illustrate the flow or direction of the program. They aid in preserving the flowchart’s logical sequence and organisation.

Three connection symbols are widely used:

1- The arrow sign is used to show the flow or direction of the program from one step to the next. It depicts the execution of the program from one sign to the next.

2- A basic straight line: is used as a connector symbol to connect distinct sections of the flowchart. It denotes a continuation or transition from one stage to the next.

3- Off-page connector: This symbol is used when the flowchart is longer than one page. It shows that the flow continues on the next page and connects the pertinent components.

III. Let’s take an example

Addition program

Start: The program start.
Input Number 1: Request that the user input the first number.
Input Number 2: Request that the user enter the second number.
Number Addition: Add the two numbers together.
Show outcome: Show the outcome of the addition.
The program has come to an end.

If you want a tool for making flowcharts

Link: https://cloud.smartdraw.com/editor.aspx?templateId=da34e096-b9cb-4d56-a0ce-d9bdef138714&flags=128

https://www.draw.io/

IV. Conclusion

Finally, flowcharts are useful visual representations that aid in comprehending the flow of a process or algorithm. They portray complicated systems in a straightforward and organized manner, making them easier to grasp and analyze. Flowcharts have a number of advantages, including better communication, mistake identification, and process optimization's. Flowcharts promote uniformity and clarity across diverse programming projects by employing standardized symbols and standards. Flowcharting tools, which range from free web tools to expensive software with comprehensive capabilities, make it easy to design, modify, and distribute flowcharts. Whether you are a novice or a seasoned programmer, adding flowcharts into your programming process may significantly improve your comprehension and productivity.

--

--