All Projects → SuperPaintman → The Evolution Of A Go Programmer

SuperPaintman / The Evolution Of A Go Programmer

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to The Evolution Of A Go Programmer

DeFi-Developer-Road-Map
DeFi Developer roadmap is a curated Web3.0 Developer handbook which includes a list of the best tools for DApps, development resources and lifehacks.
Stars: ✭ 5,658 (+973.62%)
Mutual labels:  roadmap
Visual Slam Roadmap
Roadmap to becoming a Visual-SLAM developer in 2021
Stars: ✭ 277 (-47.44%)
Mutual labels:  roadmap
Awesome Leading And Managing
Awesome List of resources on leading people and being a manager. Geared toward tech, but potentially useful to anyone.
Stars: ✭ 5,255 (+897.15%)
Mutual labels:  roadmap
roadmap-cc
Roadmap para se tornar um cientista da computação na UFCG
Stars: ✭ 49 (-90.7%)
Mutual labels:  roadmap
.NET-Backend-Developer-Roadmap
Nick's Roadmap for a .NET Backend Developer working with Microservices
Stars: ✭ 827 (+56.93%)
Mutual labels:  roadmap
Learning Roadmap
The Front-End Developer Learning Roadmap by Frontend Masters
Stars: ✭ 336 (-36.24%)
Mutual labels:  roadmap
Main
Management materials and content
Stars: ✭ 32 (-93.93%)
Mutual labels:  roadmap
Roadmap
GitHub public roadmap
Stars: ✭ 5,882 (+1016.13%)
Mutual labels:  roadmap
Roadmap Do Desenvolvedor Web
🎢 Roadmap para se tornar um desenvolvedor web! Atualização 2021!
Stars: ✭ 276 (-47.63%)
Mutual labels:  roadmap
Tlroadmap
Тимлид – это ❄️, потому что в каждой компании он уникален и неповторим.
Stars: ✭ 4,398 (+734.54%)
Mutual labels:  roadmap
Annotated-Angular-Roadmap
More details about each item in the Angular roadmap (https://angular.io/guide/roadmap)
Stars: ✭ 41 (-92.22%)
Mutual labels:  roadmap
rpa developer roadmap
Roadmap to become a RPA developer
Stars: ✭ 24 (-95.45%)
Mutual labels:  roadmap
Ml Roadmap
🤖 Roadmap to becoming a Machine Learning developer in 2020
Stars: ✭ 398 (-24.48%)
Mutual labels:  roadmap
CppDeveloperRoadmap
Roadmap for learning the C++ programming language for beginners and experienced devs.
Stars: ✭ 1,048 (+98.86%)
Mutual labels:  roadmap
Python Roadmap
Дорожная карта по изучению Python
Stars: ✭ 467 (-11.39%)
Mutual labels:  roadmap
kasper music player
An All In One app that would allow "music.youtube.com" to work in restricted countries. This app aims to bypass all the premium models and create FFA experience
Stars: ✭ 25 (-95.26%)
Mutual labels:  roadmap
Containers Roadmap
This is the public roadmap for AWS container services (ECS, ECR, Fargate, and EKS).
Stars: ✭ 4,132 (+684.06%)
Mutual labels:  roadmap
Openproject
OpenProject is the leading open source project management software.
Stars: ✭ 5,337 (+912.71%)
Mutual labels:  roadmap
Flutter Development Roadmap
Flutter App Developer Roadmap - A complete roadmap to learn Flutter App Development. I tried to learn flutter using this roadmap. If you want to add something please contribute to the project. Happy Learning
Stars: ✭ 474 (-10.06%)
Mutual labels:  roadmap
Projects
Curated collection of projects for folks looking to collaborate within the Elm ecosystem.
Stars: ✭ 414 (-21.44%)
Mutual labels:  roadmap

The Evolution of a Go Programmer

Junior Go programmer

package fac

func Factorial(n int) int {
	res := 1

	for i := 1; i <= n; i++ {
		res *= i
	}

	return res
}

Functional Go programmer

package fac

func Factorial(n int) int {
	if n == 0 {
		return 1
	} else {
		return Factorial(n - 1) * n
	}
}

Generic Go programmer

package fac

func Factorial(n interface{}) interface{} {
	v, valid := n.(int)
	if !valid {
		return 0
	}

	res := 1

	for i := 1; i <= v; i++ {
		res *= i
	}

	return res
}

Multithread optimized Go programmer

package fac

import "sync"

func Factorial(n int) int {
	var (
		left, right = 1, 1
		wg sync.WaitGroup
	)

	wg.Add(2)

	pivot := n / 2

	go func() {
		for i := 1; i < pivot; i++ {
			left *= i
		}

		wg.Done()
	}()

	go func() {
		for i := pivot; i <= n; i++ {
			right *= i
		}

		wg.Done()
	}()

	wg.Wait()

	return left * right
}

Discovered Go patterns

package fac

func Factorial(n int) <-chan int {
	ch := make(chan int)

	go func() {
		prev := 1

		for i := 1; i <= n; i++ {
			v := prev * i

			ch <- v

			prev = v
		}

		close(ch)
	}()

	return ch
}

Fix Go weaknesses with mature solutions

package fac

/**
 * @see https://en.wikipedia.org/wiki/Factorial
 */
type IFactorial interface {
	CalculateFactorial() int
}

// FactorialImpl implements IFactorial.
var _ IFactorial = (*FactorialImpl)(nil)

/**
 * Used to find factorial of the n.
 */
type FactorialImpl struct {
	/**
	 * The n.
	 */
	n int
}

/**
 * Constructor of the FactorialImpl.
 *
 * @param n the n.
 */
func NewFactorial(n int) *FactorialImpl {
	return &FactorialImpl{
		n: n,
	}
}

/**
 * Gets the n to use in factorial function.
 *
 * @return int.
 */
func (this *FactorialImpl) GetN() int {
	return this.n
}

/**
 * Sets the n to use in factorial function.
 *
 * @param n the n.
 * @return void.
 */
func (this *FactorialImpl) SetN(n int) {
	this.n = n
}

/**
 * Returns factorial of the n.
 *
 * @todo remove "if" statement. Maybe we should use a factory or somthing?
 *
 * @return int.
 */
func (this *FactorialImpl) CalculateFactorial() int {
	if this.n == 0 {
		return 1
	}

	n := this.n
	this.n = this.n - 1

	return this.CalculateFactorial() * n
}

Senior Go programmer

package fac

// Factorial returns n!.
func Factorial(n int) int {
	res := 1

	for i := 1; i <= n; i++ {
		res *= i
	}

	return res
}

Rob Pike

package fac

// Factorial returns n!.
func Factorial(n int) int {
	res := 1

	for i := 1; i <= n; i++ {
		res *= i
	}

	return res
}

Tribute to the Iavor Diatchki's original page "The Evolution of a Programmer".

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].