Elektrine lite

← Feed

@pinskia@hachyderm.io

Post #3625855

2026-07-02 05:16 UTC

I find the code that uses visit style programming bad. Sorry LLVM; I think it is badly written code and is a bad style of code in general. Yes some folks are adding that style to GCC for the rust front-end. But I think there are better ways of writing the code. Especially when there are things like statements that would share the same code. Yes I would say C++ code popularized it and I think it is poorly thought out code.

Replies (2)

  • @rjmccall@hachyderm.io 2026-07-02 05:40

    @pinskia@hachyderm.io If specific cases habitually share code with each other (or should usually be looked through), you can just teach your visitor about that. Done well, it’s a really nice way to abstract over different patterns of exhaustive pattern matching snd can make sense even in languages with decent pattern matching built in. Having to manually handle all the data flow in and out can be a pain, but on balance I still think it’s good.

    Open ##3650240

  • @SRAZKVT@tech.lgbt 2026-07-02 05:43

    @pinskia@hachyderm.io by visit you mean the oop visitor pattern or ? if yes, i agree

    Open ##3650250