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.
Entertainment

15 Times Michael Scott's Life Was Worse Than Your Life

Because have you ever had to endure grilling your foot on a George Foreman?

385
Michael Scott
NBC

Most of the time, the world's (self-proclaimed) greatest boss is just that, the greatest. I mean, come on, he's Michael Freakin' Scott after all! But every once in a while, his life hits a bit of a speed bump. (or he actually hits Meredith...) So if you personally are struggling through a hard time, you know what they say: misery loves company! Here are 15 times Michael Scott's life was worse than your life:

Keep Reading...Show less
Featured

12 Midnight NYE: Fun Ideas!

This isn't just for the single Pringles out there either, folks

15317
Friends celebrating the New Years!
StableDiffusion

When the clock strikes twelve midnight on New Year's Eve, do you ever find yourself lost regarding what to do during that big moment? It's a very important moment. It is the first moment of the New Year, doesn't it seem like you should be doing something grand, something meaningful, something spontaneous? Sure, many decide to spend the moment on the lips of another, but what good is that? Take a look at these other suggestions on how to ring in the New Year that are much more spectacular and exciting than a simple little kiss.

Keep Reading...Show less
piano
Digital Trends

I am very serious about the Christmas season. It's one of my favorite things, and I love it all from gift-giving to baking to the decorations, but I especially love Christmas music. Here are 11 songs you should consider adding to your Christmas playlists.

Keep Reading...Show less
campus
CampusExplorer

New year, new semester, not the same old thing. This semester will be a semester to redeem all the mistakes made in the previous five months.

1. I will wake up (sorta) on time for class.

Let's face it, last semester you woke up with enough time to brush your teeth and get to class and even then you were about 10 minutes late and rollin' in with some pretty unfortunate bed head. This semester we will set our alarms, wake up with time to get ready, and get to class on time!

Keep Reading...Show less
Student Life

The 5 Painfully True Stages Of Camping Out At The Library

For those long nights that turn into mornings when the struggle is real.

3129
woman reading a book while sitting on black leather 3-seat couch
Photo by Seven Shooter on Unsplash

And so it begins.

1. Walk in motivated and ready to rock

Camping out at the library is not for the faint of heart. You need to go in as a warrior. You usually have brought supplies (laptop, chargers, and textbooks) and sustenance (water, snacks, and blanket/sweatpants) since the battle will be for an undetermined length of time. Perhaps it is one assignment or perhaps it's four. You are motivated and prepared; you don’t doubt the assignment(s) will take time, but you know it couldn’t be that long.

Keep Reading...Show less

Subscribe to Our Newsletter

Facebook Comments