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

Lint goto? #33

Closed
ivarne opened this issue Sep 26, 2014 · 3 comments
Closed

Lint goto? #33

ivarne opened this issue Sep 26, 2014 · 3 comments

Comments

@ivarne
Copy link
Contributor

ivarne commented Sep 26, 2014

This is a continuation of the lint @goto discussion in JuliaLang/julia#1289 (comment)

I would say the question to ask to find the is, "Is it common for the writer/reader of this code to think it does something different?". goto will often obfuscate and make the logic flow of your program hard to follow, but no one will be surprised about how it works. Lots of users gets surprised when [1:0] results in Int[] not [1, 0], and the only reason it doesn't is that we want type stability and a super efficient UnitRange type with a hardcoded (inlined) step of 1.

I assumed you had lintpragma for all lint messages, so that doesn't really change anything for me, but I'm not the one to dictate the scope of lint.jl. @goto is probably rarely the right answer to the question, so a lintpragma might just be another reason to really rethink your code structure.

@tonyhffong
Copy link
Owner

I'm fine with taking it out, as it looks like I don't feel as strongly about this as you do.

@StefanKarpinski
Copy link

I think that warning about goto is strange – it's not like you can easily use it by accident or anything. If you use it, you meant to and presumably know what you're doing.

@tonyhffong
Copy link
Owner

Thank you for your feedback. The code and tests have been removed.

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