Post #3650250
2026-07-02 05:43 UTC
@pinskia@hachyderm.io by visit you mean the oop visitor pattern or ? if yes, i agree
Replies (1)
-
@pinskia@hachyderm.io 2026-07-02 05:47
@SRAZKVT@tech.lgbt yes oop vistor pattern. What I find in the code that does those kind of is missing part of the point of oop. Most of the time the vistor code should belong with the class itself rather than having a seperate vistor class. A big example of over use of the oop vistor code is the p4c compiler. When I wrote my own P4 front-end. I used oop/classes but things like cloning and "generics" replacement and folding was handled by each AST itself rather than a vistor class for each of those things.