# object-oriented-programming

Published articles for object-oriented-programming.

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

## Object-Oriented Programming in Python vs Java

DevFeed: [Object-Oriented Programming in Python vs Java](<https://devfeed.tech/articles/object-oriented-programming-in-python-vs-java-110727.md>)

Original publisher: [Read original article](<https://realpython.com/oop-in-python-vs-java/>)

Author: Jon Fincher

Published: 2026-10-31T14:00:00Z

Content type: comparison

Language: en

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

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Java](<https://devfeed.tech/topics/java.md>), [Python](<https://devfeed.tech/topics/python.md>), [class](<https://devfeed.tech/topics/class.md>), [object](<https://devfeed.tech/topics/object.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [constructor](<https://devfeed.tech/topics/constructor.md>)

Tags: [access-control](<https://devfeed.tech/tags/access-control.md>), [car](<https://devfeed.tech/tags/car.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [color](<https://devfeed.tech/tags/color.md>), [compare](<https://devfeed.tech/tags/compare.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [compilation-error](<https://devfeed.tech/tags/compilation-error.md>), [complete](<https://devfeed.tech/tags/complete.md>), [composition](<https://devfeed.tech/tags/composition.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [java](<https://devfeed.tech/tags/java.md>), [knowledge](<https://devfeed.tech/tags/knowledge.md>), [learn](<https://devfeed.tech/tags/learn.md>), [object](<https://devfeed.tech/tags/object.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [vs](<https://devfeed.tech/tags/vs.md>)

### AI overview

The article shows how Java OOP concepts translate into Python and where the languages differ. Java declares typed attributes in class bodies, commonly keeps them private behind getters and setters, and restricts classes to single inheritance while allowing shared behavior through interfaces. Python creates instance attributes with `self` in `__init__`, exposes them by default, and offers properties for controlled access; underscore naming conventions signal non-public attributes but do not provide Java-style access control. Python also supports multiple inheritance and duck typing, while Java uses interface types for polymorphic interchangeability. Both languages provide reflection and type checks, though the article describes Python's `dir()`, `getattr()`, and `callable()` workflow as simpler than Java's reflection APIs. Python dunder methods can customize representations and overload operators; the article notes Java has no comparable operator overloading. Examples use a `Car` class to illustrate these mechanisms and practical pitfalls, including class versus instance attributes.

### Source excerpt

Compare Python vs Java for object-oriented programming and learn how to apply your Java knowledge of classes and objects to Python in a Pythonic way.

## The Art of Object-Oriented Programming

DevFeed: [The Art of Object-Oriented Programming](<https://devfeed.tech/articles/the-art-of-object-oriented-programming-64579.md>)

Original publisher: [Read original article](<https://hackernoon.com/the-art-of-object-oriented-programming?source=rss>)

Author: Syed Ahmer Shah

Published: 2026-10-04T11:53:47Z

Content type: tutorial

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [solid principles](<https://devfeed.tech/topics/solid-principles.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [class](<https://devfeed.tech/topics/class.md>), [object](<https://devfeed.tech/topics/object.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>)

Tags: [common-oop-design-mistakes](<https://devfeed.tech/tags/common-oop-design-mistakes.md>), [composition](<https://devfeed.tech/tags/composition.md>), [composition-over-inheritance](<https://devfeed.tech/tags/composition-over-inheritance.md>), [coupling](<https://devfeed.tech/tags/coupling.md>), [coupling-and-cohesion-in-oop](<https://devfeed.tech/tags/coupling-and-cohesion-in-oop.md>), [design-patterns](<https://devfeed.tech/tags/design-patterns.md>), [four-pillars-of-oop](<https://devfeed.tech/tags/four-pillars-of-oop.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [oop-design-principles](<https://devfeed.tech/tags/oop-design-principles.md>), [oop-principles](<https://devfeed.tech/tags/oop-principles.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

A practical tutorial explains object-oriented programming through classes, objects, state, behavior, encapsulation, abstraction, inheritance, and polymorphism. It compares composition with inheritance and discusses association, aggregation, coupling, cohesion, and common design mistakes, using code examples to show how responsibilities can be separated in a software system.

### Source excerpt

Understand OOP from classes and objects to composition, inheritance, polymorphism, coupling, and cohesion with practical examples.

## Bazel rule extensions

DevFeed: [Bazel rule extensions](<https://devfeed.tech/articles/bazel-rule-extensions-25413.md>)

Original publisher: [Read original article](<https://smileykeith.com/2025/10/31/bazel-rule-extensions/>)

Author: Keith Smiley

Published: 2025-10-31T17:00:00Z

Content type: article

Language: en

Sources: [Keith Smiley](<https://devfeed.tech/sources/keith-smiley.md>)

Topics: [bazel](<https://devfeed.tech/topics/bazel.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [extend](<https://devfeed.tech/topics/extend.md>)

Tags: [actions](<https://devfeed.tech/tags/actions.md>), [bazel](<https://devfeed.tech/tags/bazel.md>), [class](<https://devfeed.tech/tags/class.md>), [custom](<https://devfeed.tech/tags/custom.md>), [existing](<https://devfeed.tech/tags/existing.md>), [extend](<https://devfeed.tech/tags/extend.md>), [extensions](<https://devfeed.tech/tags/extensions.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [providers](<https://devfeed.tech/tags/providers.md>), [use-case](<https://devfeed.tech/tags/use-case.md>), [use-cases](<https://devfeed.tech/tags/use-cases.md>)

### AI overview

Bazel 8.0 rule extensions let a new rule inherit an existing rule, call its implementation with `ctx.super()`, then alter providers, add a transition, or attach aspects. The excerpt shows post-processing a rule's output with a sort action; normalizing macOS and Linux debug outputs into one `OutputGroupInfo` group; adding a Python version transition to `py_wheel`; and applying Apple platform transitions to Swift libraries. The Swift example requires transition attributes and can use `select()` in a macro to preserve tvOS dependencies. Limitations include restricted attribute overrides, the requirement that `parent` be a rule rather than a macro, and difficulty modifying existing actions such as adding `-ftime-trace` output.

### Source excerpt

One of Bazel's best features is being able to easily write custom rules specific to your project. This is great for many use cases, but when what you really want is to enhance the behavior of existing rules, historically your options have been limited. What you would often do is wrap the existing rule in a macro, and add some number of custom rules to try and achieve the desired effect. When really what you want is to edit the existing rule, without having to re-implement all of its functionality (or maintain a fork). With Bazel 8.0, Googlers added a few new ways to extend existing rules that can help with this use case. In this post we will look at the aptly named rule extensions feature and some practical use cases I have found for it. Basic rule extensions Rule extensions allow you to inherit the behavior of an existing rule, similar to class inheritance in object-oriented programming. Importantly you can make a few modifications to augment the behavior of the rule to your liking. Let's say you have a rule that concatenates the given srcs: def _foo_impl(ctx): output = ctx.actions.declare_file("output.txt") ctx.actions.run_shell( inputs = ctx.files.srcs, outputs = [output], command = "cat {} > {}".format(" ".join([src.path for src in ctx.files.srcs]), output.path), ) return [DefaultInfo(files = depset([output]))] foo = rule( implementation = _foo_impl, attrs = { "srcs": attr.label_list(allow_files = True), }, ) Now let's assume in your project, you want the output file to be sorted. If you own the original rule you could of course change _foo_impl to handle that for you, but if you are relying on a more complex upstream rule, you may not have that luxury. Here's how we can extend this to post-process the file it produces: def _bar_impl(ctx): providers = ctx.super() # Invoke 'foo' and get the providers # NOTE: This assumes there's always only the provider we want. original_output = providers[0].files.to_list()[0] new_output = ctx.actions.declare_file("new_output.tx

## 👨🍳 Cooking Tasty code in Kotlin 🍴 -- Part 1

DevFeed: [👨🍳 Cooking Tasty code in Kotlin 🍴 -- Part 1](<https://devfeed.tech/articles/cooking-tasty-code-in-kotlin-part-1-25709.md>)

Original publisher: [Read original article](<https://blog.shreyaspatil.dev/cooking-tasty-code-in-kotlin-part-1/>)

Author: Shreyas Patil

Published: 2020-12-24T14:37:40Z

Content type: article

Language: en

Sources: [Shreyas Patil's Blog](<https://devfeed.tech/sources/shreyas-patil-s-blog.md>)

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

Tags: [android](<https://devfeed.tech/tags/android.md>), [argument](<https://devfeed.tech/tags/argument.md>), [beginner](<https://devfeed.tech/tags/beginner.md>), [boilerplate](<https://devfeed.tech/tags/boilerplate.md>), [coding](<https://devfeed.tech/tags/coding.md>), [expression](<https://devfeed.tech/tags/expression.md>), [function](<https://devfeed.tech/tags/function.md>), [functional](<https://devfeed.tech/tags/functional.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [java](<https://devfeed.tech/tags/java.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-beginner](<https://devfeed.tech/tags/kotlin-beginner.md>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [programming](<https://devfeed.tech/tags/programming.md>), [series](<https://devfeed.tech/tags/series.md>)

### AI overview

The excerpt recommends using Kotlin's language features to reduce Java-style boilerplate and make code more expressive. It introduces top-level functions, which can keep logic outside unnecessary classes and are resolved as static members on the JVM, and single-expression functions for logic that does one thing. The author says return types may be omitted for expression functions but prefers keeping them for readability. It also begins to introduce default arguments as an alternative to overloading functions for different configurations; the excerpt ends before explaining that example.

### Source excerpt

Part 1 of the 'Cooking Tasty Code' series. Explore Kotlin's syntactic sugar and features that help write cleaner, more readable, and idiomatic code.

## 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: article

Language: en

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

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

Tags: [c](<https://devfeed.tech/tags/c.md>), [evolution](<https://devfeed.tech/tags/evolution.md>), [language](<https://devfeed.tech/tags/language.md>), [loops](<https://devfeed.tech/tags/loops.md>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [structured](<https://devfeed.tech/tags/structured.md>)

### AI overview

Programming practices often develop before languages provide direct support, and language features gradually catch up. The excerpt traces this from early languages that combined GOTO with structured loops to later languages that made control structures explicit and eliminated GOTOs. It also explains that C can express object-oriented patterns through receiver pointers and manually maintained virtual-method tables; popular adoption of those patterns helped drive native classes and methods. As hardware grew faster, explicit references to objects came to seem like boilerplate, leading to implicit references in languages such as Python, JavaScript, and Java. The text is excerpted and ends mid-discussion.

### 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

## Reducing Type Hierarchies

DevFeed: [Reducing Type Hierarchies](<https://devfeed.tech/articles/reducing-type-hierarchies-22116.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2016/10/reducing-type-hierarchies.html>)

Published: 2016-10-09T00:00:00Z

Content type: article

Language: en

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

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

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [composition](<https://devfeed.tech/tags/composition.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [hierarchy](<https://devfeed.tech/tags/hierarchy.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [java](<https://devfeed.tech/tags/java.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [programming](<https://devfeed.tech/tags/programming.md>), [reuse](<https://devfeed.tech/tags/reuse.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

The excerpt argues that Go's lack of base types and subtyping makes traditional object oriented type hierarchies a poor fit for some code. It proposes grouping concrete types by shared behavior rather than shared state, using interfaces to group and decouple them, and using composition for type reuse. Its examples begin with an embedded generic Animal type specialized for Dog and Cat behavior; the excerpt ends during the example and does not show the later guidelines.

### Source excerpt

Introduction I see a lot of developers coming to Go from object oriented programming languages such as C# and Java. Because these developers have been trained to use type hierarchies, it makes sense for them to use this same pattern in Go. However, there are aspects of Go that don't allow type hierarchies to provide the same level of functionality they do in other object oriented programming languages. Specifically, the concepts of base types and subtyping don't exist in Go so type reuse requires a different way of thinking.

## Poor man's functional programming

DevFeed: [Poor man's functional programming](<https://devfeed.tech/articles/poor-man-s-functional-programming-97425.md>)

Original publisher: [Read original article](<https://miqu.me/blog/2015/08/31/poor-mans-functional-programming/>)

Published: 2015-08-31T20:00:00Z

Content type: opinion

Language: en

Sources: [Miguel Quinones](<https://devfeed.tech/sources/miguel-quinones.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: [features](<https://devfeed.tech/tags/features.md>), [fp](<https://devfeed.tech/tags/fp.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [ios](<https://devfeed.tech/tags/ios.md>), [learning](<https://devfeed.tech/tags/learning.md>), [meta](<https://devfeed.tech/tags/meta.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [oop](<https://devfeed.tech/tags/oop.md>), [programming](<https://devfeed.tech/tags/programming.md>), [swift](<https://devfeed.tech/tags/swift.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

### AI overview

The essay argues that Swift lets iOS and Mac developers mix object-oriented and functional styles according to the problem, framework, or team. The author calls this "poor man's functional programming": Swift offers some functional-language features, but they are less rich than those in purer functional languages. The approach is presented as a pragmatic way to learn and choose suitable tools, while acknowledging that functional programming can feel abstract to beginners and is often explained through toy examples or unfamiliar terminology. The supplied text does not include specific code examples or functional techniques.

### Source excerpt

It's a very exciting time to be an iOS or Mac developer. The platform moves very fast and we got a new toy (language) to play with: Swift. It's the perfect time to reevaluate, learn and evolve as a programmer, because you will be forced to adopt this new language (yes, I think Swift is the future, 100%). I want to relate this to the fact that most iOS engineers, or mobile application developers, are traditionally familiar with Object Oriented Programming paradigm. But Swift offers more than different syntax and OOP. I'm referring to some features inspired by functional languages. If you've ever had an interest, but never the chance or motivation to go forth and look into this paradigm, now it's the perfect time to do it. Functional programming is... I don't want to start reviewing what functional programming is, there are excellent resources out there, check them out. I want to point out how a beginner, somebody who starts learning Functional Programming (FP), might feel: Too abstract Not applicable to my problems For academics What does even 'pure' mean? I need to mutate stuff! Meh, I'll go back to my familiar way of doing things There's a higher barrier of entry to learn how to think and code programs which are more 'functional'. The concepts are abstract, and the benefits are often described as it's more functional without emphasis of what you are actually gaining. Also there's the problem that many times all is explained by simple examples. But every programmer knows there's a huge difference between toy programs and real big projects. Flame wars You'll find engineers and computer scientists that believe that the only and true way of doing things is of course thinking functionally, and we've all been doing it wrong during the last decades. The math is the only source of truth and validity, hence FP is the only way. They've got their very valid reasons to think this way, but my opinion is that many people familiar with FP start to use higher-level vocabulary, and d

## 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: article

Language: en

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

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

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [composition](<https://devfeed.tech/tags/composition.md>), [embedding](<https://devfeed.tech/tags/embedding.md>), [fields](<https://devfeed.tech/tags/fields.md>), [fmt](<https://devfeed.tech/tags/fmt.md>), [functions](<https://devfeed.tech/tags/functions.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>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [private](<https://devfeed.tech/tags/private.md>), [programming](<https://devfeed.tech/tags/programming.md>), [public](<https://devfeed.tech/tags/public.md>), [string](<https://devfeed.tech/tags/string.md>), [struct](<https://devfeed.tech/tags/struct.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [type](<https://devfeed.tech/tags/type.md>)

### AI overview

The author presents Go as a light object-oriented language with encapsulation and methods but without inheritance, arguing that interfaces provide a way to write polymorphic code without inheritance. The excerpt illustrates composition with Cat and Dog structs: Cat contains a named Animal field, while Dog embeds Animal anonymously. It also explains that capitalization controls whether identifiers are exported, while noting that public/private access is not an exact fit for Go. The excerpt begins a method example but ends mid-code, so it does not show the full implementations or their results.

### 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: article

Language: en

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

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [locking](<https://devfeed.tech/topics/locking.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [Programming Languages / Compilers](<https://devfeed.tech/topics/programming-languages-compilers.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [design](<https://devfeed.tech/tags/design.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>), [how-to](<https://devfeed.tech/tags/how-to.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interface](<https://devfeed.tech/tags/interface.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [oop](<https://devfeed.tech/tags/oop.md>), [pattern](<https://devfeed.tech/tags/pattern.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [private](<https://devfeed.tech/tags/private.md>), [programming](<https://devfeed.tech/tags/programming.md>), [resource](<https://devfeed.tech/tags/resource.md>), [resources](<https://devfeed.tech/tags/resources.md>), [static](<https://devfeed.tech/tags/static.md>), [thread](<https://devfeed.tech/tags/thread.md>), [threading](<https://devfeed.tech/tags/threading.md>), [threads](<https://devfeed.tech/tags/threads.md>)

### AI overview

The excerpt presents Go package and type encapsulation as a way to implement a Singleton despite Go lacking static methods. The package keeps the single instance private and exposes shared resources through a public interface; the author argues that resource allocation, cleanup, and thread safety should be managed together, while the application initializes and de-initializes the Singleton without accessing its internals. A configuration package that reads settings from XML is introduced as the practical example, but the excerpt ends before describing its implementation.

### 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

## Gist: My New Devbook

DevFeed: [Gist: My New Devbook](<https://devfeed.tech/articles/gist-my-new-devbook-21178.md>)

Original publisher: [Read original article](<https://juri.dev/blog/2012/12/gist-my-new-devbook/>)

Published: 2012-12-17T00:00:00Z

Content type: article

Language: en

Sources: [Juri Strumpflohner](<https://devfeed.tech/sources/juri-strumpflohner.md>)

Topics: [software-development](<https://devfeed.tech/topics/software-development.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Web app](<https://devfeed.tech/topics/webapp.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Web](<https://devfeed.tech/topics/web.md>), [Learning](<https://devfeed.tech/topics/learning.md>)

Tags: [about](<https://devfeed.tech/tags/about.md>), [app](<https://devfeed.tech/tags/app.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [blog](<https://devfeed.tech/tags/blog.md>), [client](<https://devfeed.tech/tags/client.md>), [code](<https://devfeed.tech/tags/code.md>), [desktop](<https://devfeed.tech/tags/desktop.md>), [development](<https://devfeed.tech/tags/development.md>), [eclipse](<https://devfeed.tech/tags/eclipse.md>), [gist](<https://devfeed.tech/tags/gist.md>), [google](<https://devfeed.tech/tags/google.md>), [java](<https://devfeed.tech/tags/java.md>), [knowledge-base](<https://devfeed.tech/tags/knowledge-base.md>), [links](<https://devfeed.tech/tags/links.md>), [messaging](<https://devfeed.tech/tags/messaging.md>), [notebook](<https://devfeed.tech/tags/notebook.md>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [play](<https://devfeed.tech/tags/play.md>), [playground](<https://devfeed.tech/tags/playground.md>), [plugin](<https://devfeed.tech/tags/plugin.md>)

### AI overview

Devbook grew from Code Notebook, a Java Swing app the author created to save and organize development snippets while learning Java. Its features included real-time search, starring, labels, and exporting public snippets as static HTML pages. A later Eclipse RCP port served mainly as an experiment with the platform. The author then rebuilt the idea as a GWT web client hosted on Google App Engine, but says Devbook remained largely experimental. The excerpt notes that the original app used an MS Access database, which became a major limitation; it does not describe how that limitation was addressed.

### Source excerpt

Lorem ipsum dolor sit amet