Gabor Laszlo Hajba
Sep 2, 2017 · 2 min read

I recently started working on a ray tracer pet project. You may have seen it at GitHub.

In this article series, I’ll write about my decisions, why I’ve chosen the programming constructs I use.


The idea came from a book[1] I am reviewing. The book is about creating a ray tracer — but language agnostic. This means, there is no source code in the book, just pseudo code. This gives you an opportunity to use any programming language and coding style. And you get tests. This means you can write the application aided by TDD.

And the idea is really great. I was thinking about trying TDD many times in my not-so-long career but if you have nobody to encourage you (managers demand timely delivery, and learning TDD takes much time) I abandoned the idea. I’ve had some pet projects beside daily work, but there was the internal motivation missing to do TDD.

Now I get the tests, the project description and the tasks to do. The perfect combination.

First approach and basic set-up

My first approach is Java. This is the language I earn my daily bread with, therefore, I think this is the best starting point.

To give myself the best environment, I’ve set-up a Gradle project with Java 8 and Spock. Because the development time is not so critical, I’m developing in IntelliJ IDEA[2].

I’ve chosen Spock because I like the way you can use it for your tests. I’ll write a detailed article after I have used it for some time when I can see if it is worth using or not. And it doesn’t matter that I need Groovy and Java mixed-up in my project.

To see if my code in the repository is working, I’ve added a build on Travis CI. My idea behind this is, that sometimes I forget to push changes. On my computer, it works fine, but the repository is missing something…

After finishing the basic tuple, I’ll share my thoughts and insights about the solution. Stay tuned!

[1] I’ll write more about the book when it is available for purchase. Until that, I keep it mysterious.

[2] I need to learn all the shortcuts I use in Eclipse. Some of them are similar, others are not. One example is ⌘+D (I am working on a Mac): in Eclipse it deletes a line, in IntelliJ it duplicates it. I know that I can customize the shortcuts, but I won’t do that.

Ray Tracer Project

Follow my TDD-guided ray tracer implementations in different programming languages

Gabor Laszlo Hajba

Written by

Well grounded developer, mentor. I wear glasses.

Ray Tracer Project

Follow my TDD-guided ray tracer implementations in different programming languages

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade