#object oriented programming
Explore tagged Tumblr posts
deletedg1rl · 2 years ago
Text
she object on my programming till i am oriented
191 notes · View notes
python-programming-language · 3 months ago
Text
Object-oriented Programming for short ...
youtube
Post #158: YouTube, Socratica, OOP in Python, 2025
6 notes · View notes
small-basic-programming · 2 years ago
Text
Post #176: Opinion poll by Small Basic Programming on Tumblr, Question: Which object-oriented programming language do you prefer to program with?, 2023.
74 notes · View notes
snowcodes · 2 years ago
Text
Question regarding languages: Python & C#
Is it possible to learn both languages at the same time? Or will it be easy to get confused between the two? I thought I would come to the lovely codeblr people who have a vast amount of experience for advice. C# is something I *want* to learn, but I *have* to learn Python for for my course that starts in January...I just want to see if it is plausible to learn both at the same time or if it will mess up my learning if I try and learn both. I'd love to hear about your experiences and what your first languages were when you first started out in the world of coding!!
48 notes · View notes
codingquill · 2 years ago
Text
The concept of object oriented programming explained
Object-oriented programming is a fundamental concept present in numerous programming languages such as C++, Java, JavaScript, and more. It becomes straightforward once you truly grasp it, and that's precisely what this post aims to help you achieve. So, stop your scrolling for a second and delve into this post for a thorough and clear explanation.
Tumblr media
Understanding the Term "Object-Oriented"
To grasp OOP, let's begin by explaining the name itself: "Object-Oriented." This term signifies that OOP revolves around entities known as "objects."
What Exactly Is an Object?
An object in OOP is any entity that possesses both state and behavior. Consider a dog as an example: it has states such as color, name, and breed, while its behaviors encompass actions like wagging the tail, barking, and eating.
The reason we introduce the concept of objects in programming is to effectively represent real-world entities, a task that cannot be accomplished with conventional variables or arrays.
Classes: Abstract Forms of Objects
Now, what about classes? A class is essentially the abstract form of an object. If we take the example of a "dog," the object "Mydog" is a concrete instance, while the class "dog" represents dogs in a more general sense. Think of a class as a blueprint or template from which you can create individual objects.
Four Pillars of Object-Oriented Programming
Now that we've established the fundamentals of objects and classes. OOP is built upon four key principles:
Inheritance: Inheritance occurs when one object inherits all the properties and behaviors of a parent object. It promotes code reusability and facilitates runtime polymorphism.
Polymorphism: Polymorphism entails performing a single task in multiple ways. For instance, it can involve presenting information differently to customers or implementing different shapes like triangles or rectangles.
Abstraction: Abstraction is about concealing internal details while exposing functionality. Consider a phone call; we don't need to understand the intricate inner workings.
Encapsulation: Encapsulation involves bundling code and data into a single unit. Just like a capsule contains various medicines . In a fully encapsulated class (e.g., a Java bean), all data members are private, ensuring data integrity and controlled access.
I remember finding these images that explained these concepts using the 'Squid Game' series, and they are just perfect. So, I'm sharing them here and giving all credit to their owner :
Polymorphism , Inheritance , Encapsulation
44 notes · View notes
mimicschest · 7 months ago
Text
The World of Forms and Object Oriented Programming
I cant get over how cool Object Oriented Programming is. Really, its just a design philosophy for coding. But the roots of that idea run deep. As in Plato's World of Forms deep.
When you are defining an Object in OOP, you define its defaults, its required variables and functions. You are essentially teaching the computer, using a programming language, the Platonic Ideal of that object within the contexts of the particular program. This closely mirrors how in the World of Forms model, Ideal Forms are passed from person to person, especially during childhood. When a parent teaches by association and words, you build a sort of association between this Ideal Object in your head to what are the essential qualities for that category of Object.
In OOP, you apply this concept to a computer. You create a database of Ideal Objects, and when you assign them to a variable, you then tack on all the ways that particular instance differs. You are literally teaching an Artificial Mind using a model of cognition and of the world that is over 2k years old.
And it ~Works~
That. Is. So. Cool.
5 notes · View notes
ginniehazel · 9 months ago
Text
251 days till ultimatum.
I spent some time tonight doing a class about 'Object Oriented Programming' and I don't think I quite get it yet. I've got a project to do, so that should help.
I'm probably not going to finish this month's game jam, just like I failed to finish for the last one, but since I'm focusing more on learning I don't feel too bad. It's mostly just getting me to try new things and practice.
3 notes · View notes
chaussurre · 2 years ago
Text
Sorry for "it's a great paradigm, it avoid code reuse" I meant to say it allows code reuse.
26 notes · View notes
snaildotexe · 2 years ago
Text
Software Technical Interview Review List
Data Structures
Arrays (and Java List vs ArrayList)
String
Stack
Queue
LinkedList
Algorithms
Sorting (Bubblesort, Mergesort, Quicksort)
Recursion & Backtracking
Linear and Binary Search
String/Array algos
Tree traversal
Dynamic Programming
Graph algos (DFS, BFS, Dijksta's and Kruskals)
OOP fundamentals
Polymorphism
Inheritance
Encapsulation
Data abstraction
SOLID and GRASP
Explanations & example questions:
Strings and Arrays [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ]
Stacks and Queues [ 1 | 2 ]
LinkedList [ 1 | 2 ]
Sorting & searching [ 1 | 2 | 3 | 4 | 5 | 6 | 7 ]
Recursion and Backtracking [ 1 | 2 | 3 | 4 ]
Dynamic Programming [ 1 | 2 | 3 | 4]
Graphs [ 1 | 2 | 3 ]
Tree [ 1 | 2 ]
General DS&A info and questions [ 1 | 2 | 3 | 4 | 5 ]
OOP review & questions [ 1 | 2 | 3 ]
20 notes · View notes
Text
Should I actually make meaningful posts? Like maybe a few series of computer science related topics?
I would have to contemplate format, but I would take suggestions for topics, try and compile learning resources, subtopics to learn and practice problems
4 notes · View notes
online-training-usa · 1 year ago
Text
Understanding Object-Oriented Programming and OOPs Concepts in Java
Object-oriented programming (OOP) is a paradigm that has revolutionized software development by organizing code around the concept of objects. Java, a widely used programming language, embraces the principles of OOP to provide a robust and flexible platform for developing scalable and maintainable applications. In this article, we will delve into the fundamental concepts of Object-Oriented Programming and explore how they are implemented in Java.
Tumblr media
Object-Oriented Programming:
At its core, Object-Oriented Programming is centered on the idea of encapsulating data and behavior into objects. An object is a self-contained unit that represents a real-world entity, combining data and the operations that can be performed on that data. This approach enhances code modularity, and reusability, and makes it easier to understand and maintain.
Four Pillars of Object-Oriented Programming:
Encapsulation: Encapsulation involves bundling data (attributes) and methods (functions) that operate on the data within a single unit, i.e., an object. This encapsulation shields the internal implementation details from the outside world, promoting information hiding and reducing complexity.
Abstraction: Abstraction is the process of simplifying complex systems by modeling classes based on essential properties. In Java, abstraction is achieved through abstract classes and interfaces. Abstract classes define common characteristics for a group of related classes, while interfaces declare a set of methods that must be implemented by the classes that implement the interface.
Inheritance: Inheritance is a mechanism that allows a new class (subclass or derived class) to inherit properties and behaviors of an existing class (superclass or base class). This promotes code reuse and establishes a hierarchy, facilitating the creation of specialized classes while maintaining a common base.
Polymorphism: Polymorphism allows objects of different types to be treated as objects of a common type. This is achieved through method overloading and method overriding. Method overloading involves defining multiple methods with the same name but different parameters within a class, while method overriding allows a subclass to provide a specific implementation of a method that is already defined in its superclass.
Java Implementation of OOP Concepts:
Classes and Objects: In Java, a class is a blueprint for creating objects. It defines the attributes and methods that the objects of the class will have. Objects are instances of classes, and each object has its own set of attributes and methods. Classes in Java encapsulate data and behavior, fostering the principles of encapsulation and abstraction.
Abstraction in Java: Abstraction in Java is achieved through abstract classes and interfaces. Abstract classes can have abstract methods (methods without a body) that must be implemented by their subclasses. Interfaces declare a set of methods that must be implemented by any class that implements the interface, promoting a higher level of abstraction.
Inheritance in Java: Java supports single and multiple inheritances through classes and interfaces. Subclasses in Java can inherit attributes and methods from a superclass using the extends keyword for classes and the implements keyword for interfaces. Inheritance enhances code reuse and allows the creation of specialized classes while maintaining a common base.
Polymorphism in Java: Polymorphism in Java is manifested through method overloading and overriding. Method overloading allows a class to define multiple methods with the same name but different parameters. Method overriding occurs when a subclass provides a specific implementation for a method that is already defined in its superclass. This enables the use of a common interface for different types of objects.
Final Thoughts:
Object-oriented programming and its concepts form the foundation of modern software development. Java, with its robust support for OOP, empowers developers to create scalable, modular, and maintainable applications. Understanding the principles of encapsulation, abstraction, inheritance, and polymorphism is crucial for harnessing the full potential of OOPs concepts in Java. As you continue your journey in software development, a solid grasp of these concepts will be invaluable in designing efficient and effective solutions.
3 notes · View notes
grgothoughts · 2 years ago
Text
In my previous post, I talked about a MSVC specific feature where one struct definition could be imported into another struct simply by declaring the imported struct in the other struct.
I discovered this behavior on MSVC because I am working on a way that is user-friendly to code in a more object oriented pattern in C.
I was thinking about class inheritance and how you can access directly to all the super class' members in C++ and I thought that maybe if I was to import a struct into another one I'd get a similar result in C. On Visual Studio it compiles just fine, but the moment you build with a other compiler, it just doesn't work; the compiler doesn't find the members imported from another struct.
I think it's a nice feature to have in places where you want to take a more object oriented approch but want to keep the freedom C gives you.
My approch to OOP in C is to split functionality and state. In the header file, the implementation struct is the struct containing the function pointers the user is expected to use, while the object struct is the states and data the object will hold. Exemple of adder.h:
typedef struct Adder {
int a, b;
} Adder;
const struct IAdder {
void(*ctor)(Adder* this, int a, int b);
int(*result)(Adder* this);
} IAdder;
There should be only one implementation struct per "class" as this is the only instance that should contain the function pointers for class Adder. It should not be modified at anytime during runtime, and so the unique instance is const. Exemple of adder.c:
#include "adder.h"
static void ctor(Adder* this, int a, int b) {
this->a = a;
this->b = b;
}
static int result(Adder* this) {
return this->a + this->b;
}
//We define the unique const instance
//of the implementation struct:
extern const struct IAdder IAdder = {
.ctor = ctor,
.result = result
};
And to use our adder class in main.c:
#include "adder.h"
#include <stdio.h>
int main(int argc, char** argv) {
Adder a = {0};
IAdder.ctor(&a, 3, 5);
int result = IAdder.result(&a);
printf("%i", result);
return 0;
}
9 notes · View notes
python-programming-language · 4 months ago
Text
Udemy, Python, OOP For Beginners And More ...
Post #152: Udemy, Danny Adams, Python OOP, Object-Oriented Programming, From Beginner To Pro, 2024.
2 notes · View notes
small-basic-programming · 1 year ago
Text
The Object-Oriented Syntax Of Small Basic
Object - Method - Argument
Tumblr media
Small Basic and its object-oriented Syntax
GraphicsWindow is an object built into Small Basic that takes text input and sends text output to your screen. DrawText() is a method of the GraphicsWindow object. This method displays the data passed to it in the output window. When you use GraphicsWindow.DrawText(), you tell the the GraphicsWindow object to execute its DrawText method. This is known as <dot notation> because of the dot between the object and method. Dot notation is used to access an object's method and follows this format:
ObjectName.MethodName(Arguments)
In this example "Hello World!" is an argument to the DrawText() method. It tells the method exactly what you want to write.
< Marji & Price >
Post #194: The OOP-Syntax of Small Basic, 2024.
4 notes · View notes
vanilla-voyeur · 2 years ago
Text
Very amused every time someone discovers the ultimate way to do OOP in its truest, most polymorphic, most object-oriented form and its just immutable classes with public instance variables and no methods and no inheritance being transformed through singleton classes with no instance variables and one side-effect-free method, potentially taking a function as a parameter or returning another single method class. Brother you just reinvented functional programming.
4 notes · View notes
0xfc963f18dc21 · 2 years ago
Text
You know, OOP has the Visitor pattern where you define a separate object with logic for a family of classes that resolve down into one final result.
Functional programming uses the concept of catamorphisms from category theory to do the same (as catamorphisms are the generalisation of processes that fold together multiple values into one final result).
... Visitors are an encoding of catamorphisms.
As much as people say these two paradigms are separate, they can honestly live together perfectly well, as Visitors allow for some functionality that cannot be solved by plain old pattern matching, especially with maintaining return type information when folding generic structures or double dispatch.
One could mix both to obtain a really flexible and extensible folding process for complex class hierarchies.
2 notes · View notes