The Coding Flow

Code Clean Or Die Tryin'

  • Using the myAVR “mySmartUSB light” under Linux in the Arduino IDE

    I recently bought a handful of Arduino Nano clones, just in order to learn that for a price of 4€ per CPU it is not granted that there is a bootloader on the ATmega328P. Hence I needed an “in-system-programmer” to be able to install the bootloader. I found the “mySmartUSB light” from myAVR at Conrad for a reasonable price. The device works in principle on Linux with avrdude, given that you have a driver for the “CP210x USB to UART Bridge” already installed.

    Read more…
  • Help! Gradle is using a different version of a library to build my extension/plug-in!

    Just a note for myself that might also help others. Symptoms: When building your Gradle extension/plug-in, strange compile errors occur. E.g. the compiler can’t find methods, which are obviously there when you look into the library’s code. Problem: Gradle carries a lot libraries. It is likely that you want to use one of those libraries in a more recent version. Gradle adds its libraries to the classpath when you add compile gradleApi() to your dependencies.

    Read more…
  • The secret step to save your software from the creeping death of unmaintainability

    Abstract Software which is developed over several years usually tends to come into a state, where the effort and risk of change increases dramatically with each new feature. This often ends at the point, where either nobody dares to take the risk of any further change, or it is simply too expensive to implement a new feature. What is necessary to guard against this destiny and keep a software fit for change even after years of development?

    Read more…
  • null

    The Problem References to objects may be empty, i.e. they may not reference a particular object at all. In this case, their value is null. Whenever you want to access an object using such a reference, you have to make sure, that the reference is not null. Otherwise Java punishes every access to null with a NullPointerException. There are different ways to take care of the null case in Java. But we start a discussion, we first need a small example to talk about: The method getUserData(int userId): UserData fetches the data of the user with the given userId from a data store.

    Read more…
  • Oomph vs. Groundhog Day

    Ahh, summertime: sunny weather, lots of barbecue and new a Eclipse release. As every year, this also means finding out again, which useful plug-ins you did install during the course of the last year, which tweaks you did to your Eclipse installation. All this just in order to reproduce your development environment based on the latest and greatest features from Mars. Sure, there is this new installer based on Oomph, that does the downloading and all this crazy stuff to prepare your workspace.

    Read more…
  • Processing Data in Tree Structures

    In Vex there exist several tree structures, the most prominent are the XML DOM (semantics) and the box model (representation). Both structures consist of a heterogeneous set of node types which serve different purposes. The one thing that all nodes in a tree have in common is the responsibility to form the tree structure itself. Most tasks that are not related to the structure only involve a subset of node types.

    Read more…
  • How the Cursor Learned to Move

    While implementing the new box model for Vex, I came to the point, where I needed a representation for the cursor. I started with a very simple class that knew how to draw the cursor at a given offset. That’s easy to understand, one simple responsibility in one class: SRP check! But then there happend what always happens when you have a simple and elegant solution in place: there was a new requirement: I needed the ability to move the cursor.

    Read more…
  • Double Buffering in SWT

    To draw the contents of a custom widget in SWT, you have to implement a PaintListener. The paint method is the only place where you have access to the widget’s GC (aka “Graphic Context”), which provides the actual drawing methods.Paint events are handled in the Display thread. This means, the UI is not responding while you are drawing. If you do complex calculations while drawing, this results in flickering. To prevent this flickering and to keep the UI responsive, the usual approach is to use double buffering: you use two buffers, one is used for drawing and one is visible.

    Read more…
  • The Maintenance Analogy

    In engineering, maintenance means to tear a machine apart, clean it, replace broken parts, oil it and put everything together as it was before. Maintenance is needed to ensure the longevity, the quality of service and also the safety of a machine. Some people say, that this is not needed for software. Bits do not wear out or break and bits do not need recurrent lubrication. You know what: they are right.

    Read more…