PHPnews.io

Overview for 'oop'


Logging in Unit Tests, a Bad Practice

Written by Yegor Bugayenko / Original link on Aug. 11, 2021

Logging is an inevitable part of debugging. Well, at least in modern high-level programming languages and architectures. It wasn’t thirty years ago, in Assembly, but it is now. Sometimes we trace variables, but rarely. More often we just print them to console. Moreover, we don’t just print them usi…


Prestructors

Written by Yegor Bugayenko / Original link on Aug. 4, 2021

Making constructors pre-process the arguments before encapsulating them seems to be bad practice. However, very often it’s necessary to do exactly that: perform some manipulations with the objects provided as arguments and only then assign them to the attributes of the constructed object. For this…


Dataization

Written by Yegor Bugayenko / Original link on Feb. 10, 2021

There are three things in EOLANG (and the 𝜑-calculus which we based it on): data, atoms, and objects. There is a dataization function, which puts all three together in order to make an EO program alive. Here is how it works together with Java, for example. Space Force (2020) by Steve Carell and Gre…


Abstract Objects

Written by Yegor Bugayenko / Original link on Dec. 1, 2020

How do you create objects in your object-oriented language? Let’s take something classic, like C++, Java, or C#. First you define a class, and then you make an instance of it. The first step is known as abstraction, and the second one as instantiation. A similar pair of operations exist in function…


Objects Without Methods

Written by Yegor Bugayenko / Original link on Nov. 24, 2020

What do you think an object is in OOP? No matter what language you are programming with, you will most probably agree with Bruce Eckel, the author of Thinking in Java, who said that “each object has a state and operations that you can ask it to perform,” or Benjamin Evans, the author of Java in a…