Tag Archives: product idea

A code pretty printer product idea

I use QtCreator for my C++ development IDE. It is very good. But it doesn’t always lay out my C++ code the way I want it to. In particular the refactoring operations mess up my white space. I want my code to look like:

void foo( int* x, int& y )

But it keeps changing it to:

void foo(int *x, int &y)

Grrrrrr.

So I am constantly battling with QtCreator to layout my code how I like it. There are plenty of C++ pretty printers around. I played with some of the leading ones using UniversalIndentGUI, but I couldn’t get any of them to layout my code quite how I wanted. Maybe they could have done it, but I got fed up with fiddling with the settings.

What I need is a code pretty printer that I can configure to layout my code exactly how I want without me having to tweak 100 settings.

Ideally I want a code pretty printer that I can train. So I just point it at a few files of my code that are laid out how I want and it works out all my preferences (where to put braces, how to indent case statements, where to put the * for a pointer declaration etc) and can then apply them to any other code. It wouldn’t need a GUI. Or perhaps just enough to select the training files and then preview the results on other files.

I have no idea if this is a viable product idea. But I would pay $100 for it, if it worked well. Perhaps bigger software companies would pay a lot more? Or maybe something like this already exists and I just don’t know about it?