Skip to content
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

[V3] Concept Exercises #1389

Closed
tehsphinx opened this issue Jan 20, 2020 · 15 comments
Closed

[V3] Concept Exercises #1389

tehsphinx opened this issue Jan 20, 2020 · 15 comments

Comments

@tehsphinx
Copy link
Member

Go Concept Exercises

Exercise Flow

2020-03-01_Go_Path

Note: To request a change in the flow, comment on this issue.

Exercise Status

Icon Legend

  • βœ… exercise implemented
  • πŸ›  is being implemented
  • πŸ“™ exercise specification issue created
  • πŸ”΄ not started
  • ❓ to be filled

basics

focus: some basics as a starting point. packages, variables, basic functions, basic comments
thoughts: The introductions to the mentioned topics are only rudimentary.
concepts used: packages, variables, functions, comments
status: πŸ› 
issue: exercism/v3#1438

comments

focus: comments in Go
thoughts: comments on exported identifiers, shape of package comments and function comments, golint, godoc (?)
concepts used: ❓
status: πŸ“™
issue: exercism/v3#843

code-formatting

focus: code formatting in Go
thoughts: usage of gofmt, auto-format on save in different IDEs, command line usage
concepts used: ❓
status: πŸ”΄

types

note: will probably be eliminated
focus: very basic introduction to Go's types, declaring variables and defining custom types.
concepts used: ❓
status: πŸ“™
issue: #1378

numbers

focus: int and float64
concepts used: numbers, type conversion, assignment
status: βœ…
issue: exercism/v3#371

numbers-floating-point

focus: more in-depth intro to floats. float64 was briefly introduced in numbers exercise.
concepts used: ❓
status: πŸ“™
issue: #1387

constants

focus: introduction to constants
thoughts: applies to strings, numbers, errors, ..., not maps, slices, ..., usage of iota (exercise should only depend on numbers: int, float64)
concepts used: ❓
status: πŸ”΄

functions

focus: introduction to functions in Go
concepts used: ❓
status: πŸ“™
issue: #1383

anonymous-functions

focus: introduction to anonymous functions
thoughts: ❓
concepts used: ❓
status: πŸ“™
issue: #1377

conditionals

focus: introduction to if and switch
concepts used: ❓
status: πŸ› 
issue: exercism/v3#428

iteration

focus: introduction to the for loop (no range loop)
concepts used: conditionals, numbers, functions
status: πŸ› 
issue: #1380

basic-slices

focus: working with slices. instantiate (len, cap), append, set single value, read value, remove value, taking length
concepts used: iteration, functions, conditionals, numbers
status: βœ…
issue: exercism/v3#530

maps

focus: introduction to maps
concepts used: functions, strings, integers, conditionals
status: πŸ› 
issue: exercism/v3#427

range-iteration

focus: introduction to the for range loop (no channel reading)
concepts used: ❓
status: πŸ“™
issue: #1381

bytes-and-runes

focus: special intro to bytes and runes and slices of bytes and runes
concepts used: ❓
status: πŸ“™
issue: #1382

basic-strings

focus: string manipulation and formatting
concepts used: string manipulation, string formatting, slices, type conversion, conditionals, functions
status: βœ…
issue: exercism/v3#237

nil

focus: introduction to nil, default values
thoughts: only pointers can be nil, types that are actually pointers: map, slice, channel, etc (can also be nil), default values for other types (string, numbers, bool, etc)
concepts used: ❓
status: πŸ“™
issue: #1379

pointers

focus: introduction to pointers
thoughts: reference to memory address, pass by reference/pass by value, garbage collector
concepts used: ❓
status: πŸ“™
issue: #1376

errors

focus: introduction to errors
thoughts: create errors (errors.New, fmt.Errorf), typed errors and when to use them (public constant errors)
concepts used: ❓
status: πŸ“™
issue: exercism/v3#846

advanced-errors

focus: introduction to custom errors
thoughts: custom error types and when to use them (custom types implementing error interface), any type can be used as an error when implementing the Error() string function
concepts used: ❓
status: πŸ“™
issue: #1375

