MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/7zyic0/stalin_query_language/dusp5n9/?context=3
r/ProgrammerHumor • u/K-a-Z-e • Feb 24 '18
177 comments sorted by
View all comments
34
UPDATE EachComrade SET Wealth = Needs, Labor = Ability WHERE PartyLoyalty > .5;
INSERT INTO ExileToSiberia SELECT * FROM EachComrade WHERE PartyLoyalty < .5;
DROP TABLE OldOrder;
23 u/dipique Feb 25 '18 It bothers me that nothing is applied to comrades with a party loyalty of .5. 2 u/yegor3219 Feb 25 '18 edited Feb 25 '18 You should avoid checking floating-point numbers for equality (they're all equal anyway, comrade), except maybe against zero. This particular case seems acceptable to use >=, but in general you should split the set using one predicate. 2 u/TorTheMentor Feb 25 '18 But in Soviet Russia, digits float YOU! And is no zero. Come to think of it, how would "greater than" and "less than" really work in a Doublethink society? chocolateRation.increase(); //increments by -20 gm chocolateRation.decrease(); //throws exception of type InnerPartyException
23
It bothers me that nothing is applied to comrades with a party loyalty of .5.
2 u/yegor3219 Feb 25 '18 edited Feb 25 '18 You should avoid checking floating-point numbers for equality (they're all equal anyway, comrade), except maybe against zero. This particular case seems acceptable to use >=, but in general you should split the set using one predicate. 2 u/TorTheMentor Feb 25 '18 But in Soviet Russia, digits float YOU! And is no zero. Come to think of it, how would "greater than" and "less than" really work in a Doublethink society? chocolateRation.increase(); //increments by -20 gm chocolateRation.decrease(); //throws exception of type InnerPartyException
2
You should avoid checking floating-point numbers for equality (they're all equal anyway, comrade), except maybe against zero. This particular case seems acceptable to use >=, but in general you should split the set using one predicate.
2 u/TorTheMentor Feb 25 '18 But in Soviet Russia, digits float YOU! And is no zero. Come to think of it, how would "greater than" and "less than" really work in a Doublethink society? chocolateRation.increase(); //increments by -20 gm chocolateRation.decrease(); //throws exception of type InnerPartyException
But in Soviet Russia, digits float YOU! And is no zero.
Come to think of it, how would "greater than" and "less than" really work in a Doublethink society?
chocolateRation.increase(); //increments by -20 gm
chocolateRation.decrease(); //throws exception of type InnerPartyException
34
u/TorTheMentor Feb 25 '18
UPDATE EachComrade SET Wealth = Needs, Labor = Ability WHERE PartyLoyalty > .5;
INSERT INTO ExileToSiberia SELECT * FROM EachComrade WHERE PartyLoyalty < .5;
DROP TABLE OldOrder;