Cloud Solutions Are Expensive, or Are They?

Cloud solutions are becoming increasingly prevalent. I’ve observed their adoption even among companies that were traditionally very conservative. Previously, these organizations insisted that no data leave their premises, operating all applications within data centers safeguarded by two-meter-thick, steel-reinforced concrete walls. However, these companies are now beginning to explore and adopt cloud solutions, simultaneously becoming aware of the true costs associated with cloud computing.

In this article, I will delve into the costs associated with cloud solutions. While this is not a technical piece, a basic understanding of cloud computing might be beneficial, though I will aim to provide an overview rather than delve into technical specifics.

Programming With AI

I recently discussed how we use Co-Pilot and ChatGPT for programming with some of my senior colleagues. We discussed our experiences, how and when it helps, and what to expect from it in the future.

In this article, I will shortly write about what I imagine the future of programming with AI will be. This is not about what AI will do in programming in the future. I have no idea about that, and based on my mood, I either look forward amazed or in fear. This article is more about how we, programmers, will do our work in the future.

Managing IntelliJ Live Templates

I primarily use IntelliJ for the majority of my work nowadays. This integrated editor and development environment offers numerous excellent features, one of which is the live templates feature. I have chosen to assist Jamal with the implementation of live templates.

Within this article, I will elucidate the methodology I have devised for editing and maintaining the live templates.

Adding Mermaid Diagrams to Markdown Documents

Mermaid is a trendy diagramming tool. A year ago, it was integrated into the Markdown rendering of GitHub. It is also integrated into several editors (see "Include diagrams in your Markdown files with Mermaid" for more information).

What can you do, however, if you use a different editor? What if you want to use your Markdown document in an environment that does not integrate Mermaid yet? What can you do if the diagram is not Mermaid but PlantUML, Graphviz, or any other diagramming tool?

A Few Words About Rust for Managers

This article is for developers and managers who have heard about Rust but do not know much about it. It is not a tutorial. I write what I see and give some unsolicited—or assuming you read it not by accident, then solicited—advice.

Introduction

This article is a few words about Rust.

Hidden Classes in Java 15

Java has had anonymous classes from the very start. (Well, actually, they came in version 1.1.) However, anonymous classes were not anonymous. You did not need to name them, but under the hood, they were named by the Java compiler. If you are familiar with the command javap, you can "disassemble" a JAR file and see the name of the compiler generated for the anonymous classes.

Java 15 introduced hidden classes, which do not have a name. Almost, as you will see. It is not part of the language but part of the JDK. There is no language element to create hidden classes, but JDK methods and classes come to the rescue.

Java: Unit Testing Private Methods

Introduction

In this article, I will contemplate the testing of private methods in unit tests. After that, I will propose a way or pattern to do it, if you must. Finally, I will show how you can generate this pattern automatically.

And yes, I will also write a takeaway section to know what you have read.

Supporting Java 8

Learn how you can provide Java 8 support.

Although we are on Java 13, there are a lot of production installations running with Java 8. As a professional, I developed Java 8 code many times, even these days, and I have to be happy that this is not Java 6. On the other hand, as an open-source developer, I have the liberty to develop Java code using Java 11, 12, or even 13 if that pleases me. And it does.

On the other hand, though, I want my code to be used. Developing a tool like License3j or Java::Geci, which are kind of libraries releasing Java 11-compatible bytecode, cuts off all the Java-8-based applications that may use these libraries.

Handling Repeated Code Automatically

Learn how to deal with repeated Java code automatically!

In this article, I will describe how you can use the Java::Geci generator Repeated to overcome the Java language shortage that generics cannot be primitive. The example is a suggested extension of the Apache Commons Lang library.

When you copy-paste code, you do something wrong. At least that is the perception. You have to create your code structure in a more generalized way so that you can use different parameters instead of similar code many times.

Your Code Is Redundant, Live With It!

Your code IS redundant, live with it!

This article is about necessary, and unavoidable, code redundancy. We look closer at a model of code redundancy that helps to better understand why source code generators do what they do, and why they are even needed at all.

You may also like: Duplication Vs. Redundancy in Code

The code you write in Java, or for that matter, in any other language, is redundant. Not by the definition that says (per Wikipedia page https://en.wikipedia.org/wiki/Redundant_code):

Java Hexadecimal Floating Point Literal

I was developing a new functionality into Java::Geci to make it less prone to code reformatting. The current release of the code will overwrite an otherwise identical code if it was reformatted. It is annoying since it is fairly easy to press the reformatting key shortcut and many projects even require that developers set their editor to automatically format the code upon save. In those cases, Java::Geci cannot be used because as soon as the code is reformatted, the generator thinks that the code it generates is not the same as the one already in the source file, updates it, and signals the change of the code failing the unit tests.

The solution I was crafting compares the Java source files — first, converting them to a list of lexical elements. That way, you can even reformat the code inserting new lines, spaces, etc., so long as long the code remains the same. To do that, I needed a simplified lexical analyzer for Java. Writing a lexical analyzer is not a big deal, I created several for different reasons since I first read the Dragon Book in 1987. The only thing I really needed is the precise definition of what are the string, character, number literals, the keywords, and so on. In short, what is the definition of the Java language on the lexical level and how is it processed. Fortunately, there is a precise definition for that, the Java Language Specification, which is not only precise but also readable and has examples. So, I started to read the corresponding chapters.

Converting Objects to Map and Back

In large enterprise applications, sometimes, we need to convert data objects to and from Map. Usually, it is an intermediate step to a special serialization. If it is possible to use something standard, then it is better to use that, but many times, the architecture envisioned by some lead architect, the rigid environment, or some similar reason does not make it possible to use JOOQ, Hibernate, Jackson, JAX, or something similar. In such a situation, as it happened to me a few years ago, we have to convert the objects to some proprietary format being string or binary, and the first step towards that direction is to convert the object to a Map.

Eventually, the conversion is more complex than just:

Reflection Selector Expression

Java::Geci is a code generator that runs during unit test time. If the generated code fits the actual version of the source code, then the test does not fail. If there is a need for any modification, then the tests modify the source code and fail. For example, there is a new field that needs a setter and getter. Then, the accessor generator will generate the new setter and getter and then it fails. If there is no new field, then the generated code is just the one that is already there — no reason to touch the source code: The test that started the generator finishes successfully.

Because Java::Geci generators run as tests, which is at run-time, and because they need access to the Java code structures for which they generate code, Java reflection is key for these generators.