-
-
Notifications
You must be signed in to change notification settings - Fork 525
Should connect require connect or board #854
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
Comments
Or change the class name to connect. |
Thoughts: I agree that to match Ruby conventions the require and the class should have the same name. This is useful for organising code in large projects, but is less of an issue when there is only one file in a project. The Exercism ruby track convention is for the required file match the slug. Are there any other exercises that exhibit this mismatch? - yes many. As a solver I'd rather have the require be the name of the slug so I can find my solution to a particular exercise by slug. Imagine if there were The student can change the name of the required file in their tests if they want. Or create the
In Rails Potential disclaimer: I'm conflicted by 'ease of maintaining the track' since require_relative "#{slug}" is much easier to implement in generators. Conclusion: I think I'm OK with the current situation. (But am open to having my mind changed.) |
If it is simultaneously important to have the filename match the exercise ( |
That is a good solution. It would become:
(I'm still not sure it's important though.) |
These are just my opinions. it is important to follow best practices no matter how simple the challenge is. There are time where breaking convention makes sense and is even needed sometimes, but when you are teaching someone new it is best to stick with the best practices unless you explain why you deviated.
This make sense |
Robot name is one other one that I can think of where the class and the filename differ. |
There's a bunch of them that I've seen by eyeballing it but not worked out the pipeline chain to make a nice list. It starts with |
Is it worthwhile inventing a redundant class/module just so we can do this? |
While we're talking about conventions: The test file is called It's important[citation needed] that the test file match the exercise slug. |
(cc @kytrinyx) |
I don't know that it's important that the test file match the exercise slug, but I think that this is the convention in the Ruby track, so I'm all for being consistent here 👍 |
Do we need to take action on this? |
I don't think so, but I think it is good that the discussion is here. Closing (feel free to reopen though.) |
Someone emailed me about this.
Take a look at these two lines:
https://github.com/exercism/ruby/blob/master/exercises/connect/connect_test.rb#L2
https://github.com/exercism/ruby/blob/master/exercises/connect/connect_test.rb#L15
We require a file called
'connect'
but then require a class calledBoard
. Seems a little un-Ruby-like. Should we requireboard
instead? Thoughts?The text was updated successfully, but these errors were encountered: