Overview for 'oop'
Written by Yegor Bugayenko
/ Original link
on Aug. 10, 2022
A few months ago I made a small Java library, which is worth explaining since the design of its classes and interfaces is pretty unusual. It’s very much object-oriented for a pretty imperative task: building a pipeline of document transformations. The goal was to do this in a declarative and immuta…
Written by Yegor Bugayenko
/ Original link
on Jun. 5, 2022
Reflective programming (or reflection) happens when your code changes itself on the fly. For example, a method of a class, when we call it, among other things adds a new method to the class (also known as monkey patching). Java, Python, PHP, JavaScript, you name it—they all have this “powerful” fea…
Written by Yegor Bugayenko
/ Original link
on Oct. 21, 2021
Since the time of Kernighan and Ritchie we share binary code in libraries. You need to print some text with printf() in C++? You get libc library with 700+ other functions inside. You need to copy a Java stream? You get Apache Commons IO with copy() and 140+ other methods and classes. The same happ…
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…
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…
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…