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 ...
After a while of web development, developers usually come across a project where they need to create multiple submit buttons with a single form. This usually occurs right when they have a table that has several rows and each row has a couple buttons to edit or delete the row. These rows might have been added dynamically using JavaScript or they could have been simply created sever-side as the table ...
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 ...