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

Use more built-in functions and redefine built-in functions #1288

Closed
ZMAlt opened this issue Oct 12, 2023 · 3 comments · Fixed by #1291
Closed

Use more built-in functions and redefine built-in functions #1288

ZMAlt opened this issue Oct 12, 2023 · 3 comments · Fixed by #1291

Comments

@ZMAlt
Copy link
Contributor

ZMAlt commented Oct 12, 2023

Hi. @joa-quim

I noticed some functions are renamed or rewritten, eg. #1287 or numel. I think using more built-in functions would be more friendly to fresh contributors.

And we can rename general functions to build-in names to make them more readable, eg. rename del_from_dict to delete!.

what's your opinion?

@joa-quim
Copy link
Member

Hi @ZMAlt

Thanks for keeping look for improvements and bringing a new perspective on code readability.

  • #1287 Is fine an I'll approve it but fear that there can be conflicts with code that I will commit today. I never understood well how Git works in these cases. So better wait that I do the commits and you see if you have to do a rebase.
  • The numel case. Hmm, I understand that it may cause a little confusion (to non-Matlabers) but I'm using it since the guys on Lint decided to bother everywhere there is a for k = 1:length(X) trying to force the use of eachindex, which I find ugly and refuse to do (unless needed, which is not the cases where numel is used).
  • del_from_dict. Not sure I understood. You mean adding two new methods to Base.delete! that do what del_from_dict does? If yes, I have nothing against it. On the contrary.

@ZMAlt
Copy link
Contributor Author

ZMAlt commented Oct 12, 2023

So better wait that I do the commits and you see if you have to do a rebase.

OK.

The numel case. Hmm, I understand that it may cause a little confusion (to non-Matlabers) but I'm using it since the guys on Lint decided to bother everywhere there is a for k = 1:length(X) trying to force the use of eachindex, which I find ugly and refuse to do (unless needed, which is not the cases where numel is used).

I usually use vim, not vscode-julia or Pluto. I know that correctness issue. Let's keep using numel to make Lint happy.

You mean adding two new methods to Base.delete! that do what del_from_dict does? If yes, I have nothing against it.

Yes.

@joa-quim
Copy link
Member

I usually use vim, not vscode-julia

I use VScode with the vim plugin 😄

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 a pull request may close this issue.

2 participants