error-handling

focus: introduction to error handling
thoughts: if err != nil, return or handle -- not both (logging is handling!), don't ignore errors, every function that can fail should return an error, error always last return value
concepts used: ❓
status: πŸ“™
issue: #1374

panic-and-recover

focus: introduction to panics
thoughts: how to panic, don't panic/when to panic, recover/when to recover, a panic is a bug and should be fixed
concepts used: ❓
status: πŸ“™
issue: #1373

advanced-strings

focus: iterating strings, immutability of strings, advanced formatting
concepts used: ❓
status: πŸ“™
issue: #1386

time-and-duration

focus: working with Time and Duration
thoughts: calculation (diff, since), comparison (before, after), duration constants (second, hour, nanosecond, ...), timezones, formatting, parsing
concepts used: ❓
use parts of: C# datetimes
status: πŸ”΄

application-timing

focus: time related application concepts
thoughts: sleep, time.After, ticker, timer
concepts used: ❓
status: πŸ”΄

structs

focus: introduction to structs
thoughts: structs, fields, (not methods), instantiation, default values: NewFunc (?), field usage, exported and private (?)
concepts used: ❓
status: πŸ”΄

methods

focus: introduction to methods
thoughts: can be attached to any type defined in the same package. method pointer vs value receiver, exported and private (?), methods on structs: Go's "classes" (?)
concepts used: ❓
copy: C# classes
status: πŸ”΄

goroutines

focus: introduction to goroutines
thoughts: start a goroutine, start goroutines in a loop (references), async: no telling what happens first
concepts used: ❓
status: πŸ”΄

channels

focus: introduction to channels
thoughts: unbuffered channels, reading and writing (no iterating channels, no select)
concepts used: ❓
status: πŸ”΄

channel-select

focus: introduction to the select statement
thoughts: ❓
concepts used: ❓
status: πŸ”΄

waitgroups

focus: usage of WaitGroup
thoughts: ❓
concepts used: ❓
status: πŸ”΄

context

focus: introduction to different types of contexts
thoughts: background/todo, timeout, cancel, values in contexts (when/why not to use?)
concepts used: ❓
status: πŸ”΄

anonymous-functions

focus: introduction to anonymous functions
thoughts: ❓
concepts used: ❓
status: πŸ”΄

defer

focus: introduction to defer
thoughts: ❓
concepts used: ❓
status: πŸ”΄

mutex

focus: introduction to mutexes
thoughts: Mutex/RWMutex, defer
concepts used: ❓
status: πŸ”΄

empty-interface

focus: introduction to the empty interface
thoughts: can hold any value but hard/slow to work with, should be used rarely
concepts used: ❓
status: πŸ”΄

interfaces

focus: introduction to interfaces
thoughts: implicit implementation of interfaces, single Method interface, some common interfaces: Reader, Writer, error
concepts used: ❓
status: πŸ”΄

reflection

focus: introduction to reflection
thoughts: intro to reflect package, some basic reflection, ...❓(not type switch, type casting, etc.)
concepts used: ❓
status: πŸ”΄

type-switch

focus: introduction to type switch
thoughts: probably based on conditionals (which introduces switch), numbers and empty-interface
concepts used: ❓
status: πŸ”΄

type-casting

focus: introduction to type casting
thoughts: ❓
concepts used: ❓
status: πŸ”΄

@tehsphinx
Copy link
Member Author

tehsphinx commented Jan 20, 2020

A quick start of possible concept exercises. To be expanded as we go. Mainly as a starting point for tomorrows meeting.

@mcaci
Copy link
Contributor

mcaci commented Jan 21, 2020

Would concurrency be a good candidate to add as a concept or would it be better to split it into channel, goroutine, select and so on?

@Prounckk
Copy link
Contributor

I'd also add manipulation with JSON

@tehsphinx
Copy link
Member Author

tehsphinx commented Jan 21, 2020

Would concurrency be a good candidate to add as a concept or would it be better to split it into channel, goroutine, select and so on?

Since this is about concept exercises... we will need to split it up. I think there should be a lot of concept exercises on concurrency.

