We at The Coders Lexicon thought it might be advantageous for some of you learning Java to learn how you might structure something like a basic random quote generator. To make things a little more interesting, what if we read the quotes from a file and used a "try-with-resources" statement? That way we could add additional quotes to it over time and have the program generate random quotes on demand. ...
At this point I have been programming for nearly a quarter century. I have done multiple languages and worked with multiple platforms and technologies. Some of it can become quite complex and with that complexity comes extensive testing and solutions that just don't feel elegant at times. I often find myself asking the questions "How do I simplify this?" or "There has to be a simpler way, what is it?" ...
The ideas of functional programming have been around for a long time. This paradigm has several key principles that, while not exactly compatible with the Object-Oriented Programming (OOP) paradigm, do have credibility and advantages in their own right. Is functional programming better than OOP? In some ways yes, but in some ways no. It really depends on the problem you are trying to solve and the best way to think ...
If you are experienced in any of the major programming languages (.NET, Java, Python etc.) you are probably familiar with the idea of "Enums" or "Enumerations". These are used to help increase readability by assigning readable names to a collection of static values. It is much easier to read "Color.Red" than seeing "#FF0000" or "1". To expand on this idea imagine writing an if statement where you would compare a ...
One of the common topics you always see in programming articles is the one about proper use of exception handling and the try/catch mechanism (if supported by your language of choice). As you absorb the wisdom of the sacred text, looking for that nugget of information about how to do it properly, you almost always come across the idea of abstraction. The incantation often reads something like "Throw exceptions at ...
You may have heard of minimalism before in all sorts of disciplines and philosophies of life. Some of you might have heard of it as living without many possessions or perhaps in computing to refer to using as least amount of hardware and software resources as possible. I would like to take a small spin on perspective of applying this philosophy of life and apply it to writing code. While ...