About writing (and coding)

I always wished I had an artistic talent of some sort. Lately, some friends of mine even diagnosed me to be a latent artist.I

The truth is however that I do not have this apparently innate facility which impresses us so strongly. I cannot draw, I sing out of tune and I am unable to play any instrument.

Yet, those artists which impress us would be the first to remind that what seems to be so easy for them is the fruit of hard work. I tried to begin working on those. I draw simple things sometimes but it is not very convincing yet. A friend of mine makes me notice each time I am out of tune, and I even bought a guitar from a friend (though I did not find the time to learn how to play it yet). There was a time when I edited videos as a dilettante, too, and the result was generally much appreciated, but taking time to make the slightest detail right made the editing of a video quite long.

I cannot believe I will be a performer in any of these arts. There is one last art I always felt attracted to: writing. I even tried some poetry when I was younger. I was proud of it at the time, but it was just child-written poems. I tried again later, with variable degrees of success.

My closest friend often asks me to proofread her written works, and thinks my writing is “excellent” (this is the word she used), but I never wrote any long fictions. I sometimes began some drafts, but always abandoned them soon after having begun.

Plus, writing takes three things: time, motivation/energy and inspiration. The hardest thing to find for me is inspiration. I usually have a beginning or a main idea, but generally no idea of where I want it to go or end.

Time is another difficulty: in today’s life, finding a slot you can use for yourself (while preserving enough sleep) can be a challenge. And the third problem is that often, when I manage to find time, I am usually worn out.

But then I realized: writing is what I do for a living. Not in a language most people can appreciate, not in a way that will make me recognized for any artistic talent, but still. Coding is writing.

Taking some words and punctuation, starting from nothing, assembling them in a correct way, you just create something new for others to enjoy.

There are all the same problems. You have ways to mistreat the language, and you also have several correct ways. And of course, you have some beautiful way, which are those I hope to find when I am coding. Of course, mastering the language when writing code and when writing fiction are not the same things.

The point is: I am already writing. And this is what I love about my job: when writing, I usually lack the inspiration, and I wish I had an idea tank to develop upon. At my work, I am given the ideas and asked to write them. There are constraints, of course, and sometimes I am not allowed to search for my ideal syntax, but on the whole, I just found a job matching my vocation.

Now I wish to write things anybody can read, so I will have a new take on some fictions I have been nurturing in my head for some time. Not sure I will not abandon them in some weeks too, but I will never know I if do not try. Ideas are getting more complex, and at some point, they must be shared, proved against a touchstone, and I guess I will never know their value if I do not take time to put them on paper.

Well, in a file actually. About this, I might publish a roundup of writing tools I used or discovered lately or earlier.

CRONs for Java: crontab4j

The first pre-stable version of my latest project crontab4j is now available.

What is it?

The name is plain enough: it allows you to schedule Java jobs using CRONs.

Before going further, keep in mind this version is a WIP. For instance, I heavily use regular expressions now (I love regexps), but I plan on moving to grammars to make things more scalable and easier to debug.

You said available?

Well, right. You can get the sources and compile it yourself, as any Maven project.

I might publish it to Maven later, when I get a stable 1.0.0 version. Until then, you will have to build by your own means.

Doesn’t it fit into the yet another category?

What does not, nowadays? Yes, I know of two other tools which can do the same.


Quartz is the well-known Java scheduling library. It is not CRON-centric, but it is powerful and integrates nicely inside a Spring context.

This is why I actually suggested, but my boss thought it might be too much for a simple job. So I took the challenge and wrote a simple parser for him. And made something more elaborate on the side.

So, is it really lighter? It does less things, so it better be! At the current time:

  • Quartz: 645 KB
  • crontab4j: 45KB

And this does not include the transitive dependencies: the goal was to get rid of everything useless. Quartz has been progressing on this aspect, but just before version 2, it had nine dependencies, not counting the transitives. Now it only has two. I must wait to have a stable version before bragging.


I did not know of cron4j before I looked to see if the name was already taken, which made me choose crontab4j to avoid confusion.

So, why did I persevere in making crontab4j? First, because I already had taken up the challenge. Second, because I keep in mind that most Java applications today use a Spring context, and therefore need compatible tools, which I aim to provide.

What’s next?

I have established a roadmap, you can see it along with the rest of the project: https://cychop.github.io/crontab4j/.

More to come…

How to determine the best implementation of a Java method

Short answer

  1. Write alternative versions of the method you want to test. They should be named as the original, and suffixed with an index. The rest of the signature must not change.
  2. Download the java-implementation-comparer project from Github.
  3. Build it to add it to your local Maven repository: mvn install
  4. Create a test project importing both:
    • the project you want to test;
    • thejava-implementation-comparer:
  5. Create a test class and write the little code you need:
  6. Just enjoy your comparison:

Something more detailed

Continue reading How to determine the best implementation of a Java method