▲ | veltas a day ago | |||||||||||||||||||||||||||||||||||||||||||
The environment variable isn't much better, both are akin to using a global var in your reentrant code, but at least STDDATA_FD is less likely to collide than 3. Can't wait for scripts using this variable for something unrelated to break when they call my scripts. This should be a parameter or argv[0]-based. | ||||||||||||||||||||||||||||||||||||||||||||
▲ | bcrl a day ago | parent [-] | |||||||||||||||||||||||||||||||||||||||||||
That doesn't work reliably either. No existing code scrubs STDDATA_FD from their environment variables, and there's no way to know if anyone uses STDDATA_FD in the wild. Why not just use a command line parameter like everyone else? Different isn't better in a situation like this. This is a larger concern I've started to see in a certain class of younger developer where existing conventions are just ignored without an attempt at understanding of why they exist. Things are only going to get worse as naive vibe coders start flinging more AI generated garbage out into the world. I pity the pole folks trying to maintain these systems a couple of decades from now. | ||||||||||||||||||||||||||||||||||||||||||||
|