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.

15
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.
success
Degrassi.Wikia

Being a college student is one of the most difficult task known to man. Being able to balance your school life, work life and even a social life is a task of greatness. Here's an ode to some of the small victories that mean a lot to us college students.

Keep Reading...Show less
Lifestyle

6 Signs You're A Workaholic

Becuase of all things to be addicted to, you're addicted to making money.

156
workaholic
kaboompics

After turning 16, our parents start to push us to get a job and take on some responsibility. We start to make our own money in order to fund the fun we intend on having throughout the year. But what happens when you've officially become so obsessed with making money that you can't even remember the last day you had off? You, my friend, have become a workaholic. Being a workaholic can be both good and bad. It shows dedication to your job and the desire to save money. It also shows that you don't have a great work-life balance. Here are the signs of becoming a workaholic.

Keep Reading...Show less
10 Life Lessons For The Camp Counselor
madison miller

Spending five, 10 or even more weeks in the outdoors leading elementary to high school aged kids for a week at a time is unique, to say the least. You see things in yourself you didn't think were there and experience emotions you can not explain. What you learn is valuable for more than just camp, but extends to life after the summer.

Keep Reading...Show less
Student Life

Things You Can Get Away With Now That You're At College

83% of my trends in college would have been shamed in high school.

1641
college life
Google Images

Transitioning from high school to college can be a stressful experience, especially if you're like me and hate change. Over the past two years I've realized there's many things I couldn't get away with in High School that are typically applauded in college.

1. Eat

Keep Reading...Show less
Blair Waldorf

Life is hard. You know what makes it even more tough? Living with chronic b*tch face (CBF). This condition is so debilitating that I have decided to chronicle the 10 things everyone who suffers from CBF experiences. Who better to help me than the queen of CBF herself, Blair Waldorf?

Keep Reading...Show less

Subscribe to Our Newsletter

Facebook Comments