Development Sandbox: Building A Better Math.pow() Function

I remember a long time ago I had read an article comparing two keys on a classic calculator. Someone had asked why the [Xy] key where y is equal to 2 is slower than the [X2] key. So I thought I’d have a look at the JVM’s equivalent function, Math.pow(). But also I wanted to see if I could create a better version of that function. Continue reading “Development Sandbox: Building A Better Math.pow() Function”

Ways to Learn a New Programming Language

Every programmer should be learning a new programming language on a regular basis. That’s every three, six or twelve months. For me, I like to vary my languages by paradigm. Object Oriented Programming. Functional Programming. Declarative versus Imperative Programming. Compiled Languages versus Scripting Languages. Dynamic versus Static Programming languages. There are two reasons I want to learn new languages. One, I like to apply what I’ve learned from one paradigm and apply it to my current situation. Second, I like to stay up to date on the needs of the industry and be ready for whatever may come. Continue reading “Ways to Learn a New Programming Language”

Development Sandbox: Coding Patterns

Java is a habit-forming programming language. After a few years, good programmers find efficient ways to code. They’ll accept the programming language’s shortcomings. And they’ll make the best of a not-so-good situation. Pair programming and code reviews have provided a means for programmers to share ideas. They learn from each other to write better and cleaner code. It’s a social experiment of sorts. The more you are exposed to other developers and their code, the more your skills improve. It’s an evolution. Continue reading “Development Sandbox: Coding Patterns”

Development Sandbox: Int to String Conversion

Recently, while reviewing some legacy code I discovered a trick a developer had used to convert an integer to a string. The developer did this because the function only accepted a string as a parameter. As developers, often we look for succinct ways to code thinking that less code is faster. The interesting thing about the code is that it was the slowest of all the tests I had done. In all my efforts, I found five different ways to code to a conversion of an integer to a string. Continue reading “Development Sandbox: Int to String Conversion”

Development Sandbox: String Concatenation

When you review and work with other people’s code you sometimes find some tricks to optimize your own code. Most of the time the tricks look impressive in their succinctness and streamlined approach. And so you’d assume that the performance behind the scenes would be mind-blowing. So I decided to have a look at string concatenation. I have seen a number of ways to concatenate strings. Usually, the ones that do everything within scope will do it properly. And there are concatenations done other ways for appropriate reasons. But I thought I’d still have a look at the many ways one can concatenate a string.

Continue reading “Development Sandbox: String Concatenation”

Development Sandbox: Java code inlining

Once in a while, it’s fun to take out the Java development tools and experiment. So I did just that. I went online and found a bytecode editor that does a quick job of parsing Java class files. I wanted to see what my code looked like in bytecode form. I wanted to test if a complicated if condition would get inlined. You know what I’m talking about. You’ve written that complicated condition fairly often. You need to validate that the variable you’re testing against is not null and is accessible. Continue reading “Development Sandbox: Java code inlining”

Taking on Machine Learning

About two months ago I took steps to get into the Machine Learning bandwaggon. It was tough to take that first step for many reasons. The first was the tough decision of choosing the right programming language to learn. Did I want to stick to the JVM and Java or chose another JVM language? Take up Python. Or learn something else. This article from KDnuggets made that decision much harder. Luckily, due to circumstances from a recent project, I decided to turn to Scala. And so far, I haven’t been disappointed. Continue reading “Taking on Machine Learning”

The Best Scala Programming Resources

In the last few weeks that I’ve spent learning Scala I’ve discovered several amazing online resources. So much so that it made it difficult to justify purchasing a book, even though I did buy the much-recommended Programming in Scala title. Every time I needed help in figuring out how to do something, the following websites were indispensable.

Some of these sites are no longer active, but the information they provide is still very much relevant to new and experienced Scala programmers. Continue reading “The Best Scala Programming Resources”

Four reasons to try Scala and love it

I’ve been working a lot with Scala in the last few weeks. It is an amazing programming language, to say the least. It’s terse, intuitive, unambiguous. And a real treat when you want to do stuff. It’s the programming language of the future. If only it would get more support and momentum going for it. Plus, the quantity of online resources available is just mind boggling.

Below are my N reasons why Scala is the best JVM language. Continue reading “Four reasons to try Scala and love it”

Why I decided to learn Scala

I find that anything worth learning should be done by jumping in head first. Then find something halfway challenging and go to it. Hence, this is how I went about learning Scala. I’ve recently learned to program in Groovy to develop Spock based unit tests. Groovy was the first JVM language I learned outside of Java. And being pleasantly surprised, I decided to try my hand at Scala.

Why I Chose Scala

My reasoning for wanting to learn Scala is to get into artificial intelligence without straying away from the JVM. I have played around with Python which I really liked. But embarking on Python would take me into a whole new ecosystem. And although I would love to get involved in Python and its data science tools, I think that long term Scala may be the better option. Continue reading “Why I decided to learn Scala”