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”
Tag: development
Development Sandbox: My Coding Guidelines
Great programming is a balancing act between writing good, readable and organized code. Good code is fast, efficient and memory conscious. Good code is also very easy to read and to understand. But also the way the code is organized is of the utmost importance. It’s a balancing act because sometimes fast and ugly code needs to give way to readable code. A single linear function that’s optimized to the nines may be super efficient. But it’s also a maintenance nightmare. Continue reading “Development Sandbox: My Coding Guidelines”
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: 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”