Skip to content

Conversation

foxyblocks
Copy link
Contributor

This example should follow the guidelines about const vs var mentioned earlier

This example should follow the guidelines about `const` vs `var` mentioned earlier
@amcclain
Copy link

amcclain commented Jan 6, 2017

Except for those pesky leap years... 😉 Then there's also the consideration that this snippet would go and call that cron half a million+ times, immediately...

Maybe another example would be a bit more realistic? To throw something out there...

const SLOW_QUERY_LIMIT = 15000;
...
const startTime = Date.now();
...
if ((Date.now() - startTime) > SLOW_QUERY_LIMIT) {
  logSlowQuery();
}

@ryanmcdermott
Copy link
Owner

ryanmcdermott commented Jan 7, 2017

Hey! I like that second commit you have that changes the example. The more fun we can make this, let's do it! This can be a dry topic for some people, so I appreciate your creativity. There will be merge conflicts with the PR below, so can you remove your change to var/const?

Thanks!

#51

@amcclain
Copy link

amcclain commented Jan 7, 2017

Anyone who things this is a dry topic is in the wrong repo! 😄

(But very much yes, agree wholeheartedly on "more fun," and very cool to see crowd-sourced clean code in action. Thanks much for putting this out there.)

@foxyblocks
Copy link
Contributor Author

Conflicts fixed

@ryanmcdermott ryanmcdermott merged commit 50e5c1b into ryanmcdermott:master Jan 11, 2017
@ryanmcdermott
Copy link
Owner

Excellent, thank you Christian! It's a livelier example now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants