- Rebellion Rose - Partai Anarki
- Rebellion Rose - New Album (Latest)
- Social Distortion - Sex, Love And Rock 'N' Roll
- Social Distortion - 1990
- Social Distortion - Hard Times And Nursery Rhymes (Deluxe Edition)
Note
I write code while listening to these tracks.
GitKraken
GIthub Desktop
Go Play Ground
- CRUD Simulation
- CRUD Simulation Dependency Injection (DI)
- Simplicity Simulation file system in-memory
gotoolchain auto
: Automated management of Go tools.golint
&gopls
: Essential for code linting and editor integration.deadcode
: Removes unused code to maintain a clean codebase.gotests
: Automates the generation of test cases.go doc
&go fmt
: Ensures consistent documentation and code formatting.go vet
: Provides in-depth code analysis.gocyclo
: Measures and aims to reduce cyclomatic complexity.pprof
: A powerful profiling tool for measuring and visualizing the performance characteristics of Go programs, particularly adept at identifying resource-intensive operations.
Tip
When writing in Go:
Coding Philosophy:
- Prioritize error handling first before structuring logs.
- Strive for simplicity in each function, aiming for a cyclomatic complexity under 5 as a sign of Go programming expertise.
- As a general rule, maintain a maximum cyclomatic complexity of 10. If you have advanced expertise, aim for a cyclomatic complexity under 5.
- Emphasize reusable code as it encourages better testing practices, enhances readability for both
humans
andmachines
, and aids in minimizing bugs for more reliable code. - Utilize constants in Go as a minimalist approach to avoid the pitfalls of stupid hard coding values.
By adhering to these principles, your Go code will stand out as superior when compared to others.
For example, even when using other packages, you'll find that your own package, built upon these principles, is superior. It will be less complex, have fewer bugs, and cause fewer panics compared to other packages that may be unnecessarily complex or prone to issues.
Tip
Another tips, this most important when you are writing in go
witthen cyclomatic complexity under 5
, especialy when you wanted to push in github
for repository
- Ignore Go test files (e.g,
yourfunction_test.go
) by adding them to.gitignore
.
Because, just think again, why you have to push include go
code test files when cyclomatic complexity
are under 5
? so be smart cyclomatic complexity under 5
you are go
mastery.
Note
It is important to keep the cyclomatic complexity to a maximum of 10
or lower (ideally under 5
). This is because, in Go
, unlike Python
which may tolerate complex conditional logic (e.g., multiple nested if
statements which is bad), functions with a complexity under 10
are more likely to be reusable
. This not only aids in testing
but also enhances human + machine readability
and minimizes bugs (bug-free)
.
Github Unwrapped
unwrapped-H0llyW00dzZ.1.mp4
⚡ Fun fact
Did You Know? If your Go
code resembles a jungle of if
statements (think 10+ nested layers – a big no-no!), it's less Go
and more Stop-and-ask-for-directions
. Flatten those conditionals and let your code run as smoothly as a greased gopher
on a slip 'n slide!
Did You Know? If your code is overly stupid complex, it could indicate a need for improvement in your development skills.
Another Meme of the day