Skip to content

Add TODO comment to "not implemented" panic line #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2019

Conversation

philippgille
Copy link
Contributor

TODO comments can be highlighted by IDEs (some native, some with extensions) or even collected into a task list by some. So adding this line by default to each "not implemented" panic line can help keeping an overview of the functions that still need to be implemented.

Closes #31

TODO comments can be highlighted by IDEs (some native, some with extensions) or even collected into a task list by some. So adding this line by default to each "not implemented" panic line can help keeping an overview of the functions that still need to be implemented.
@josharian
Copy link
Owner

What do you think about just changing the function body to panic("TODO")? Would that have the beneficial effects you seek? See also the discussion in golang/go#35386, in which it appears that many folks already use panic("TODO").

@philippgille
Copy link
Contributor Author

We discussed this in #31 and I thought you already agreed to my proposal. Part of my reasoning for my specific proposal is #31 (comment).

in which it appears that many folks already use panic("TODO")

Going through the comments on that issue I can't find a clear indicator for that. Most discussion focuses on the ... part I think. bradfitz does say:

as if you wrote, say, panic("TODO")

But I think that's just an example. He says the ... is inspired by Perl 6 / Raku, which fails with the message Stub code executed. Kotlin's TODO(), which ins mentioned in the comments, throws a NotImplementedError.

Then there are the IDEs, where for example the VS Code extensions TODO Highlight and TODO Parser use TODO: by default, not TODO. Eclipse does the same. So a user would have to modify the options to get proper TODO hightighting / lists in his IDE.

But we can wait for more comments on the discussion in the golang issue, maybe more people will comment on what ... should be turned into by the compiler, in case they agree that using ... for that is useful and not confusing.

@josharian
Copy link
Owner

We discussed this in #31

Oh, I apologize. I completely forgot about that.

@josharian josharian merged commit 62b7c33 into josharian:master Nov 17, 2019
@philippgille
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add TODO comment to each panic line
2 participants