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”

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”

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”

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”

Developing a pattern to your coding process

A lot of people will learn great things and become extremely good at those things. But a lot of those people, although they are very good at what they do, may not have a formal process that they are aware of. Or may not have discovered a pattern to that process.

I’ve recently been doing a lot of coding exercises on HackerRank. And I’ve discovered a simple process to development. Something I’ve always been doing but never thought much about. Sure, there are a lot of processes involved in software development. This includes TDD, integration testing, CI, CD, and so on. But there’s an even simpler one that I’ve been taking for granted. Continue reading “Developing a pattern to your coding process”

Edit and execute programming code online quick

Ever wish you could test a snippet of code? Online. Like now! Or focus on improving an algorithm in isolation. Or have a moment of clarity and need to write a piece of code lickety-split. Yesterday, I found this online tool to do just that. That’s good for me, as I don’t have to create a whole new project in IntelliJ IDEA or use the CLI tools.

CodePad supports several of the most used programming languages. Unfortunately, it doesn’t support Haskell, a language I’d like to tackle this year. But for Scala, it’s really good.

The tool itself is easy to use and the compiler quick enough. In my case, I was using it to optimise a piece of Scala code to submit for an online coding exercise.

codepad

Website: https://codepad.remoteinterview.io

How to become the best mad skills programmer

Learning to program in a new language can often be difficult. First, you have to learn the basics to code “Hello World”. Then comes the challenge of learning to use the advanced features. And finally, the challenge of using the language the way the creator had intended.

The challenge is finding exciting exercises and projects to tackle. Something big enough to sink your teeth in. Yet not so big that the challenge seems impossible. Continue reading “How to become the best mad skills programmer”

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”