@tehsphinx
Copy link
Member Author

tehsphinx commented Jan 21, 2020

I'd also add manipulation with JSON

Did I get this right?

Or do you mean: JSON Handling?

@Prounckk
Copy link
Contributor

sorry,
it was about parsing JSON files, empty interfaces might be

@tehsphinx
Copy link
Member Author

Would concurrency be a good candidate to add as a concept or would it be better to split it into channel, goroutine, select and so on?

I added some of them here as they were missing: https://github.com/exercism/v3/issues/167

@tehsphinx
Copy link
Member Author

From my work on exercism/v3#239 I got to think quite a bit more.

strings in Go are actually dependent on knowing about slices. After all strings are based on []byte. If I want to take a substring, I use ranged indexing into a string (s[4:6]). In C# for example there is a subString method that does this for you, so no need to know about the underlying structure of a string.

Using strings.Split returns a []string. Again needs knowledge of slices as a prerequisite.

Ranging over a string gives be runes with a start-byte index of that rune. Which in turn needs some knowledge about runes and maybe []rune as well as the underlying []byte.


I think we should restart this issue and start over. Remove all the concept exercises we gathered here and start writing down the issues for creating a concept exercise instead. I'd pick a concept I want to take on and create an exercise issue based on that (or multiple if it starts to become too large). Then I'd think really hard on what this exercise should teach, what it shouldn't. Maybe already implement some code I'd want to see as a solution, to see what concepts it depends on (like indexing into slices in my strings sample above). Write down those prerequisites as well.

If the concept exercise is pretty much well defined (just the issue, but with clear definitions concept(s) it will teach and its prerequisites), then make a summary of that in this issue as a comment. Then I'll add it to the description above.


This is a suggestion for now. So I'd like to know what you think!

@ErikSchierboom
Copy link
Member

I think we should restart this issue and start over. Remove all the concept exercises we gathered here and start writing down the issues for creating a concept exercise instead. I'd pick a concept I want to take on and create an exercise issue based on that (or multiple if it starts to become too large). Then I'd think really hard on what this exercise should teach, what it shouldn't. Maybe already implement some code I'd want to see as a solution, to see what concepts it depends on (like indexing into slices in my strings sample above). Write down those prerequisites as well.

If the concept exercise is pretty much well defined (just the issue, but with clear definitions concept(s) it will teach and its prerequisites), then make a summary of that in this issue as a comment. Then I'll add it to the description above.

So I think this is a perfectly reasonable thing to do! I'd not throw away this exercise completely, as it can still be very useful later, but starting with the basic concepts and building on them is also how I approached the C# track and that worked well for me personally.

@tehsphinx
Copy link
Member Author

tehsphinx commented Feb 29, 2020

A lot of new exercises have been added in the description. All with the status πŸ”΄ need issues with specs.

If you want to work on one, add a comment to this issue (#212) naming the one you want to work on (also check if somebody else already works on it), and then create the specification issue for the new concept exercise using the [MAINTAINERS] Implement new Concept Exercise template.

@tehsphinx
Copy link
Member Author

tehsphinx commented Mar 1, 2020

I'm going to work on errors, custom-errors, error-handling and panic-and-recover next. (Creating issues for them: πŸ”΄ --> πŸ“™)

@ErikSchierboom
Copy link
Member

@tehsphinx Would it perhaps make sense to link to issues from this list? E.g. any πŸ“™ issue will have an accompanying issue, right? If so, it might make sense to link to it directly from this list.

@tehsphinx
Copy link
Member Author

Added issue links in the description.

@ErikSchierboom
Copy link
Member

Great!

@BethanyG BethanyG changed the title [Go] Concept Exercises [V3] Concept Exercises Jan 28, 2021
@BethanyG BethanyG transferred this issue from exercism/v3 Jan 28, 2021
@junedev
Copy link
Member

junedev commented Oct 23, 2021

To give a better overview of what's already implemented etc there is a roadmap document now and a new issue for discussions: #1886

@junedev junedev closed this as completed Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants