The Stack Overflow podcast is back! Listen to an interview with our new CEO.
7

Exception If your algorithm cannot find a date, it is easier to raise an Exception than to return ''. Returning sentinel values instead of exceptions can lead to unexpected behaviour if the user of this function does not test for this sentinel value. comments Comments should explain why you did something, not how. # Take the last four digits tells you ...


2

Any better/simple solution to do this ? Yes. Functionality now built-in. java.time.LocalDate::datesUntil ➙ Stream of LocalDate objects The modern approach uses java.time classes. The java.time.LocalDate has built-in support for generating a stream of dates. Call LocalDate::datesUntil. I do not know Scala, so here is Java syntax. LocalDate today = ...


Only top voted, non community-wiki answers of a minimum length are eligible