Usage of artifical intelligence (AI) and large language models (LLM) to write code, comments, documentation etc. is the hottest topic for months now. Most of that attention is directed to the ChatGPT but by no means it’s the only game in town. Today I want to explore Character.AI and contrast it to the previous article in which I explored how ChatGPT writes Java code. Character.AI is actually a bunch of differently adjusted models which are known as characters (hence the name) that are claimed to be experts in different skills. The one that caught my attention is called Bug Basher and he claims to be Expert Programmer. Bold claims need bold evidence so let’s “grill” Bug Basher with writing some Java code!

When hearing the words “type inference”, most developers probably think of local-variable type inference that arrived in Java 10. But type inference in Java is much older than that. Some sort of it existed even in Java 6, where compilers could infer type parameters of generic constructors! For sure the most famous type inference example is the diamond operator in Java 7. Since the beginning, mere reduction of number of characters used in source code went hand in hand with type inference. But is that its biggest advantage?

Manipulating a group of objects is something every Java developer does almost every day. In those situations, a lot of developers turn to some concrete collections such as ArrayList or HashSet without second thought. More experienced ones try to avoid accepting concrete classes and use some interface like java.util.List, and even more experienced ones turn to java.util.Collection. But sometimes we don’t need a collection at all, only the ability to iterate over some objects and for those needs, Iterable is beautiful! Let’s see how to improve your programs by using java.lang.Iterable<T>.

String manipulation is one of the most fundamental tasks of every developer. We create strings, read them, cut them, join them, pad them and generally do dozens of different processing activities on them. One of the most common of those is sorting. On the first glance, sorting looks like an easy and long solved problem… if you’re only dealing with 26 letters of an english alphabet that is. For almost any real-world application, sorting is filled with gotchas and intricacies. In this ultimate guide to string sorting I’ll dive deeply and answer questions of sorting strings with numbers, in mixed upper case and lower case, with accented letters etc. Fasten your seatbelts!