Hacker News new | ask | show | jobs
by orbital-decay 938 days ago
The author is the "Dr. Rant" (his own words) of Darktable, so a lot of what he says is probably exaggerated. A lot of it isn't, though - Darktable does indeed lack focus and direction lately, leading to unnecessary bloat and unresolved issues. In other words, typical FOSS problems that sometimes lead to a fork.
1 comments

Author has a blog post here, https://ansel.photos/en/news/darktable-dans-le-mur-au-ralent..., which exhibits some example code, for example, this: https://github.com/darktable-org/darktable/blob/darktable-4....

That's a far cry from what I'd find acceptable in any project.

The author is not wrong, the code really is crazy. Here's another random snippet from the ugly rewrite:

    for(char relative[] = "-2"; (relative[0] ^= '+' ^ '-') == '-' || ++relative[1] <= '9'; )
      gtk_list_store_insert_with_values(instances, NULL, -1, 0, relative, -1);
This is just pure excess cleverness. It's not even obvious how many times this loop runs for. There's a comment 1000 lines away that says this:

    #define NUM_INSTANCES 5 // or 3, but change char relative[] = "-2" to "-1"
This is just insanely unmaintainable code. If a string is warranted I would have just done the "stupid" thing with a `sprintf(buf, "%+d", relative);` to make it obviously correct, even if it seems "slower".
I had to think about what that loop does for an embarrassingly long time.

I’ve never seen XOR used as an in-place alternation operator like that in a for loop. I’ve only ever seen it used as a swap function not an inline expression.

I’ve also never seen a for loop that uses a mutable string updated char-by-char like that.

It’s just… special.

This just got added to some lists of interview questions.
Excellent links. My favorite part:

> However you put it, there is no valid reason for a software left open without touching it to turn the computer into a toaster, especially since we don’t buy Russian gas anymore.