Jay McGavren - Head First Go
Here you can read online Jay McGavren - Head First Go full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. publisher: OReilly Media, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:
Romance novel
Science fiction
Adventure
Detective
Science
History
Home and family
Prose
Art
Politics
Computer
Non-fiction
Religion
Business
Children
Humor
Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.
- Book:Head First Go
- Author:
- Publisher:OReilly Media
- Genre:
- Rating:3 / 5
- Favourites:Add to favourites
- Your mark:
- 60
- 1
- 2
- 3
- 4
- 5
Head First Go: summary, description and annotation
We offer to read an annotation, description, summary or preface (depends on what the author of the book "Head First Go" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.
Head First Go — read online for free the complete book (whole text) full work
Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Head First Go" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.
Font size:
Interval:
Bookmark:
Head First Go
by Jay McGavren
Copyright 2019 Jay McGavren. All rights reserved.
Printed in Canada.
Published by OReilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly Media books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (.
Series Creators: | Kathy Sierra, Bert Bates |
Editor: | Jeff Bleiel |
Cover Designer: | Randy Comer |
Production Editor: | Kristen Brown |
Production Services: | Rachel Monaghan |
Indexer: | Lucie Haskins |
Brain image on spine: | Eric Freeman |
Printing History:
April 2019: First Edition.
The OReilly logo is a registered trademark of OReilly Media, Inc. The Head First series designations, Head First Go, and related trade dress are trademarks of OReilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and OReilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and the author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.
Code for this book was developed using 100% recycled electrons.
ISBN: 978-1-491-96955-7
[MBP]
To my eternally patient Christine.
Your brain on Go.
Here you are trying to learn something, while here your brain is, doing you a favor by making sure the learning doesnt stick. Your brains thinking, Better leave room for more important things, like which wild animals to avoid and whether naked snowboarding is a bad idea. So how do you trick your brain into thinking that your life depends on knowing how to program in Go?
Are you ready to turbo-charge your software?
Do you want a simple programming language that compiles fast? That runs fast? That makes it easy to distribute your work to users? Then youre ready for Go!
Go is a programming language that focuses on simplicity and speed. Its simpler than other languages, so its quicker to learn. And it lets you harness the power of todays multicore computer processors, so your programs run faster. This chapter will show you all the Go features that will make your life as a developer easier, and make your users happier.
Every program has parts that apply only in certain situations.
This code should run if theres an error. Otherwise, that other code should run. Almost every program contains code that should be run only when a certain condition is true. So almost every programming language provides conditional statements that let you determine whether to run segments of code. Go is no exception.
You may also need some parts of your code to run repeatedly. Like most languages, Go provides loops that run sections of code more than once. Well learn to use both conditionals and loops in this chapter!
Youve been missing out.
Youve been calling functions like a pro. But the only functions you could call were the ones Go defined for you. Now, its your turn. Were going to show you how to create your own functions. Well learn how to declare functions with and without parameters. Well declare functions that return a single value, and well learn how to return multiple values so that we can indicate when theres been an error. And well learn about pointers, which allow us to make more memory-efficient function calls.
Its time to get organized.
So far, weve been throwing all our code together in a single file. As our programs grow bigger and more complex, thats going to quickly become a mess.
In this chapter, well show you how to create your own packages to help keep related code together in one place. But packages are good for more than just organization. Packages are an easy way to share code between your programs. And theyre an easy way to share code with other developers.
A whole lot of programs deal with lists of things.
Lists of addresses. Lists of phone numbers. Lists of products. Go has two built-in ways of storing lists. This chapter will introduce the first: arrays. Youll learn about how to create arrays, how to fill them with data, and how to get that data back out again. Then youll learn about processing all the elements in array, first the hard way with
for
loops, and then the easy way withfor
...range
loops.Weve learned we cant add more elements to an array.
Thats a real problem for our program, because we dont know in advance how many pieces of data our file contains. But thats where Go slices come in. Slices are a collection type that can grow to hold additional itemsjust the thing to fix our current program! Well also see how slices give users an easier way to provide data to all your programs, and how they can help you write functions that are more convenient to call.
Throwing things in piles is fine, until you need to find something again.
Youve already seen how to create lists of values using arrays and slices. Youve seen how to apply the same operation to every value in an array or slice. But what if you need to work with a particular value? To find it, youll have to start at the beginning of the array or slice, and look through Every. Single. Value.
What if there were a kind of collection where every value had a label on it? You could quickly find just the value you needed! In this chapter, well look at maps, which do just that.
Sometimes you need to store more than one type of data.
We learned about slices, which store a list of values. Then we learned about maps, which map a list of keys to a list of values. But both of these data structures can only hold values of one type. Sometimes, you need to group together values of several types. Think of mailing addresses, where you have to mix street names (strings) with postal codes (integers). Or student records, where you have to mix student names (strings) with grade point averages (floating-point numbers). You cant mix value types in slices or maps. But you can if you use another type called a struct. Well learn all about structs in this chapter!
Theres more to learn about defined types.
In the previous chapter, we showed you how to define a type with a struct underlying type. What we didnt show you was that you can use any type as an underlying type.
And do you remember methodsthe special kind of function thats associated with values of a particular type? Weve been calling methods on various values throughout the book, but we havent shown you how to define your
Font size:
Interval:
Bookmark:
Similar books «Head First Go»
Look at similar books to Head First Go. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.
Discussion, reviews of the book Head First Go and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.