-
-
Notifications
You must be signed in to change notification settings - Fork 368
Encourage improvements after submission #262
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ import ( | |
| "log" | ||
| "os" | ||
| "path/filepath" | ||
| "math/rand" | ||
| "time" | ||
|
|
||
| "github.com/codegangsta/cli" | ||
| "github.com/exercism/cli/api" | ||
|
|
@@ -97,6 +99,28 @@ Your submission can be found online at %s | |
| if submission.Iteration == 1 { | ||
| msg += ` | ||
| To get the next exercise, run "exercism fetch" again. | ||
|
|
||
| ` | ||
| rand.Seed( time.Now().UTC().UnixNano() ) | ||
| phrases := []string{ | ||
| "For bonus points", | ||
| "Don't stop now: The fun's just begun", | ||
| "Some tips to continue", | ||
| } | ||
| msg += fmt.Sprintf("## %s", phrases[rand.Intn(len(phrases))]) | ||
| msg += ` | ||
|
|
||
| Did you get the tests passing and the code clean? If you want to, these are some | ||
| additional things you could try: | ||
|
|
||
| * Remove as much duplication as you possibly can. | ||
| * Optimize for readability, even if it means introducing duplication. | ||
| * If you've removed all the duplication, do you have a lot of conditionals? Try | ||
| replacing the conditionals with polymorphism, if it applies in this language. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not mention polymorphism. How about suggesting trying to get rid of conditionals without suggesting a tactic? |
||
| How readable is it? | ||
|
|
||
| Then please share your thoughts in a comment on the submission. Did this | ||
| experiment make the code better? Worse? Did you learn anything from it? | ||
| ` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we use a text/template for this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking into text/template, it seems like it'll make the code less readable overall. It either:
If anything it makes sense to define the static text as a const definite at the end of the file, eg:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think you're right. Defining it as a const would be better. |
||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you make sure this is run through
gofmt, please?goimports, would be good, too.