Re:Making code better with code reviews
by raverbashing on Wednesday July 02, 2014 @10:11AM
(#7977050)
> but repeating `// seconds per hour` as a comment everywhere you use the number 3600 seems a little silly when you can just use a constant
Yes, so if it's only one case you can have the comment
Now, if you're doing it a lot of times I bet your problem is bigger than just adding a constant, it may be even better to turn this into a function so you do to_seconds(time_in_hours) or something
Yes, so if it's only one case you can have the comment
Now, if you're doing it a lot of times I bet your problem is bigger than just adding a constant, it may be even better to turn this into a function so you do to_seconds(time_in_hours) or something