The Foundation of Well-Written Code: Structure | The Odyssey Online
Start writing a post
Lifestyle

The Foundation of Well-Written Code: Structure

An examination of how programming languages are similar to verbal language, how code is inherently structured through programming paradigms, and how organized (structured) code is beneficial.

21
The Foundation of Well-Written Code: Structure
Hind SCC

Learning code, as the stereotypical saying goes, is a lot like learning a foreign language. Programming languages have developed over time like spoken ones do and while the goal of spoken languages is to communicate verbally with other human beings, the objective of code is to program instructions. There are hundreds of programming languages, some not used anymore, some highly developed over time, that are so similar and yet so different from each other. Some of the languages are extremely extensive (C#, C++, Java, Python, etc.), whereas others were made just to have fun, known as esoteric languages (Whitespace, INTERCAL, Piet, AAAAAAAAAAAAAA!!!!, etc.). Each language contains its own set of terms and rules, however the structure of the code is the most essential part of making it work.


A way to organize code is through the use of UML. UML (Unified Modeling Language) is used to visualize the design of a system. It has various types of diagrams that can show the structure or behavior of the system. The main diagram for object-oriented programming is the class diagram. A class box represents three compartments: the top is the class name, the middle is the class attributes (objects), and the bottom is the class methods. UML uses different arrows and lines to show relationships between classes, such as if a class inherits another or if a class is dependent on another.

Many programmers working with object-oriented programming begin not with actual code, but a UML (or other) design in order to organize their code and view the overall picture of what is required to code in each class and how to connect classes. This is essential in group projects where different programmers can work on different classes that rely on each other due to knowing how their classes interact and how the different objects and methods are called.

UML is not used solely for object-oriented programming. There are various other diagrams such as the component diagram, which shows how components are wired together, the activity diagram, which shows the flow of different actions step-by-step, and the sequence diagram, which shows how objects are ordered and how they interact with each other. UML can be used by many, if not all programming languages, and it is even used outside of code (patient healthcare systems, transportation, defense, etc.) as it is meant to be general purpose.



Report this Content
This article has not been reviewed by Odyssey HQ and solely reflects the ideas and opinions of the creator.
Entertainment

Every Girl Needs To Listen To 'She Used To Be Mine' By Sara Bareilles

These powerful lyrics remind us how much good is inside each of us and that sometimes we are too blinded by our imperfections to see the other side of the coin, to see all of that good.

618304
Every Girl Needs To Listen To 'She Used To Be Mine' By Sara Bareilles

The song was sent to me late in the middle of the night. I was still awake enough to plug in my headphones and listen to it immediately. I always did this when my best friend sent me songs, never wasting a moment. She had sent a message with this one too, telling me it reminded her so much of both of us and what we have each been through in the past couple of months.

Keep Reading...Show less
Zodiac wheel with signs and symbols surrounding a central sun against a starry sky.

What's your sign? It's one of the first questions some of us are asked when approached by someone in a bar, at a party or even when having lunch with some of our friends. Astrology, for centuries, has been one of the largest phenomenons out there. There's a reason why many magazines and newspapers have a horoscope page, and there's also a reason why almost every bookstore or library has a section dedicated completely to astrology. Many of us could just be curious about why some of us act differently than others and whom we will get along with best, and others may just want to see if their sign does, in fact, match their personality.

Keep Reading...Show less
Entertainment

20 Song Lyrics To Put A Spring Into Your Instagram Captions

"On an island in the sun, We'll be playing and having fun"

510416
Person in front of neon musical instruments; glowing red and white lights.
Photo by Spencer Imbrock on Unsplash

Whenever I post a picture to Instagram, it takes me so long to come up with a caption. I want to be funny, clever, cute and direct all at the same time. It can be frustrating! So I just look for some online. I really like to find a song lyric that goes with my picture, I just feel like it gives the picture a certain vibe.

Here's a list of song lyrics that can go with any picture you want to post!

Keep Reading...Show less
Chalk drawing of scales weighing "good" and "bad" on a blackboard.
WP content

Being a good person does not depend on your religion or status in life, your race or skin color, political views or culture. It depends on how good you treat others.

We are all born to do something great. Whether that be to grow up and become a doctor and save the lives of thousands of people, run a marathon, win the Noble Peace Prize, or be the greatest mother or father for your own future children one day. Regardless, we are all born with a purpose. But in between birth and death lies a path that life paves for us; a path that we must fill with something that gives our lives meaning.

Keep Reading...Show less

Subscribe to Our Newsletter

Facebook Comments