STL Algorithm Equivalents in Go

Many programmers coming from other high-performance programming languages, particularly C++, understand the concept of the Standard Templating Library (STL). This library provides common programming data structures and functions access to a generalized library in order to rapidly iterate and write performant code at scale. Go does not have a built-in STL. This chapter will focus on how to utilize some of the most common STL practices within Go. The STL has four commonly referenced components:

  • Algorithms
  • Containers
  • Functors
  • Iterators

Being familiar with these topics will help you to write Go code more quickly and effectively, utilizing commonly implemented and optimized patterns. In this chapter, we are going to learn the following:

  • How to use STL practices in Go
  • How to utilize standard programming algorithms with respect to Go
  • How containers store data
  • How functions work in Go
  • How to properly use iterators

Remember, all of these pieces are still part of our performance puzzle. Knowing when to use the right algorithm, container, or functor will help you to write better-performing code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.103.183