MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/j90bx6/javascript_can_keep_you_safe/g8isv2b/?context=3
r/learnjavascript • u/weoter • Oct 11 '20
87 comments sorted by
View all comments
16
- use of var
- snake case variable naming
- upper camel case method naming
- use of while loop
Yikes man
0 u/DrKrepz Oct 11 '20 var still had legitimate use cases. If you want a mutable variable that doesn't create a new block of scope, var is a perfectly good choice.Also, using different naming conventions for variables Vs functions or methods can help to make code more readable.As for while... I don't use it but interested to know why it might be problematic. 1 u/[deleted] Oct 11 '20 To your point on use of var, perhaps the author(s) of this billboard intended for still_alive to be globally scoped for access by other billboards in the area... XDIgnore me, I have a terrible sense of humor.
0
var still had legitimate use cases. If you want a mutable variable that doesn't create a new block of scope, var is a perfectly good choice.
Also, using different naming conventions for variables Vs functions or methods can help to make code more readable.
As for while... I don't use it but interested to know why it might be problematic.
1 u/[deleted] Oct 11 '20 To your point on use of var, perhaps the author(s) of this billboard intended for still_alive to be globally scoped for access by other billboards in the area... XDIgnore me, I have a terrible sense of humor.
1
To your point on use of var, perhaps the author(s) of this billboard intended for still_alive to be globally scoped for access by other billboards in the area... XD
var
still_alive
Ignore me, I have a terrible sense of humor.
16
u/throwaway1253328 Oct 11 '20
- use of var
- snake case variable naming
- upper camel case method naming
- use of while loop
Yikes man