Published inCodeX·Oct 1, 2023Effective and Idiomatic Error Handling in Kotlin (Tutorial)In many programs written in Kotlin, including those available on GitHub and in some articles, especially on Medium, I repeatedly see that authors handle errors, from my point of view, inefficiently and non-idiomatically. However, the program’s result can be correct. Inefficiency and ‘non-idiomaticity’ manifest in these cases when authors either…Kotlin27 min readKotlin27 min read
Published inCodeX·Jul 20, 2023Working with SI units in JavaThe KotUniL library, originally developed in Kotlin has recently become cross-platform. Specifically, it is now available in JavaScript, as discussed here. But why is this library needed? When programming in a traditional way, it is easy to overlook the units of measurement associated with the numbers we operate on. For…Java4 min readJava4 min read
Published inCodeX·Jul 15, 2023Working with the SI system units in JavaScriptWhen programming in a traditional way, it’s easy to overlook the units of measurement associated with the numbers we operate on. For example, you could add meters to liters, and no compiler will help us with that. This problem is real and has already been proven to lead to accidents…JavaScript2 min readJavaScript2 min read
Jan 29, 2023KotUniL = SI Units + Kotlin. Part Three: When only one unit test is enoughThis is the third and final article in a series devoted to the KotUniL library of the Kotlin language for working with physical and other dimensions. In this article we will see how fundamental scientific structures of SI-Uinit and specific features of Kotlin have affected the design of our library. …Kotlin11 min readKotlin11 min read
Jan 29, 2023KotUniL = SI Units + Kotlin. Part Two: Advanced FeaturesThis is the second article in a series of articles about the magic of dimensions and Kotlin on the example of the KotUniL library. These are the articles of this series: KotUniL = SI Units + Kotlin. Part One: Introduction to KotUniL KotUniL = SI Units + Kotlin. Part Two…Kotlin7 min readKotlin7 min read
Jan 28, 2023KotUniL = SI Units + Kotlin. Part One: Introduction to KotUniLAmperes cannot be added to volts. Centimetres can be added to inches, but very carefully. Otherwise, it will be like with the $125 million Mars Climate Orbiter spacecraft, which successfully reached Mars, but crashed miserably on its surface. It crashed because its software developers did not consider the difference in…Si Units5 min readSi Units5 min read
Published inCodeX·Dec 28, 2022Don’t trust ChatGPT and use KotUniLIn recent weeks, the media and social networks have been flooded with messages about dialogs with ChatGPT. I also tried to chat with ChatGPT. The result of our conversation is in the title. If you want to know why ChatGPT can not be trusted, and why it is better to…AI7 min readAI7 min read
Published inCodeX·Nov 25, 2022Programming is the materialization of ideasABSTRACT The paper introduces RPSE, Reification as a Paradigm of Software Engineering, and enumerates the most important theoretical and practical problems of the development and application of this paradigm. 1. BASIC DEFINITIONS Before pitching the thesis of this article, it is necessary to agree on the meaning of the main…11 min read11 min read
Published inCodeX·Aug 24, 2021Multi-arity functions in JavaLet me remind you: arity is the number of parameters of a function. Accordingly, multi-arity functions are functions with several parameters. In Java 8, functions were introduced with one and two input parameters. But what if there are more parameters? When you need a lot of input parameters In Java, there is a Function <X, R> and BiFunction…Java3 min readJava3 min read
Published inCodeX·Aug 18, 2021Code TexturesNo, this is not a typo. In this note, we are not talking about structures, but about textures, namely, textures of program code. To explain what it is and why this concept is important to me, I will tell you a story. It was a long time ago, in the…Code4 min readCode4 min read