Skip to content
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

return vs return nothing #102

Open
simeonschaub opened this issue Nov 15, 2024 · 3 comments
Open

return vs return nothing #102

simeonschaub opened this issue Nov 15, 2024 · 3 comments

Comments

@simeonschaub
Copy link

simeonschaub commented Nov 15, 2024

I don't have a strong preference either way, but I think it would be nice if Runic normalized to one or the other. The only potential issue is that it's technically possible to redefine nothing inside a module or function, but I have yet to see any code in the wild which does this.

@fredrikekre
Copy link
Owner

See discussion here: #48 (comment)

@simeonschaub
Copy link
Author

Re #48 (comment):

I would argue that even in the case of 2., the function still returns a value of nothing, irregardless whether it's used or not, so I would say making that explicit via return nothing is not necessarily bad

@carstenbauer
Copy link

carstenbauer commented Nov 16, 2024

FWIW, I'd also vote for normalising to return nothing. In addition to @simeonschaub's point above, to me, the (subtle) communicative aspect of distinguishing between return and return nothing is outweighed by the advantage of clarity and consistency.

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

No branches or pull requests

3 participants