exercism / exercism/go-analyzer

docs: clarify suggestions for Difference of Squares

Open
#3 13 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10
Forks
11
PR merge metrics
No merged PRs in 30d

Description

The intent with this issue is to facilitate a discussion about proposed changes to the **Difference of Squares** mentor suggestion output. (A) pull request(s) can be submitted and linked to this issue to retain historical context.

This question was asked in the **#track-go** channel: https://exercism-team.slack.com/archives/CAS0EK88H/p1558543383014700

...and answered/discussed further here: https://exercism-team.slack.com/archives/CAS0EK88H/p1558543810015800

At the moment, the proposals for changes to the copy are:

> These formulas are not as straightforward as they seem, and you aren't expected to create an *efficient* solution on your own. We encourage you to ask questions and do a little research. Finding the best algorithm is a key skill in software engineering.

and:

> A loop or two will get this done *brute force*, but _you can do better_. Try looking at: _ ...and then have a couple of links to math pages.

and:

> These formulas are absolutely as straightforward as they seem.

I would propose using **these formulas are not obvious** rather than **these formulas are not as straightforward as they seem**. While these algorithms may seem simple and elegant, many students (including myself) will not know/remember that they exist until prompted by a mentor to try searching for them:

```go
func SquareOfSum(n int) int {
sum := n * (n + 1) / 2
return sum * sum
}

func SumOfSquares(n int) int {
return (n * (n + 1) * (2*n + 1)) / 6
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect the Go analyzer code that generates the Difference of Squares mentor suggestion; the issue does not name a file or test. Compare the proposed wording and determine where the final copy is defined, then verify that the generated suggestion uses the agreed text and preserves the referenced formula guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.