-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Consider consistency for the exercises #2
Comments
Yes, there is. Those are suggestions on how write idiomatic Julia code, but they're not enforced. They don't include anything on code formatting and indentation, though, so if that's wanted for consistency, those would have to be put together for this project. DataFrames.jl has a style guide that includes those, perhaps that can be used as a base to work from.
For the sake of the tests passing properly, it may be useful to include abstract return and argument types in the function/exercise skeleton. However, for beginner-level exercises these might just add confusion and distract from the core of the exercise, so I'm not sure if they should be strictly enforced. An example: function foo(some_string::AbstractString)::AbstractString
# your code here
# takes a string and returns a string
end Further I think enforcing the style guide linked above for examples is a good idea so that the learning people looking at the examples can see an idiomatic solution and can go from there. For the tests, it can be helpful to group them into different testsets if it makes sense for the given tests. E.g. the tests for the
There is Lint.jl. I have not used it, so can't say much about it.
Usually packages have a My suggestion would be having a structure similar to this example exercise However, that's just an idea and not based on some kind of convention. |
Yeah, I think we should enforce the style guide for the code in this repository, but not for the code that people submit. We can certainly encourage them to look into it, but we shouldn't make it a hard requirement.
That sounds reasonable.
The Java track uses a different source tree structure than the rest of the tracks, but I don't know that we should do so here. If the conventions of the language are loose enough that we wouldn't be teaching people bad habits, then we should simplify as much as possible. (Also, the point of Exercism is a high degree of fluency with the basics of the language. Once you have that, it's pretty easy to accommodate your habits to larger project structures). |
That works for me. Let's do that until we come up with a good reason to do something else. Want to document that structure in the README? |
Excellent. I think that #6 closes this. I'll add the magic comment to that issue so this will get closed when it gets merged. |
It would be good to also have a convention for code formatting which the Julia style guide doesn't provide. There is no widely agreed-upon standard, so it differs from package to package. Perhaps we could stick to the same Formatting Guidelines that is used for the Julia core codebase? |
You mean for the code in this repository, or that we suggest to people for their solutions? |
In this repository for the examples.
|
I think that is a really good idea. The same formatting rules as for the core Julia codebase seems like an excellent choice. |
Sweet, I'll take a look. |
Good day, Before anything, great work done for the Julia track on Exercism! The questions are carefully set up by @SaschaMann and it has been a joy working on them so far. I am looking at contributing to the community but there is one thing I need clarifications... All the method template uses input parameters that have declared types. Looked around the repo for the motivation and I chanced upon it here. Since it wasn't a strong preference, could I counter-propose that we remove type declarations instead? for the example above:-
The rationale is that It should be clear from the test cases on the type of the input parameters. This is how dynamic languages like Python/Ruby etc work, and allows us to avoid ugly Java-ish syntax like My opinion is that in Julia, unless we are coding an interface function, which expects many methods of some types to implement it, it makes sense to state the type. For one-time functions like this, there is no ambiguity when Julia does dispatching, and thus it is better to leave it out. More importantly, some university CS programmes are moving away from stronghold like Java into Python because of the beginner-friendliness of the syntax. It will be helpful to provide the Julia track if we can demonstrate that similarity to Python. For your consideration, please. Meanwhile I will work on porting some exercises from other track here =) |
Hey, thanks for the feedback! That convention was made before we actually implemented any exercises. Many exercises don't even follow it anymore for various reasons. The original motivation was that the user wouldn't have to look at the tests at all. You're right that the type declarations aren't needed in most cases here. Some exercises don't have a skeleton at all because it would make the exercise trivial. Perhaps we should decide it on an exercise-by-exercise basis but default to method signatures without types. Thanks for bringing this topic up again!
Perhaps there should be an exercise that explicitely requires writing a module with exports etc. It's a fairly important part of writing reusable Julia code. I'm not quite sure which exercise would be a good candidate for this, though.
Glad to hear that! @aawray / @andrej-makarov-skrt deserves credit for a lot of exercises as well. |
Ok noted on the preference, I think this is good judgement.
This is a good idea. I will be sure to look out for bigger problems in the ecosystem. I hope to import problems from the dynamic language tracks first, but once that is done, the bigger problems should surface themselves from the more enterprise-y languages.
Thanks for the exercises everyone =) I will get the rest done, and help out the community while I am at it. |
I'll update the README and move that discussion about the module-exercise to another issue |
* Optional type parameters (see #2) * Formatting changes
Note that this is about the exercises (the test suites and code examples), not people's solutions.
The text was updated successfully, but these errors were encountered: