Learning to Code: Functional, OOP, and IDEs

The hardest part of starting any task is learning the niche vocabulary. Today I will explain some of the vocabulary of programming and in doing so, will provide to the knowledge to begin learning on your own. In today’s post I will explain the following words: Object-Oriented Programming, Functional Programming, and Integrated Development Environment.

Object Oriented Programming

Object Oriented Programming (wiki page here) is a paradigm that emphasizes creating programs that utilizes objects. These objects have code associated with them, which is grouped into things called functions (if you don’t know what those are click here to read my article on those). These functions control the behavior of the objects they are tied to. Objects in OOP can be created by using the name of the class in a function (there are many ways to create an object in an OOP focused language and the given example is just one method). When this occurs, an object is created with all the properties and functions that are listed in the class. Consider this hypothetical scenario; a dog that weighs 15lbs and can bark. In code, you would create a ‘dog’ class and, in this class, give the objects of dog a property ‘weight’ and a function ‘bark’. The property ‘weight’ should not be permanent, dogs can lose or gain weight, this means that weight should not be declared as a constant integer (one of the many types of numbers that can be implicitly or explicitly declared). The function bark should take a parameter (maybe weight) that determines the pitch of the bark. This is how OOP works; you create objects that exist within classes which associate objects with data and functions. Below is an example of the dog class in Java.

public class Dog{
    int weight = 0;
    public dog(int givenWeight){
        weight = givenWeight;
    }
    public int bark(int weight){
        int returnValue = 1; 
        //make bark pitch based on weight
        return returnValue;
    }
}

Below is the code to run the dog class from above.

Dog silkyTerrier = new Dog(10);    //10lbs
silkyTerrier.bark(silkyTerrier.weight);
Functional Programming

Functional programming (wiki page here) works by creating functions in which function definitions are trees of expression that map values to values (Wikipedia’s rather lack luster definition). This is a fancy way of saying that functions take some value and map it to something. All actions in Functional centric languages are taken in functions. Think of it like this: you break each action that your program takes into little tasks, each of these tasks is given a name, inputs, and outputs. You then create as many functions as there are little tasks to accomplish. This breakdown of the workflow allows for easier planning on the part of the programmer. OOP allows the programmer to focus on things like behavior and relationship creation; Functional allows a programmer to create a workflow of actions in the program.

It sure would be nice if we could combine the aspects of Functional and OOP to create a super language of sorts. Well do not fear! Most modern languages and up-to-date languages contain both paradigms (mind you, there are times where we want the languages to be solely Functional or solely OO, so not all languages can do both paradigms). As an example of some of the most popular programming languages: Java, C, C++, C#, and Python support OOP and Functional.

Integrated Development Environment

Integrated Development Environment is a term that refers to any text editor that includes features specifically tailored to enhancing code editing. Features such as: text prediction, library support, program run features, debugging support, and runtime simulation. These features allow for the programmer to create code efficiently and hopefully, bug free. Many IDEs include support for more personal touches like color pallets that change the color of the IDE, syntax highlighting, and icons. Color changing is particularly helpful as the default color of the IDE is white with black text, this color combo is generally hard to look at for long hours due to the bright light. A dark mode helps with using the device for the long periods of debugging required for working on large projects.

If you’re interested in more work from this vocabulary series, click here to see the full list. If you’re interested in seeing programming examples, click here. If you want to read stories from the university, click here. Lastly, if you want to subscribe to my newsletter or throw me some spare change, check the links below.

Leave a Reply

Your email address will not be published. Required fields are marked *