Fortsätt till huvudinnehåll

Inlägg

Visar inlägg från april, 2016

Hey, there's a framework for that

Remember the iPhone 3G commercial  "There's an app for that" ? I got a similar feeling yesterday when I discussed my current mini-project "The Record Collector" with an old collegue of mine. Just after giving him the summary he said "Oh, so you are using Play?". Play, I thought, what is that? Well, it turns out that  Play  is a framework that "makes it easy to build web applications Java & Scala". I haven't thought of The Record Collector as a web application, but maybe it should be... Need to sleep on it.

Coding Dojo for smart memory usage

The target hardware that I develop for at work have several types of memory. Some are fast, but extremely limited, others are large but not that fast. As a developer for that architecture it is very important to make wise choices when it comes to how to use the different types of memory (no tools are available for helping out, it is all up to the developer). Several new developers with limited or no experience of developing under these cirumstances have recently joined us. In order to help them understand the impact different memory usage can have I have started to prepare material for a  Coding Dojo  which will start off with a non-optimal memory model and by applying some simple patterns they should be able to optimize the performance by several hundered percent. Looking forward to sharing my knowledge. We all should, as much as possible.

The Record Collector, now with simple CLI

Some must haves -  like adding and removing records - are still missing but now there is a CLI. Currently it allows setting the database URL, the default user name, and to query the database and list all records (see screenshot below). Under the hood I use  args4j  for parsing command line arguments/options and  Preferences  for storing the user preferences. As usual the code can be found on  GitHub .

Tasty mocking framework

Mockito  is now being used in  TheRecordCollector . So far I use it for mocking user settings and database interactions. It seems like a highly capable mock framework and I have just started to scratch the surface. Adding Mockito to your Gradle or Maven project and getting started is super simple (check the Mockito main page). I understand why  Java is the most popular programming language today .

Let learning take time

I've read somewhere that the most time consuming part of programming is learning. Yesterday I got some hands on experience of this when solving three Codility tasks in a limited time. The time given to solve the tasks was generous, still I failed to deliver proper, well tested and clean solutions. And my self confidence dropped a couple of levels. Then I started thinking of why I was unable to deliver better solutions and I realized I had spent most of the time given not solving the actual tasks, but rather trying out and learning how to do certain things, like slicing up strings, working with date and time and so on, in Java. The Codility tasks were to be solved using the Structured Query Language (SQL) and Java. Two languages I really wan't to add to my toolbox but have limited experience with. The second Java task involved (amongst other) extracting time (hours, minutes, and seconds) from strings and converting them to Java objects that can be added together and compare

Code at work, code at home, dream of coding

I still remember my first lines of code. Ten years old, C64 BASIC, 10 PRINT "Eric "; 20 GOTO 10;. Now 26 years later I do more coding than ever. I code at work, at home and even dream of solving coding tasks (actually I am a bit concerned about the dreams part, doesn't feel all that healthy). I believe the best thing about coding is that it is so easy to get started and no matter how much you learn there is always so much more to pick up. Recently I have been started thinking about ways to show my oldest son things you can do with code. He can not read much yet so showing him lines of code won't give anything just yet. I have heard about some apps and games where you code using pictures in sequence. Will check what I can find and put up some reviews here later.

Some links to look more at

This post is a "note to self" to look more into these links: https://blog.idrsolutions.com/2013/09/5-tools-to-help-you-write-better-java-code/ https://blog.idrsolutions.com/2014/06/java-performance-tuning-tools/ I am looking for tools for static code- and performance analysis on Java code.