r/ProgrammerHumor • • Jul 08 '20

Meme Your IDE when you declare a new method

24.7k Upvotes

365 comments sorted by

View all comments

Show parent comments

26

u/[deleted] Jul 08 '20

Cries in Kotlin.

16

u/dpsinghvij Jul 09 '20

TODO() ???

9

u/[deleted] Jul 09 '20

Shhhh... I'm meeming.

3

u/kjm015 Jul 09 '20

fun myHopesAndDreams(): String? = null

1

u/well___duh Jul 09 '20

...are you implying Kotlin doesn't have optionals? Because Kotlin has optionals (and is one of the big advantages it has over Java).

1

u/[deleted] Jul 09 '20

No, I'm implying that Kotlin won't let you return null unless the method signature allows it. Which, most of the time, you don't write functions that can return null. So parent comment's trick doesn't work.

But, as the other commenter pointed out, if IntelliJ is configured correctly, it will automatically insert a TODO(). That's a little built-in magic function that throws NotImplementedException. The IDE is happy and doesn't complain, unlike in OP's meme.

-1

u/jgo3 Jul 09 '20

Kotlin

Suspend fun.

2

u/[deleted] Jul 09 '20

Living that hell last couple of days.