# Object-oriented programming (OOP)

Object-oriented programming (OOP) is a software development paradigm that organizes code around objects combining data and the functions that operate on it.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Understanding Mixin Classes in Python

DevFeed: [Understanding Mixin Classes in Python](<https://devfeed.tech/articles/understanding-mixin-classes-in-python-4372.md>)

Original publisher: [Read original article](<https://realpython.com/courses/understanding-mixin-classes-in-python/>)

Author: Real Python

Published: 2026-07-14T14:00:00Z

Content type: tutorial

Language: en

Sources: [Real Python](<https://devfeed.tech/sources/real-python.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [how-to](<https://devfeed.tech/tags/how-to.md>), [oop](<https://devfeed.tech/tags/oop.md>), [python](<https://devfeed.tech/tags/python.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [video](<https://devfeed.tech/tags/video.md>)

### AI overview

A video course on using Python mixin classes to share reusable behavior across classes without creating rigid inheritance hierarchies. It explains multiple inheritance, stateful mixins, method resolution order, and common design considerations.

### Source excerpt

Learn how to write reusable Python mixin classes, distinguish them from abstract base classes, and steer clear of common pitfalls.

## Inheritance and Composition in Python

DevFeed: [Inheritance and Composition in Python](<https://devfeed.tech/articles/how-to-oop-in-python-like-a-pro-38807.md>)

Original publisher: [Read original article](<https://thepalindrome.org/p/how-to-oop-in-python-like-a-pro>)

Author: Stephen Gruppetta

Published: 2026-05-30T06:49:08Z

Content type: tutorial

Language: en

Sources: [The Palindrome](<https://devfeed.tech/sources/the-palindrome.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Python](<https://devfeed.tech/topics/python.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>)

Tags: [how-to](<https://devfeed.tech/tags/how-to.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [oop](<https://devfeed.tech/tags/oop.md>), [python](<https://devfeed.tech/tags/python.md>)

### AI overview

A tutorial about inheritance and composition in Python.

### Source excerpt

Inheritance and composition

## Managing Multi Table Inserts With Room

DevFeed: [Managing Multi Table Inserts With Room](<https://devfeed.tech/articles/managing-multi-table-inserts-with-room-22825.md>)

Original publisher: [Read original article](<http://androidessence.com/multi-table-inserts/>)

Author: Adam McNeilly

Published: 2026-04-25T00:00:00Z

Content type: article

Language: en

Sources: [Android Essence](<https://devfeed.tech/sources/android-essence.md>)

Topics: [Database](<https://devfeed.tech/topics/database.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [database](<https://devfeed.tech/tags/database.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [oop](<https://devfeed.tech/tags/oop.md>)

### AI overview

This article explains how to handle multi-table inserts in Room when entities have nested dependencies. It first considers separate DAO interfaces and a wrapper class, then shows how interface inheritance can centralize insertion logic and let dependent DAOs reuse it.

### Source excerpt

A properly relational database may have a type that appears referenced multiple times. In my SpaceNerd playground app, that is the Country object. An Agency has a country, and an Agency is a dependency of a Launch, of a Space Station, and likely more types to come. How do I enforce that any time I insert an Agency, I also insert the Countries associated with it? That's what this blog post sets out to explore, and the answer is much simpler than I thought when I started.

## Object Oriented Programming - The Key Terms

DevFeed: [Object Oriented Programming - The Key Terms](<https://devfeed.tech/articles/object-oriented-programming-the-key-terms-34688.md>)

Original publisher: [Read original article](<https://newsletter.systemdesigncodex.com/p/object-oriented-programming-the-key>)

Author: Saurabh Dashora

Published: 2026-03-24T08:38:43Z

Content type: article

Language: en

Sources: [System Design Codex](<https://devfeed.tech/sources/system-design-codex.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [interface](<https://devfeed.tech/topics/interface.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [concepts](<https://devfeed.tech/tags/concepts.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [maintainability](<https://devfeed.tech/tags/maintainability.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [programming](<https://devfeed.tech/tags/programming.md>), [security](<https://devfeed.tech/tags/security.md>)

### AI overview

This tutorial introduces object-oriented programming through four principles: abstraction, encapsulation, inheritance, and polymorphism. It explains how abstraction hides implementation details, encapsulation controls access to data and methods, and inheritance supports reuse and hierarchical relationships. The supplied text begins its discussion of polymorphism but is truncated.

### Source excerpt

The essential concepts

## 12 OOP Concepts EVERY Developer Should Know

DevFeed: [12 OOP Concepts EVERY Developer Should Know](<https://devfeed.tech/articles/12-oop-concepts-every-developer-should-know-33559.md>)

Original publisher: [Read original article](<https://blog.algomaster.io/p/12-oop-concepts-every-developer-should-know>)

Author: Ashish Pratap Singh

Published: 2026-02-12T04:27:26Z

Content type: tutorial

Language: en

Sources: [AlgoMaster Newsletter](<https://devfeed.tech/sources/algomaster-newsletter.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [concepts](<https://devfeed.tech/tags/concepts.md>), [developer](<https://devfeed.tech/tags/developer.md>), [interface](<https://devfeed.tech/tags/interface.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [oop](<https://devfeed.tech/tags/oop.md>), [practical](<https://devfeed.tech/tags/practical.md>), [programming](<https://devfeed.tech/tags/programming.md>), [real-world](<https://devfeed.tech/tags/real-world.md>)

### AI overview

An introductory tutorial on object-oriented programming explains how classes, objects, and interfaces organize state and behavior. It uses real-world examples such as users, orders, payments, and payment gateways, and notes that these concepts are relevant to low-level design interviews.

### Source excerpt

Key Object-Oriented Programming Concepts

## The Liskov Substitution Principle: Subtyping Contracts, Invariants, and History Properties

DevFeed: [The Liskov Substitution Principle: Subtyping Contracts, Invariants, and History Properties](<https://devfeed.tech/articles/the-liskov-substitution-principle-does-more-than-you-think-25507.md>)

Original publisher: [Read original article](<https://buttondown.com/hillelwayne/archive/the-liskov-substitution-principle-does-more-than/>)

Author: Hillel Wayne

Published: 2026-01-06T16:51:26Z

Content type: article

Language: en

Sources: [Newsletter feed for Hillel Wayne's Newsletter](<https://devfeed.tech/sources/newsletter-feed-for-hillel-wayne-s-newsletter.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [inheritance](<https://devfeed.tech/tags/inheritance.md>), [oop](<https://devfeed.tech/tags/oop.md>), [properties](<https://devfeed.tech/tags/properties.md>), [solid-principles](<https://devfeed.tech/tags/solid-principles.md>), [subtype](<https://devfeed.tech/tags/subtype.md>)

### AI overview

The article explains that the Liskov Substitution Principle is broader than simply treating it as subtyping. It presents requirements involving method preconditions and postconditions, supertype state invariants, and history properties.

### Source excerpt

Happy New Year! I'm done with the newsletter hiatus and am going to try updating weekly again. To ease into things a bit, I'll try to keep posts a little more off the cuff and casual for a while, at least until Logic for Programmers is done. Speaking of which, v0.13 should be out by the end of this month. So for this newsletter I want to talk about the Liskov Substitution Principle (LSP). Last week I read A SOLID Load of Bull by cryptographer Loupe Vaillant, where he argues the SOLID principles of OOP are not worth following. He makes an exception for LSP, but also claims that it's "just subtyping" and further: If I were trying really hard to be negative about the Liskov substitution principle, I would stress that it only applies when inheritance is involved, and inheritance is strongly discouraged anyway. LSP is more interesting than that! In the original paper, A Behavioral Notion of Subtyping, Barbara Liskov and Jeannette Wing start by defining a "correct" subtyping as follows: Subtype Requirement: Let ϕ(x) be a property provable about objects x of type T. Then ϕ(y) should be true for objects y of type S where S is a subtype of T. From then on, the paper determine what guarantees that a subtype is correct.1 They identify three conditions: Each of the subtype's methods has the same or weaker preconditions and the same or stronger postconditions as the corresponding supertype method.2 The subtype satisfies all state invariants of the supertype. The subtype satisfies all "history properties" of the supertype. 3 e.g. if a supertype has an immutable field, the subtype cannot make it mutable. (Later, Elisa Baniassad and Alexander Summers would realize these are equivalent to "the subtype passes all black-box tests designed for the supertype", which I wrote a little bit more about here.) I want to focus on the first rule about preconditions and postconditions. This refers to the method's contract. For a function f, f.Pre is what must be true going into the function, and

## ESP-IDF tutorial series: Object oriented programming in C

DevFeed: [ESP-IDF tutorial series: Object oriented programming in C](<https://devfeed.tech/articles/esp-idf-tutorial-series-object-oriented-programming-in-c-13731.md>)

Original publisher: [Read original article](<https://developer.espressif.com/blog/2025/10/oop_with_c/>)

Author: John Lee

Published: 2025-10-03T00:00:00Z

Content type: tutorial

Language: en

Sources: [Blog on Developer Portal](<https://devfeed.tech/sources/blog-on-developer-portal.md>)

Topics: [C](<https://devfeed.tech/topics/c.md>), [ESP-IDF](<https://devfeed.tech/topics/esp-idf.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [blog](<https://devfeed.tech/tags/blog.md>), [c](<https://devfeed.tech/tags/c.md>), [esp-idf](<https://devfeed.tech/tags/esp-idf.md>), [esp32c3](<https://devfeed.tech/tags/esp32c3.md>), [object](<https://devfeed.tech/tags/object.md>), [oop](<https://devfeed.tech/tags/oop.md>), [programming](<https://devfeed.tech/tags/programming.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

This tutorial explains how ESP-IDF applies object-oriented programming principles in C using structs, opaque pointers, handles, function pointers, and modular design. It also discusses encapsulation, reusable components, and examples involving HTTP servers and I²C buses.

### Source excerpt

This article explains how ESP-IDF brings object-oriented programming principles into C by using structs, opaque pointers, and handles to enforce encapsulation and modularity. It shows how components like HTTP servers and I²C buses are managed through handles that represent distinct objects for configuration and operation, and compares this approach to Python and C++.

## Abstraction design: Introduction

DevFeed: [Abstraction design: Introduction](<https://devfeed.tech/articles/abstraction-design-introduction-39268.md>)

Original publisher: [Read original article](<https://kt.academy/article/ek-abstraction>)

Published: 2024-02-05T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [abstraction](<https://devfeed.tech/topics/abstraction.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [concepts](<https://devfeed.tech/tags/concepts.md>), [core](<https://devfeed.tech/tags/core.md>), [function](<https://devfeed.tech/tags/function.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [programming](<https://devfeed.tech/tags/programming.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This introduction explains abstraction as a form of simplification that hides complexity by deciding what to expose and what to conceal. It discusses abstractions in object-oriented and functional programming, including interfaces, classes, functions, and higher-level operations, with examples involving Java and Kotlin.

### Source excerpt

What is abstraction in programming and why is it so important.

## Object-Oriented Programming in iOS

DevFeed: [Object-Oriented Programming in iOS](<https://devfeed.tech/articles/object-oriented-programming-in-ios-11528.md>)

Original publisher: [Read original article](<https://www.kodeco.com/ios/paths/object-oriented-programming>)

Published: 2023-10-17T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kodeco | High quality programming tutorials: iOS, Android, Swift, Kotlin, Unity, and more](<https://devfeed.tech/sources/kodeco-high-quality-programming-tutorials-ios-android-swift-kotlin-unity-and-more.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Application Development](<https://devfeed.tech/topics/application-development.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>)

Tags: [application-development](<https://devfeed.tech/tags/application-development.md>), [code](<https://devfeed.tech/tags/code.md>), [concepts](<https://devfeed.tech/tags/concepts.md>), [course](<https://devfeed.tech/tags/course.md>), [development](<https://devfeed.tech/tags/development.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [ios](<https://devfeed.tech/tags/ios.md>), [learning](<https://devfeed.tech/tags/learning.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [oop](<https://devfeed.tech/tags/oop.md>), [programming](<https://devfeed.tech/tags/programming.md>), [skills](<https://devfeed.tech/tags/skills.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>), [techniques](<https://devfeed.tech/tags/techniques.md>)

### AI overview

This learning path teaches Object-Oriented Programming in iOS development, including foundational and advanced OOP concepts and their integration with Protocol-Oriented Programming. It aims to help learners design and implement reusable, maintainable software for mobile application development.

### Source excerpt

The Object-Oriented Programming (OOP) learning path offers a comprehensive exploration of software development principles and techniques. Covering three modules, learners will delve into foundational OOP concepts, advanced techniques, and their integration with Protocol-Oriented Programming (POP). By mastering both OOP and POP paradigms, participants will emerge ready to craft robust, adaptable software solutions that excel in the dynamic world of modern software engineering.

## Workflows as Actors: Is it really possible?

DevFeed: [Workflows as Actors: Is it really possible?](<https://devfeed.tech/articles/workflows-as-actors-is-it-really-possible-36118.md>)

Original publisher: [Read original article](<https://temporal.io/blog/workflows-as-actors-is-it-really-possible>)

Author: Fitz

Published: 2023-06-27T22:00:00Z

Content type: tutorial

Language: en

Sources: [Temporal Blog](<https://devfeed.tech/sources/temporal-blog.md>)

Topics: [Actor](<https://devfeed.tech/topics/actor.md>), [systems](<https://devfeed.tech/topics/systems.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Complex Systems](<https://devfeed.tech/topics/complex-systems.md>)

Tags: [actor](<https://devfeed.tech/tags/actor.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [design-patterns](<https://devfeed.tech/tags/design-patterns.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [temporal-concepts](<https://devfeed.tech/tags/temporal-concepts.md>), [workflows](<https://devfeed.tech/tags/workflows.md>)

### AI overview

This article introduces the Actor Model and compares actors with objects, focusing on message passing, state, actor creation, and encapsulation. It then explains how Temporal Workflows can be built to behave like actors.

### Source excerpt

An overview on how to use Temporal Workflows in the form of an Actor Model

## Class Modifiers in Dart: Sealed, Interface, Base

DevFeed: [Class Modifiers in Dart: Sealed, Interface, Base](<https://devfeed.tech/articles/class-modifiers-in-dart-sealed-interface-base-23989.md>)

Original publisher: [Read original article](<https://quickbirdstudios.com/blog/flutter-dart-class-modifiers/>)

Author: Marvin März

Published: 2023-06-23T11:29:43Z

Content type: tutorial

Language: en

Sources: [QuickBird Studios Blog](<https://devfeed.tech/sources/quickbird-studios-blog.md>)

Topics: [Dart](<https://devfeed.tech/topics/dart.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>)

Tags: [abstract-class](<https://devfeed.tech/tags/abstract-class.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [dart](<https://devfeed.tech/tags/dart.md>), [flutter](<https://devfeed.tech/tags/flutter.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [interface](<https://devfeed.tech/tags/interface.md>), [oop](<https://devfeed.tech/tags/oop.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [post](<https://devfeed.tech/tags/post.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [sealed-interface](<https://devfeed.tech/tags/sealed-interface.md>)

### AI overview

This tutorial explains Dart 3 class modifiers, including the newly introduced sealed, interface, final, and base modifiers and changes to existing modifiers. It describes how modifiers control whether classes can be extended, mixed in, constructed, or implemented, and discusses their practical use cases.

### Source excerpt

With Dart 3 the class modifiers sealed, interface, final and base were introduced into the Dart language. They also updated how existing ones work. In this article, we show you why this change was made and how those new modifiers work. The post Class Modifiers in Dart: Sealed, Interface, Base appeared first on QuickBird Studios.

## Application-as-a-Function Thinking

DevFeed: [Application-as-a-Function Thinking](<https://devfeed.tech/articles/application-as-a-function-thinking-26037.md>)

Original publisher: [Read original article](<http://doridori.github.io//Architecture-Application-as-a-Function/>)

Author: SystemDotRun

Published: 2022-10-11T00:00:00Z

Content type: article

Language: en

Sources: [SystemDotRun](<https://devfeed.tech/sources/systemdotrun.md>)

Topics: [Development](<https://devfeed.tech/topics/development.md>), [Code](<https://devfeed.tech/topics/code.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Requirements](<https://devfeed.tech/topics/requirements.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [event driven](<https://devfeed.tech/topics/event-driven.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [development](<https://devfeed.tech/tags/development.md>), [event-driven](<https://devfeed.tech/tags/event-driven.md>), [oop](<https://devfeed.tech/tags/oop.md>), [productivity](<https://devfeed.tech/tags/productivity.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

The article argues that placing a stateless pure function at the core of an application, within a functional-core imperative-shell architecture, can simplify testing and reduce complexity. It discusses how scattered requirements, weak documentation, poor tests, naming problems, race-prone object-oriented state, low cohesion, and event handling can make systems harder to understand and maintain.

### Source excerpt

TL;DR Architecting an application with a pure function at its core can be a first step towards the "functional-core imperative shell" ideal, which can simplify testing and lower an applications complexity bar. Why? Simplification. As a novel alternative to KISS, we start with a quote from The Grug Brained Developer: complexity very, very bad And for completeness: Complexity: a measure of how difficult it is to understand how a system will behave or to predict the consequences of changing it For many applications the challenge is how to simply & correctly represent a large number of domain requirements in code, and how to raise the complexity-bar sufficently to enable a high degree of engineer productivity & runtime stability . A low complexity-bar reduces the amount of time it takes for a developer to get to the brain-meltdown-event-horizon-like state after which completion of new work slows down expontentially due to sheer codebase and test suite complexity which results in low grokability (i.e. code which is hard to understand or follow), an increasing degree of emergent behaviour, a higher probability of introducing regressions and generally, just slow development. A high complexity-bar conversely allows a desired order and serenity to take hold and more time spent on adding value as opposed to fire-fighting. I have observed different reasons for a low complexity bar, including: Domain requirements being spread throughout all codebase components Non-existent / incomplete / disorganised domain requirements documentation A non-existent / disorganised / bloated / poorly performing test suite Poor naming Race condition rich OOP state manipulations Low architectural cohesion across a codebase / team In addition if your application is highly event driven (user input / network / OS / peripherals / sensors) not having a simple approach to process incoming events can lead to chaotic code. Multiply this if you are working within a sensitive domain which has strict requirem

## Object-oriented or functional? Two ways to see the world

DevFeed: [Object-oriented or functional? Two ways to see the world](<https://devfeed.tech/articles/object-oriented-or-functional-two-ways-to-see-the-world-39357.md>)

Original publisher: [Read original article](<https://kt.academy/article/oop-vs-fp>)

Published: 2022-08-18T00:00:00Z

Content type: opinion

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [fp](<https://devfeed.tech/tags/fp.md>), [functional](<https://devfeed.tech/tags/functional.md>), [immutability](<https://devfeed.tech/tags/immutability.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [oop](<https://devfeed.tech/tags/oop.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [recursion](<https://devfeed.tech/tags/recursion.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This opinion article compares object-oriented programming and functional programming as ways of thinking about program design, rather than merely collections of features. It uses different ways of viewing a bedroom--as objects or actions--to illustrate the distinction while acknowledging that modern languages commonly support both styles.

### Source excerpt

The difference between the OOP and FP paradigms is deeply rooted in how we see the world. A few words on the philosophy of both approaches.

## Separate code from data

DevFeed: [Separate code from data](<https://devfeed.tech/articles/separate-code-from-data-37569.md>)

Original publisher: [Read original article](<https://blog.klipse.tech/databook/2022/06/22/separate-code-from-data.html>)

Author: Yehonathan Sharvit

Published: 2022-06-22T02:32:24Z

Content type: tutorial

Language: en

Sources: [Klipse](<https://devfeed.tech/sources/klipse.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [classes](<https://devfeed.tech/topics/classes.md>)

Tags: [behavior](<https://devfeed.tech/tags/behavior.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [d](<https://devfeed.tech/tags/d.md>), [data](<https://devfeed.tech/tags/data.md>), [dop](<https://devfeed.tech/tags/dop.md>), [oop](<https://devfeed.tech/tags/oop.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

This article explores the first principle of Data-Oriented Programming: separating code, or behavior, from data. It explains how the principle can be followed or violated in both object-oriented programming and functional programming, including examples involving classes, static methods, and lexical scope.

### Source excerpt

The first principle of Data-Oriented Programming (DOP) is a design principle that recommends a clear separation between code (behavior) and data. This may appear to be a FP principle, but in fact, one can adhere to it or break it either in FP or in OOP:

## Effective Kotlin Item 36: Prefer composition over inheritance

DevFeed: [Effective Kotlin Item 36: Prefer composition over inheritance](<https://devfeed.tech/articles/effective-kotlin-item-36-prefer-composition-over-inheritance-39274.md>)

Original publisher: [Read original article](<https://kt.academy/article/ek-composition>)

Published: 2021-04-25T00:00:00Z

Content type: article

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [reuse](<https://devfeed.tech/topics/reuse.md>), [superclass](<https://devfeed.tech/topics/superclass.md>)

Tags: [approach](<https://devfeed.tech/tags/approach.md>), [behavior](<https://devfeed.tech/tags/behavior.md>), [hierarchy](<https://devfeed.tech/tags/hierarchy.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [object](<https://devfeed.tech/tags/object.md>), [oop](<https://devfeed.tech/tags/oop.md>), [reuse](<https://devfeed.tech/tags/reuse.md>), [superclass](<https://devfeed.tech/tags/superclass.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

The article argues that inheritance should primarily model a clear "is a" relationship and can be problematic when used mainly for code extraction or reuse. It presents class composition as a safer and more explicit alternative, while acknowledging that composition requires additional code.

### Source excerpt

Years of OOP made us overuse inheritance. Instead, we should more often use a composition that is safer and more explicit. More often, but not always...

## Programming Language Evolution

DevFeed: [Programming Language Evolution](<https://devfeed.tech/articles/programming-language-evolution-26026.md>)

Original publisher: [Read original article](<https://elizarov.medium.com/programming-language-evolution-ab7d7d2b0d0b?source=rss-4762e889f8fc------2>)

Author: Roman Elizarov

Published: 2020-11-23T16:18:08Z

Content type: opinion

Language: en

Sources: [Stories by Roman Elizarov on Medium](<https://devfeed.tech/sources/stories-by-roman-elizarov-on-medium.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>), [Code](<https://devfeed.tech/topics/code.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [C](<https://devfeed.tech/topics/c.md>), [Java](<https://devfeed.tech/topics/java.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [evolution](<https://devfeed.tech/tags/evolution.md>), [history](<https://devfeed.tech/tags/history.md>), [improvements](<https://devfeed.tech/tags/improvements.md>), [language](<https://devfeed.tech/tags/language.md>), [loops](<https://devfeed.tech/tags/loops.md>), [oop](<https://devfeed.tech/tags/oop.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [pointers](<https://devfeed.tech/tags/pointers.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [programming-languages](<https://devfeed.tech/tags/programming-languages.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

The article examines how programming languages evolve through gradual improvements that follow changes in programming practice. It uses the transition from GOTOs to structured loops and the adoption of object-oriented patterns, classes, methods, and implicit object references as examples.

### Source excerpt

Photo by Anne Nygård on Unsplash The history of programming languages is ripe with evolution. Existing languages constantly evolve and new languages are created to address the emerging needs. Sometimes there are radical, revolutionary breakthroughs, with a complete paradigm shift, but often there are just gradual improvements and refinements. The latter is the topic of this story. The practice of programming at any given era usually goes ahead of capabilities that programming languages provide, while programming language designers recognize it and catch up to fulfill the demand. Let us see some examples to the point. From GOTOs to the structured code In early languages, you had to write a lot of repetitive code just to do a simple loop. The loop was such a common programming pattern, that it was adopted even by the primitive higher-level languages in the era predating structured programming. So, there was a time when you still had GOTOs in your programming language but a significant fraction of the code had structured loops: 10 LET N=10 20 FOR I=1 TO N 30 PRINT "Hello, World!" 40 NEXT I As we know, the subsequent generation of languages not only added structured IF statements but also made the structure explicit in the source and ended up abolishing GOTOs completely. This kind of evolution can be seen in other areas, too. Objects and pointers Let's take a brief look at OOP. The object-oriented style of programming does not need an object-oriented language. Even nowadays you can find software written in C where methods are just a convention of writing functions whose first parameter is a pointer to the receiver: void Point_move(Point* self, int dx, int dy) { ... } Virtual methods are routinely implemented in pure C, too, explicitly keeping a virtual methods table with references to methods somewhere in the object's structure. However, the rising popularity of object-oriented programming back in the day cemented the growth of languages that incorporated these patterns

## Unspoken Assumptions Underlying OO Design Maxims

DevFeed: [Unspoken Assumptions Underlying OO Design Maxims](<https://devfeed.tech/articles/unspoken-assumptions-underlying-oo-design-maxims-32238.md>)

Original publisher: [Read original article](<https://bruceeckel.com/blog/2019-12-24-unspoken-assumptions-underlying-oo-design-maxims/>)

Author: Bruce Eckel

Published: 2019-12-24T00:00:00Z

Content type: opinion

Language: en

Sources: [Bruce Eckel - Computing Thoughts](<https://devfeed.tech/sources/bruce-eckel-computing-thoughts.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [approach](<https://devfeed.tech/tags/approach.md>), [change](<https://devfeed.tech/tags/change.md>), [complexity](<https://devfeed.tech/tags/complexity.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [oop](<https://devfeed.tech/tags/oop.md>)

### AI overview

The article argues that many object-oriented design maxims implicitly assume developers can predict how a system will change. It questions whether adding complexity to support uncertain future changes is justified, using the open-closed principle and polymorphism as examples.

### Source excerpt

For Atomic Kotlin, I've been struggling with an "atom" (very small chapter) during the last couple of months. It's on object-oriented design, and it brought up a lot of feelings I've had for quite awhile about some of the various maxims and design guidelines that have appeared in recent decades, since OO became mainstream. I couldn't quite put my finger on what bothered me about these design ideas. Then @codingunicorn did it for me by writing a post called Flexible code considered harmful.

## Clean architecture for Android with Kotlin: a pragmatic approach for starters

DevFeed: [Clean architecture for Android with Kotlin: a pragmatic approach for starters](<https://devfeed.tech/articles/clean-architecture-for-android-with-kotlin-a-pragmatic-approach-for-starters-27142.md>)

Original publisher: [Read original article](<https://antonioleiva.com/clean-architecture-android>)

Published: 2018-09-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [Antonio Leiva](<https://devfeed.tech/sources/antonio-leiva.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Dependency Inversion](<https://devfeed.tech/topics/dependency-inversion.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [clean-architecture](<https://devfeed.tech/tags/clean-architecture.md>), [decoupling](<https://devfeed.tech/tags/decoupling.md>), [dependency-inversion](<https://devfeed.tech/tags/dependency-inversion.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [oop](<https://devfeed.tech/tags/oop.md>), [programming](<https://devfeed.tech/tags/programming.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

A pragmatic introductory tutorial on clean architecture for Android apps using Kotlin. It focuses on dependency inversion, explains the tradeoff between decoupling and added complexity, and introduces a five-layer application structure.

### Source excerpt

Everything Android, Kotlin and other random topics

## BetterReflection version 2.0.0 released

DevFeed: [BetterReflection version 2.0.0 released](<https://devfeed.tech/articles/betterreflection-version-2-0-0-released-21148.md>)

Original publisher: [Read original article](<https://ocramius.github.io/blog/roave-better-reflection-v2.0/>)

Published: 2017-09-18T00:00:00Z

Content type: release

Language: en

Sources: [Marco Pivetta](<https://devfeed.tech/sources/marco-pivetta.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [Library](<https://devfeed.tech/topics/library.md>), [Parser](<https://devfeed.tech/topics/parser.md>), [Security](<https://devfeed.tech/topics/security.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Malware](<https://devfeed.tech/topics/malware.md>), [Composer](<https://devfeed.tech/topics/composer.md>)

Tags: [2-0-0](<https://devfeed.tech/tags/2-0-0.md>), [code](<https://devfeed.tech/tags/code.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [env-file-security](<https://devfeed.tech/tags/env-file-security.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [oop](<https://devfeed.tech/tags/oop.md>), [php](<https://devfeed.tech/tags/php.md>), [procedural](<https://devfeed.tech/tags/procedural.md>), [scope](<https://devfeed.tech/tags/scope.md>), [security](<https://devfeed.tech/tags/security.md>), [use-cases](<https://devfeed.tech/tags/use-cases.md>), [version-2-0-0](<https://devfeed.tech/tags/version-2-0-0.md>)

### AI overview

Roave's BetterReflection 2.0.0 reproduces PHP's reflection API without triggering autoloading. It scans source files, parses PHP code into an AST, and exposes reflection objects for analysis before classes are loaded.

### Source excerpt

Roave's BetterReflection 2.0.0s was released today! I and James Titcumb started working on this project back in 2015, and it is a pleasure to see it reaching maturity. The initial idea was simple: James would implement all my wicked ideas, while I would lay back and get drunk on Drambuie. Yes, that actually happened. Thank you, James, for all the hard work! 🍻 (I did some work too, by the way!) What the heck is BetterReflection? Jokes apart, the project is quite ambitious, and it aims at reproducing the entirety of the PHP reflection API without having any actual autoloading being triggered. When put in use, it looks like this: <?php // src/MyClass.php namespace MyProject; class MyClass { public function something() {} } <?php // example1.php use MyProject\MyClass; use Roave\BetterReflection\BetterReflection; use Roave\BetterReflection\Reflection\ReflectionMethod; require_once __DIR__ . '/vendor/autoload.php'; $myClass = (new BetterReflection()) ->classReflector() ->reflect(MyClass::class); $methodNames = \array_map(function (ReflectionMethod $method) : string { return $method->getName(); }, $myClass->getMethods()); \var_dump($methodNames); // class was not loaded: \var_dump(\sprintf('Class %s loaded: ', MyClass::class)); \var_dump(\class_exists(MyClass::class, false)); As you can see, the difference is just in how you bootstrap the reflection API. Also, we do provide a fully backwards-compatible reflection API that you can use if your code heavily relies on ext-reflection: <?php // example2.php use MyProject\MyClass; use Roave\BetterReflection\BetterReflection; use Roave\BetterReflection\Reflection\Adapter\ReflectionClass; require_once __DIR__ . '/vendor/autoload.php'; $myClass = (new BetterReflection()) ->classReflector() ->reflect(MyClass::class); $reflectionClass = new ReflectionClass($myClass); // You can just use it wherever you had `ReflectionClass`! \var_dump($reflectionClass instanceof \ReflectionClass); \var_dump($reflectionClass->getName()); How does that

## Avoid static imports

DevFeed: [Avoid static imports](<https://devfeed.tech/articles/avoid-static-imports-37681.md>)

Original publisher: [Read original article](<https://carlosbecker.com/posts/avoid-static-imports/>)

Author: Carlos Alexandro Becker

Published: 2015-07-05T00:00:00Z

Content type: opinion

Language: en

Sources: [Carlos Becker](<https://devfeed.tech/sources/carlos-becker.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>)

Tags: [antipattern](<https://devfeed.tech/tags/antipattern.md>), [avoid](<https://devfeed.tech/tags/avoid.md>), [code](<https://devfeed.tech/tags/code.md>), [java](<https://devfeed.tech/tags/java.md>), [oop](<https://devfeed.tech/tags/oop.md>), [readability](<https://devfeed.tech/tags/readability.md>)

### AI overview

The article argues that Java static imports should be used sparingly because overuse can obscure where methods and members originate, pollute the namespace, and reduce code readability and maintainability. It recommends importing only a small number of frequently used static members when appropriate.

### Source excerpt

There are a lot of Java API's and Frameworks which rely on static methods and the sort. Arguably, this is a bad OOP practice, but let's not enter this particular subject just yet.

## When to declare classes final

DevFeed: [When to declare classes final](<https://devfeed.tech/articles/when-to-declare-classes-final-21149.md>)

Original publisher: [Read original article](<https://ocramius.github.io/blog/when-to-declare-classes-final/>)

Published: 2015-01-06T00:00:00Z

Content type: opinion

Language: en

Sources: [Marco Pivetta](<https://devfeed.tech/sources/marco-pivetta.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>)

Tags: [articles](<https://devfeed.tech/tags/articles.md>), [doom](<https://devfeed.tech/tags/doom.md>), [examples](<https://devfeed.tech/tags/examples.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [oop](<https://devfeed.tech/tags/oop.md>), [opinion](<https://devfeed.tech/tags/opinion.md>), [php](<https://devfeed.tech/tags/php.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

This opinion article argues that PHP classes should generally be declared final, especially when they implement an interface and expose no other public methods. It explains that preventing inheritance can discourage deep inheritance chains, encourage composition, and make developers design clearer public APIs.

### Source excerpt

TL;DR: Make your classes always final, if they implement an interface, and no other public methods are defined In the last month, I had a few discussions about the usage of the final marker on PHP classes. The pattern is recurrent: I ask for a newly introduced class to be declared as final the author of the code is reluctant to this proposal, stating that final limits flexibility I have to explain that flexibility comes from good abstractions, and not from inheritance It is therefore clear that coders need a better explanation of when to use final, and when to avoid it. There are many other articles about the subject, but this is mainly thought as a "quick reference" for those that will ask me the same questions in future. When to use "final": final should be used whenever possible. Why do I have to use final? There are numerous reasons to mark a class as final: I will list and describe those that are most relevant in my opinion. 1. Preventing massive inheritance chain of doom Developers have the bad habit of fixing problems by providing specific subclasses of an existing (not adequate) solution. You probably saw it yourself with examples like following: <?php class Db { /* ... */ } class Core extends Db { /* ... */ } class User extends Core { /* ... */ } class Admin extends User { /* ... */ } class Bot extends Admin { /* ... */ } class BotThatDoesSpecialThings extends Bot { /* ... */ } class PatchedBot extends BotThatDoesSpecialThings { /* ... */ } This is, without any doubts, how you should NOT design your code. The approach described above is usually adopted by developers who confuse OOP with "a way of solving problems via inheritance" ("inheritance-oriented-programming", maybe?). 2. Encouraging composition In general, preventing inheritance in a forceful way (by default) has the nice advantage of making developers think more about composition. There will be less stuffing functionality in existing code via inheritance, which, in my opinion, is a symptom of haste

## Object Oriented Programming in Go

DevFeed: [Object Oriented Programming in Go](<https://devfeed.tech/articles/object-oriented-programming-in-go-22058.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2013/07/object-oriented-programming-in-go.html>)

Published: 2013-07-10T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [embedding](<https://devfeed.tech/tags/embedding.md>), [function](<https://devfeed.tech/tags/function.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [oop](<https://devfeed.tech/tags/oop.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [private-access](<https://devfeed.tech/tags/private-access.md>), [programming](<https://devfeed.tech/tags/programming.md>), [properties](<https://devfeed.tech/tags/properties.md>), [structure](<https://devfeed.tech/tags/structure.md>)

### AI overview

This tutorial explains object-oriented programming in Go, focusing on how composition, embedding, and interfaces provide polymorphic behavior without traditional inheritance. It also introduces structs, field visibility, and methods through Cat, Dog, and Animal examples.

### Source excerpt

Someone asked a question on the forum today on how to gain the benefits of inheritance without embedding. It is really important for everyone to think in terms of Go and not the languages they are leaving behind. I can't tell you much code I removed from my early Go implementations because it wasn't necessary. The language designers have years of experience and knowledge. Hindsight is helping to create a language that is fast, lean and really fun to code in.

## Singleton Design Pattern in Go

DevFeed: [Singleton Design Pattern in Go](<https://devfeed.tech/articles/singleton-design-pattern-in-go-22060.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2013/07/singleton-design-pattern-in-go.html>)

Published: 2013-07-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [XML](<https://devfeed.tech/topics/xml.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [design-patterns](<https://devfeed.tech/tags/design-patterns.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [oop](<https://devfeed.tech/tags/oop.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [programming](<https://devfeed.tech/tags/programming.md>), [thread](<https://devfeed.tech/tags/thread.md>), [xml](<https://devfeed.tech/tags/xml.md>)

### AI overview

This tutorial explains how to implement the Singleton design pattern in Go. It discusses managing shared resources in multithreaded applications, Go's package and type scoping, and the role of interfaces in providing polymorphic behavior without inheritance.

### Source excerpt

Multi-threaded applications are very complicated, especially when your code is not organized and consistent with how resources are accessed, managed and maintained. If you want to minimize bugs you need philosophies and rules to live by. Here are some of mine: Resource allocation and de-allocation should be abstracted and managed within the same type. Resource thread safeness should be abstracted and managed within the same type. A public interface should be the only means to accessing shared resources. Any thread that allocates a resource should de-allocated the same resource. In Go we don't have threads but Go Routines. The Go runtime abstracts the threading and task swapping of these routines. Regardless, the same philosophies and rules apply. One of my favorite design patterns is the Singleton. It provides a great implementation when you only need one instance of a type and that type manages shared resources. A Singleton is a design pattern where the type creates an instance of itself and keeps that reference private. Access to the shared resources managed by that reference is abstracted through a static pubic interface. These static methods also provide thread safeness. The application using the Singleton is responsible for initializing and de-initializing the Singleton but never has direct access to the internals. It escaped me for some time how to implement a Singleton in Go because Go is not a traditional object oriented programming language and there are no static methods. I consider Go to be a light object oriented programming language. Yes it does have encapsulation and type member functions but it lacks inheritance and therefore traditional polymorphism. In all of the OOP languages I have ever used, I never used inheritance unless I wanted to implement polymorphism. With the way interfaces are implemented in Go there is no need for inheritance. Go took the best parts of OOP, left out the rest and gave us a better way to write polymorphic code. In Go we c

## Vim plugin to compile/run code using API

DevFeed: [Vim plugin to compile/run code using API](<https://devfeed.tech/articles/vim-plugin-to-compile-run-code-using-api-19976.md>)

Original publisher: [Read original article](<http://engineering.hackerearth.com/2013/03/11/hackerearth-vim-plugin/>)

Published: 2013-03-11T00:00:00Z

Content type: tutorial

Language: en

Sources: [HackerEarth](<https://devfeed.tech/sources/hackerearth.md>)

Topics: [Vim](<https://devfeed.tech/topics/vim.md>), [API](<https://devfeed.tech/topics/api.md>), [Python](<https://devfeed.tech/topics/python.md>), [Code](<https://devfeed.tech/topics/code.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [code](<https://devfeed.tech/tags/code.md>), [oop](<https://devfeed.tech/tags/oop.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [python](<https://devfeed.tech/tags/python.md>), [tutorials](<https://devfeed.tech/tags/tutorials.md>)

### AI overview

This tutorial describes building a Vim plugin that uses the HackerEarth API to compile and run code. It introduces VimL and Python integration, plugin checks for Python support and an API client key, and an object-oriented design with Api, Argument, and VimInterface classes. The article also discusses mapping plugin commands to keyboard shortcuts.

### Source excerpt

tl;dr Check out https://github.com/HackerEarth/hackerearth.vim I love Vim editor. And the idea of a plugin to compile and run code from my favorite code editor sounded exciting. HackerEarth API made it easier. Oh man - this is going to be the coolest thing I have ever built. Whoa, wait a minute. Aren't you forgetting something? You have never written a plugin before. There always comes a time when you have to do something for the first time! ;) Where to begin? Google is the answer :) After exploring and reading some tutorials, I found out that VimL, also know as Vim script is the language used to built vim plugins. Here's the best part. You only need very little knowledge of VimL to be able to write plugins, if you know Python (or Ruby). I chose Python. Why Python? Because using python gives so much flexibility. Think about using urllib/httplib/json/vim for accessing some web service that helps editing in Vim. This is why most of the plugins that work with web services are usually done in VimL+Python. Also, I am learning Python these days so it became a more solid reason to use it. Let's write a vim plugin! Generally vim plugins start with few checks. In this case, it checks for VimL + Python support and also looks for HackerEarth API client key. Obviously, if there is some error, plugin should not be loaded. " check for python if !has('python') echoerr "HackerEarth: Plugin needs to be compiled wuth python support." finish endif " check for client key if exists("g:HackerEarthApiClientKey") let s:client_key = g:HackerEarthApiClientKey else echoerr "You need to set client key in your vimrc file" finish endif As said earlier, Python can easily be integrated with VimL. Python code inside VimFunction starts after python " EOF and ends before EOF. Here is an example on how to do it. function! s:VimFunction() python << EOF # write python code here import os print "Hello World!" EOF endfunction OOPS! I have written most of the plugin code in Python and I love using Object O

[Next page](<https://devfeed.tech/topics/oop.md?cursor=WyIyMDEzLTAzLTExVDAwOjAwOjAwKzAwOjAwIiwgIjc3YmJjMzVjLTZiOGUtNGUwNi05NWRhLTE5NDZmYzg0OTU2NCJd>)