One of the best parts of being a software developer is that I’m constantly learning. The other day that I encountered a useful application of generics that I think is worth sharing. Normally when creating a fluent interface we want the ability to chain method calls together in a variety of different orders. And often in object oriented programming we put shared functionality in a base class and extend from that. Well unfortunately, in strongly typed languages such as Java these two desires are often at odds with each other. Continue reading…

I am happy to announce that I have finally lifted myself off of my lazy posterior and released the 0.1 (‘Zedoon’) version of my collection of Java tools. UQCLib is intended to be helpful and fun. This initial release contains as its main feature a form of peuso-closures for Java. You can read more about that here.

Documentation, code examples, and downloads are all available from the GitHub project page. The code is provided under the Apache License 2.0, and all are welcome to contribute. Now that everything is set up, I expect version 0.2 to arrive much faster. If you’re on GitHub follow the repository to see the updates as they come. 0.2 (‘Coreidae’) will focus on logging and simple state machines, and should be arriving around August.

Please enjoy, and feedback is appreciated! Email me at uqclib AT unquietcode DOT com.

As I continue to sketch ideas for my dream programming language (if such a thing can even exist), I’ve begun to embrace the idea of “event oriented programming”. Almost everything can be reduced to an event. A simple event can be thought of as a single statement in a linear sequence of statements. In a system without control flow every event is of this type, and each line will be executed in order, performing its intended action.

We know from decades of language development that this is not enough for all but the simplest of programs. The introduction of a ‘jump’ command allowed basic function calls to occur. First you store your location, jump to a different place, then you jump back (which we call ‘return’). Conditional branching, the ‘if/else’ statements, gave even more control over the running of a program. Again, this is really just another flavor of jump, with a test being performed and a jump ignored or taken accordingly.

Without touching the more ‘exotic’ control flows—stately ones such as ‘yield’ and continuations—the next big development (in my view) was the loop. Behind the scenes it’s just another conditional jump, but we begin to see the development of a small lifecycle here. Consider the standard ‘for’ loop: Continue reading…