Olaf Schlüter
Dec 29, 2022

1st example: write

completed?.millisecondsSinceEpoch ?? 0

and you may stop complaining. The compiler will do.

2nd example: the first two if-clauses could be combined for improved readability. The comparison with the empty string would become more understandable and readable if you use the isNotEmpty()-Method on task.category.

Your 3rd example has a point though: late is dangerous and it should not be needed for complex property initialization in the constructor. I know no other language that requires something like this. But you can avoid the getters by declaring the properties final and public.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Olaf Schlüter
Olaf Schlüter

Written by Olaf Schlüter

IT security specialist, Physicist by education, believing in God as for the exceptional harmony of the laws of nature to create and support life.

Responses (1)

Write a response