Skip to content

Removing useless code in tree traversal. #107

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 3 commits into from
May 13, 2018

Conversation

Gathros
Copy link
Contributor

@Gathros Gathros commented May 11, 2018

No description provided.

@Butt4cak3
Copy link
Contributor

I would love to review/approve this PR and I'm sure I'm not the first to look at it, but the lack of a description makes it kind of difficult to understand what's going on. Why was the code there in the first place? What made it unnecessary?

@Butt4cak3
Copy link
Contributor

In addition to what I said above, you seem to have removed the wrong file. The Julia code now says this for every function:

# This has not been implemented in your chosen language, so here's Julia code

@Gathros
Copy link
Contributor Author

Gathros commented May 12, 2018

There were two files both identical. So I chose to remove it. There really is nothing to add beyond that. I can remove the comments if you would like.

@Butt4cak3
Copy link
Contributor

Butt4cak3 commented May 12, 2018

Oh, wow. They're actually identical other than the fact that one has these comments in it. Why not just remove the one with comments and keep the .md file unchanged? That would be much cleaner than removing the currently used source file and changing the other one so that it's exactly like the one you just deleted.

Nevermind, both files are used. One needs the comments and the other one doesn't. This file is not unnecessary.

@Gathros
Copy link
Contributor Author

Gathros commented May 12, 2018

I would still need to change the .md file.

@Butt4cak3
Copy link
Contributor

@Gathros Sorry, I was a little slow updating my last comment.

Both files are linked in the .md file because they're both used and they both serve different purposes. One is to fill in missing code (e. g. for Python 3) and the other one is the actual Julia example. One needs the comments, the other one doesn't. The file is not unnecessary.

@Gathros
Copy link
Contributor Author

Gathros commented May 12, 2018

I don't see why there needs to be two implementations with the same language one is fine.

@Gathros
Copy link
Contributor Author

Gathros commented May 12, 2018

I've updated the .md file to add the warning of This has not been implemented in your chosen language, so here is the Julia code @Butt4cak3 .

@leios
Copy link
Member

leios commented May 12, 2018

Ok. I now know what's going on, sorry.

So there are several languages without implementations for them in the bulk text. In these cases, we are substituting Julia code. That is the purpose of Tree_example.jl. In that code, I had to make it clear that the language shown was not the language they wanted, but was instead Julia and I opted to put this in a comment instead of in the bulk text because it seemed easier for people to find.

If we only have one file, then when we list the code at the bottom of the page, the comment "This has not been implemented in your chosen language, so here is the Julia code" will be in the code, which doesn't make sense in that context. It looks to me like both files are necessary unless we update the bulk text to have the phrase "This has not been implemented in your chosen language, so here is the Julia code" just before the code snippets for almost every language that is not julia for certain cases.

I am fine with either solution. Keeping 2 files with comments is less work, but it ultimately doesn't matter.

Copy link
Contributor

@Butt4cak3 Butt4cak3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a look at the changes and I think it's nicer this way. I also looked for wrong line numbers in the code imports but everything seems to be correct.

We should think about finding other chapters with missing examples like this one and changing them in the same way. Also, we should note somewhere which code examples are still missing in this chapter.

@Gathros Gathros merged commit d9d8405 into algorithm-archivists:master May 13, 2018
@Gathros Gathros deleted the GeneralFixes branch May 13, 2018 13:09
@Gathros
Copy link
Contributor Author

Gathros commented May 13, 2018

@Butt4cak3 I made a project for all the missing examples in Tree Traversal.

@leios
Copy link
Member

leios commented May 13, 2018

Thanks for doing that guys!

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

Successfully merging this pull request may close these issues.

3 participants