exercism / exercism/go

Implement New Concept Exercise: String Builder

Open
#2,183 1 comment 0 reactions 0 assignees View on GitHub
x:action/create x:knowledge/intermediate x:module/concept x:module/concept-exercise x:rep/large x:size/large x:type/content
Dominant language
Go
Stars
1.2k
Forks
686
Avg merge
54m
Merged PRs (30d)
1

Description

## Getting Started

If you have not yet contributed to concept exercises before, this task requires some upfront reading to acquire the necessary background knowledge.

Here you can read about what Concept Exercises are and how they are structured:

- [What are Concept Exercises?](https://exercism.org/docs/building/product/concept-exercises)
- [Concept Exercises](https://exercism.org/docs/building/tracks/concept-exercises)
- [Concepts](https://exercism.org/docs/building/tracks/concepts)

Also, be aware of these general guidelines:

- [Exercism Markdown Specification](https://exercism.org/docs/building/markdown/markdown)
- [Exercism Formatting and Style Guide](https://exercism.org/docs/building/markdown/style-guide)

## Goal

The goal here is to create a new concept exercise that teaches about the `strings.Builder` type as an efficient way to build strings.
That includes writing a concept and creating a new exercise.

## Concepts

The following concept needs to be created:

- `string-builder`

You can use the `introduction.md` file of the concept also as `introduction.md` file of the exercise. No need to create different content at this point. Additionally, if you want to save some time it is ok to not have an extensive `about.md` at this point. It can also be mainly the `instructions.md` content, maybe with some additions you would like to make.

## Learning Objectives

The student should learn about the following topics and then practice them in the concept exercise:

- understand why `strings.Builder` can be efficient at building strings
- write runes and strings to the `strings.Builder`
- obtain a final string from `strings.Builder`
- the zero-value of `strings.Builder` is ready to use
- `Reset()`

## Out-of-scope

- `strings.Builder` as an `io.Writer`

## Prerequisites

- `strings`
- `string-formatting`
- `runes`
- `zero-values`

These prerequisites should be listed in the `config.json` entry for the exercise.
The prerequisites above are a baseline of the prerequisites that might be needed for the exercise.
When implementing the exercise, feel free to add more prerequisites if the exercise needs them.

## Story Idea

These are some links to exercises/concepts from other tracks that you might use as inspiration and/or fork them and convert them to Go:

- [C# "String Builder" Concept](https://github.com/exercism/csharp/tree/main/concepts/string-builder)
- [C# "Squeaky Clean" Exercise](https://github.com/exercism/csharp/tree/main/exercises/concept/squeaky-clean)

If you decide to fork this exercise, feel free to add or change some tasks as you see fit.

## Resources

Some links that might be helpful as a starting point and/or for the links section of the concept:

- https://pkg.go.dev/strings#Builder
- https://medium.com/learning-the-go-programming-language/bit-hacking-with-go-e0acee258827

## How to proceed

1. **First accept this issue by saying "I'd like to work on this"** (no need to wait for a response, just go ahead).
2. Use this issue to discuss any questions you have, what should be included in the content and whatnot, and to collect more reference material.
3. Create a PR and set "exercism/go" as reviewers. Additionally, you can write in #maintaining-go on Slack that your PR is ready for review. Once you incorporated any critical feedback that the reviewer might give you and the PR is approved, it will be merged by a maintainer.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.