-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b66a8f
commit ea92c3f
Showing
11 changed files
with
23 additions
and
73 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,25 +3,17 @@ | |
|
||
# Go katas | ||
|
||
Katas (形) are practiced in martial arts as a way to internalize the techniques | ||
so they can be executed and adapted under different circumstances, without | ||
thought or hesitation. Let's try the same with Go code. | ||
Katas (形) are practiced in martial arts as a way to internalize and perfect the | ||
techniques so they can be executed and adapted under different circumstances, | ||
without thought or hesitation. Let's try the same with Go code. | ||
|
||
## Why | ||
|
||
I've been learning to program in Go. I work in the sysadmin/devops and security | ||
areas so I don't normally get to program every day. But I still want to keep my | ||
coding skills fresh. Maybe even improve them. I use gokatas as one of the ways | ||
to achieve this. | ||
|
||
## How | ||
|
||
The approach is pretty low-tech. Go katas is basically a list of packages | ||
(directories) that you should understand and then be rewriting from scratch | ||
or partially. There's a command to show katas and your progress: | ||
The approach is pretty low-tech. Go katas is a list of directories containing | ||
brief, well written Go programs. You are supposed to try and understand them and | ||
be rewriting them from scratch or partially. There's a command to show katas and | ||
your progress: | ||
|
||
``` | ||
$ go run cmd/gokatas.go -c 2 | ||
$ go run ./cmd/gokatas -c 2 | ||
Kata Last done Done Level Topics | ||
---- --------- ---- ----- ------ | ||
boring/boring 0 days ago 1x beginner concurrency, design | ||
|
@@ -31,27 +23,20 @@ areader 3 days ago 2x beginner interfaces, io.Reader | |
3 4x | ||
``` | ||
|
||
It's important to practice regularly because repetition creates habits, and | ||
habits are what enable mastery. Start by taking baby steps. Set a goal that you | ||
can meet, e.g. 15 minutes every day before work. At first it's fine even if you | ||
only read through one of the beginner level katas. Use documentation, a search | ||
engine or an AI model if you don't understand something. | ||
|
||
After some time it will require much less will power to practice. Your | ||
programming moves will start looking simpler and smoother. If you feel | ||
comfortable enough with a kata, stop practicing it and pick another one that | ||
interests you and is slightly beyond your current ability. | ||
|
||
## Initial setup | ||
Initial setup: | ||
|
||
1) [Install Go](https://go.dev/doc/install). | ||
|
||
2) [Fork](https://github.com/jreisinger/gokatas/fork) and then clone the repo: `git clone [email protected]:<you>/gokatas.git`. | ||
|
||
3) Start practicing: | ||
3) Start practicing (remove contents from `katas.md` unless you are me :-). | ||
|
||
``` | ||
cd gokatas | ||
> katas.md # if you are not me :-) | ||
go doc | ||
``` | ||
It's important to practice regularly because repetition creates habits, and | ||
habits are what enable mastery. Start by taking baby steps. Set a goal that you | ||
can meet, e.g. 15 minutes every day before work. At first it's fine even if you | ||
only read through one of the beginner level katas. Use documentation, a search | ||
engine or an AI model if you don't understand something. After some time it will | ||
require much less will power to practice. Your programming moves will start | ||
looking simpler and smoother. If you feel comfortable enough with a kata, stop | ||
practicing it and pick another one that interests you and is slightly beyond | ||
your current ability. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package gokatas | ||
package main | ||
|
||
import ( | ||
"bufio" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package gokatas | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.