Tag Archives: C

Enforcing better software engineering on myself, an experiment

I like to pretend I am a software engineer despite being enrolled in my university’s computer science program.

One of the many was I need to improve as a software engineering is to keep code with at the same level of abstraction. An example of a failure to maintain coherent abstraction would be to manipulate a linked list in the same function you manipulate a different list using proper accessors methods. Instead you should be using methods for both lists.

In libjtapi I am experimenting with not having header files. This will force me to treat the libjtapi call-stack like a Directed Acyclic Graph. The important part being the acyclic attribute. This means that a low level function cannot call a higher level function, this is enforced by the compiler. I thus have to think hard about which layer of abstraction I am coding in at any point in time.

Or at least that is the hypothesis, I’ll see how the code matures.

libjtapi first code

After struggling with netbeans as a build platform I’ve switched to cmake.

The motivation for netbeans was to reduce the initial barriers to development. I expected that an eventual move to a full-fledged build system would be needed but I wanted to put that off until libjtapi had a substantial codebase. The good news is that cmake was much easier to setup than I expected. Thus I have now started on libjtapi proper.

My next milestone is to get the libjtapi hello world compiling.

Then fill out the dummy functions so that the hello world does what it is supposed to do.

Then refactor and code review.

 

Play&Pause a XBMC remote app

I have a XBMC HTPC in my dorm room acting as my sound system. One annoyance I had in the past was a lack of proper remote control. At first I used a cheap Android Tablet bought from china but the incredibly short battery life on it made it impractical.

After dealing with those half-solutions I decided to create my own. Programmed in C++ Qt it can run on just about any platform but I targeted it for my meamo n900 and the meego emulator. It primraly works with the music player and features skip, play/pause, and volume control. The download: PlayAndPauseXBMC_2011-03-28.zip The zip contains the source, and binary builds for x86 and Maemo. Both my laptop and phone have the remote running 24/7 and I’m quite enjoying the convenience.