1721 1241 1642 1910 1693 1501 1040 1968 1147 1204 1603 1882 1318 1748 1767 1631 1093 1191 1520 1101 1834 1424 1655 1974 1316 1292 1897 1446 1266 1566 1391 1255 1962 1884 1810 1911 1866 1674 1408 1090 1462 1541 1698 1902 1906 1547 1441 1919 1572 1844 1550 1873 1909 1166 1496 1686 1419 1488 1321 1107 1295 1250 1943 1582 1829 1241 1774 1274 1392 1717 1650 1799 1438 1217 1641 1411 1519 1161 1324 1633 1800 1152 1416 1621 1097 1873 1953 1199 1269 1033 1459 1242 1705 1484 1645 1593 1761 1597 1150 PHPnews.io | The amazing payoff goes here

PHPnews.io

Overview for 'oop'


Reflection Means Hidden Coupling

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…



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…