Imagine Star Trek replicators but they work at the speed of modern 3d printers so Picard says "Tea, Earl Grey, Hot" and comes back 12 hours later to find half a cup, random glass fibres everywhere, and tea dripping on the floor.
Jonathan Lamothe likes this.
reshared this
patrislav ♾️ #RIPNatenom
in reply to Mike [SEC=OFFICIAL] • • •Pseudo Nym
in reply to patrislav ♾️ #RIPNatenom • • •@patrislav
Or just Alexa-style voice recognition
"Tea, Earl Grey, hot."
"Confirmed. Launching photon torpedoes."
"No! Cancel! Abort!"
"Understood. Transporting pants to cargo bay 5"
Hugo Slabbert ⚠️
in reply to Pseudo Nym • • •@pseudonym knowing the current state of software development, I mostly expect this one.
patrislav ♾️ #RIPNatenom
in reply to Hugo Slabbert ⚠️ • • •@pseudonym
Pseudo Nym
in reply to patrislav ♾️ #RIPNatenom • • •@patrislav @hugo
And this, kids, is why we don't use global variables.
#compSci
Mx. Chara Aznable of Pnictogen
in reply to Pseudo Nym • • •Jonathan Lamothe
in reply to Mx. Chara Aznable of Pnictogen • •@Mx. Chara Aznable of Pnictogen @Pseudo Nym @Hugo Slabbert ⚠️ @patrislav ♾️ #RIPNatenom because they pollute the global namespace and make testing more complicated. They have their place, but it's often preferable not to use them.
Edit: in the example from the meme, "hot" was a relative term, and should not have been defined globally, because changing its value in one place led to unexpected behaviour elsewhere.
like this
Pseudo Nym, patrislav ♾️ #RIPNatenom and Mx. Chara Aznable of Pnictogen like this.
Pseudo Nym
in reply to Mx. Chara Aznable of Pnictogen • • •@mxchara @patrislav @hugo
Like the meme above, confusion about purpose, side effects, unintentional / unexpected behavior changes.
Even environment variables are scoped to the processes and subprocesses under which they are set.
Set a global ENV variable, modify it in subchild 1, and that change is isolated and doesn't change parallel subchild 2.
Jonathan Lamothe
in reply to Pseudo Nym • •@Pseudo Nym @Hugo Slabbert ⚠️ @patrislav ♾️ #RIPNatenom @Mx. Chara Aznable of Pnictogen To be fair, a global variable is also generally scoped to the process inder which it is set. It doesn't generally exist outside of it.
Environment variables are one of those concessions we make when we want a quick and dirty way of passing a value from a process to a subprocess (though threre's also command line arguments). It's about knowing which tool is right for the job.
Mx. Chara Aznable of Pnictogen likes this.
Cy
in reply to Pseudo Nym • • •Pleb thinks setenv is global lol
int fd = open("/dev/shm/reallyreallyglobal", O_RDWR|O_CREAT, 0666);ftruncate(fd, sizeof(int));int* mem = (int*)mmap(NULL, sizeof(int), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);close(fd);*mem = 42;int pid = fork();if(pid == 0) { usleep(drand48()*123); *mem = 23; exit(0);}waitpid(pid, NULL, 0);pid = fork(); if(pid == 0) { usleep(drand48()*123); printf("Now THIS is a global %d\n", *mem); exit(456);}waitpid(pid, NULL, 0);
I_give_u_worms
in reply to patrislav ♾️ #RIPNatenom • • •sarcoptus scabium
in reply to Mike [SEC=OFFICIAL] • • •Colin
in reply to Mike [SEC=OFFICIAL] • • •FediThing
in reply to Mike [SEC=OFFICIAL] • • •Teasmade - Wikipedia
Contributors to Wikimedia projects (Wikimedia Foundation, Inc.)Brian Tatosky
in reply to Mike [SEC=OFFICIAL] • • •srslypascal
in reply to Mike [SEC=OFFICIAL] • • •These days, Picard would be presented by Coca-Cola Freestyle vending machines and by Carl's Jr. - Fuck You, I'm Eating.
Also, he'd be begging you to like, subscribe and comment below how long you've been waiting for your beverage.
I_give_u_worms
in reply to Mike [SEC=OFFICIAL] • • •Tak!
in reply to Mike [SEC=OFFICIAL] • • •groxx
in reply to Mike [SEC=OFFICIAL] • • •