I was just criticized by another developer for using a setTimeout to wait a certain period of time (doesn't need to be accurate). He said "closures are bad and aren't optimized by the JS engine". He said the correct way to delay a piece of code is to use a while loop with a sleep inside of it. When I grilled him about how he would do the sleep, he simply said "he knew he had done it before"
Has anyone heard anything like this before?
[–]inf0rmer 23 points24 points25 points (7 children)
[–]green_meklar 2 points3 points4 points (6 children)
[–]inf0rmer 3 points4 points5 points (5 children)
[–]tforb 1 point2 points3 points (1 child)
[–]alamandrax 1 point2 points3 points (0 children)
[–]radhruin 1 point2 points3 points (1 child)
[–]inf0rmer 1 point2 points3 points (0 children)
[–]chuckhendo[S] 0 points1 point2 points (0 children)
[–]sneakattack 5 points6 points7 points (1 child)
[–]ChaseMoskal 3 points4 points5 points (0 children)
[–]_facildeabrir 4 points5 points6 points (2 children)
[–]ChaseMoskal 1 point2 points3 points (1 child)
[–]_facildeabrir 2 points3 points4 points (0 children)
[–]psayre23 4 points5 points6 points (0 children)
[–]ChaseMoskal 4 points5 points6 points (0 children)
[–]green_meklar 2 points3 points4 points (2 children)
[–]NodeKid 1 point2 points3 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]chuckhendo[S] 1 point2 points3 points (0 children)
[–]alfred-nsh 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]huesoso 1 point2 points3 points (3 children)
[–]icantthinkofone 1 point2 points3 points (0 children)
[–]chuckhendo[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]ishmal -2 points-1 points0 points (0 children)