Programming In Go: Creating Applications For The 21st Century (häftad)
Format
Häftad (Paperback)
Språk
Engelska
Antal sidor
480
Utgivningsdatum
2012-05-22
Upplaga
1
Förlag
ADDISON-WESLEY
Illustratör/Fotograf
figures black & white tables
Illustrationer
illustrations
Dimensioner
230 x 177 x 22 mm
Vikt
760 g
Antal komponenter
1
Komponenter
,
ISBN
9780321774637

Programming In Go: Creating Applications For The 21st Century

Häftad,  Engelska, 2012-05-22

Slutsåld

Your Hands-On Guide to Go, the Revolutionary New Language Designed for Concurrency, Multicore Hardware, and Programmer Convenience

Todays most exciting new programming language, Go, is designed from the ground up to help you easily leverage all the power of todays multicore hardware. With this guide, pioneering Go programmer Mark Summerfield shows how to write code that takes full advantage of Gos breakthrough features and idioms.

Both a tutorial and a language reference, Programming in Go brings together all the knowledge you need to evaluate Go, think in Go, and write high-performance software with Go. Summerfield presents multiple idiom comparisons showing exactly how Go improves upon older languages, calling special attention to Gos key innovations. Along the way, he explains everything from the absolute basics through Gos lock-free channel-based concurrency and its flexible and unusual duck-typing type-safe approach to object-orientation.

Throughout, Summerfields approach is thoroughly practical. Each chapter offers multiple live code examples designed to encourage experimentation and help you quickly develop mastery. Wherever possible, complete programs and packages are presented to provide realistic use cases, as well as exercises. Coverage includes
  • Quickly getting and installing Go, and building and running Go programs
  • Exploring Gos syntax, features, and extensive standard library
  • Programming Boolean values, expressions, and numeric types
  • Creating, comparing, indexing, slicing, and formatting strings
  • Understanding Gos highly efficient built-in collection types: slices and maps
  • Using Go as a procedural programming language
  • Discovering Gos unusual and flexible approach to object orientation
  • Mastering Gos unique, simple, and natural approach to fine-grained concurrency
  • Reading and writing binary, text, JSON, and XML files
  • Importing and using standard library packages, custom packages, and third-party packages
  • Creating, documenting, unit testing, and benchmarking custom packages
Visa hela texten

Kundrecensioner

Har du läst boken? Sätt ditt betyg »

Övrig information

Mark Summerfield is an independent trainer, consultant, and technical editor and writer, specializing in C++, Qt, and Python. Mark graduated with first class honors in Computer Science from the University of Wales Swansea, UK, and later qualified as a teacher. Prior to starting Qtrac Ltd., he spent many years in the software industry working as a programmer, consultant, and technical writer. He worked as Trolltech's documentation manager from 2000 to 2004. He lives in Wales.

Innehållsförteckning

Tables xv

 

Introduction 1

Why Go? 1

The Structure of the Book 4

Acknowledgments 5

 

Chapter 1: An Overview in Five Examples 7

1.1. Getting Going 7

1.2. Editing, Compiling, and Running 9

1.3. Hello Who? 14

1.4. Big DigitsTwo-Dimensional Slices 16

1.5. StackCustom Types with Methods 21

1.6. AmericaniseFiles, Maps, and Closures 29

1.7. Polar to CartesianConcurrency 40

1.8. Exercise 48

 

Chapter 2: Booleans and Numbers 51

2.1. Preliminaries 51

2.2. Boolean Values and Expressions 56

2.3. Numeric Types 57

2.4. Example: Statistics 72

2.5. Exercises 78

 

Chapter 3: Strings 81

3.1. Literals, Operators, and Escapes 83

3.2. Comparing Strings 86

3.3. Characters and Strings 87

3.4. Indexing and Slicing Strings 90

3.5. String Formatting with the Fmt Package 93

3.6. Other String-Related Packages 106

3.7. Example: M3u2pls 130

3.8. Exercises 135

 

Chapter 4: Collection Types 139

4.1. Values, Pointers, and Reference Types 140

4.2. Arrays and Slices 148

4.3. Maps 164

4.4. Examples 171

4.5. Exercises 180

 

Chapter 5: Procedural Programming 185

5.1. Statement Basics 186

5.2. Branching 192

5.3. Looping with For Statements 203

5.4. Communication and Concurrency Statements 205

5.5. Defer, Panic, and Recover 212

5.6. Custom Functions 219

5.7. Example: Indent Sort 244

5.8. Exercises 250

 

Chapter 6: Object-Oriented Programming 253

6.1. Key Concepts 254

6.2. Custom Types 256

6.3. Interfaces 265

6.4. Structs 275

6.5. Examples 282

6.6. Exercises 311

 

Chapter 7: Concurrent Programming 315

7.1. Key Concepts317

7.2. Examples 322

7.3. Exercises 357

 

Chapter 8: File Handling 361

8.1. Custom Data Files 362

8.2. Archive Files 397

8.3. Exercises 405

 

Chapter 9: Packages 407

9.1. Custom Packages 408

9.2. Third-Party Packages 417

9.3. A Brief Survey of Gos Commands 418

9.4. A Brief Survey of the Go Standard Library 419

9.5. Exercises 431

 

Appendix A: Epilogue 435

Appendix B: The Dangers of Software Patents 437

Appendix C: Selected Bibliography 441

 

Index 443