Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
The year number is given (positive integer). The task is to determine the amount of
days in this year, taking into account that there are 365 days in average year and 366 days in
leap year . A leap year is a year, which is devided by 4.
Exception is those years that are divided by 100 and are not divided by 400
(For example, the years 300, 1300, and 1900 are not leap years, but 1200 and 2000
Would you please look through my code and say what is wrong with it.
Vital Jays wrote:And for the future I will put some spaces in my text.
I wasn't referring to your text, I was referring to your code. And going overboard with the spaces is just as bad as not having any. I was simply trying to make a point. Your response with too many spaces borders on sarcasm (or could be misconstrued as such and thus would not be very well appreciated).
Your code would have been more readable if you had written:
To make it even more readable, you could have extracted the formula to a method: