Learn to Program Second Edition

Learn to Program Second Edition pdf epub mobi txt 电子书 下载 2025

出版者:Pragmatic Bookshelf
作者:Chris Pine
出品人:
页数:231
译者:
出版时间:2009-4-4
价格:USD 24.95
装帧:Paperback
isbn号码:9781934356364
丛书系列:
图书标签:
  • Ruby
  • 编程
  • 英文版
  • programming
  • 计算机
  • 程序设计
  • 互联网
  • ruby
  • Programming
  • Python
  • Beginner
  • Tutorial
  • Education
  • Computer Science
  • Software Development
  • Learn to Program
  • Second Edition
  • IT
想要找书就要到 小美书屋
立刻按 ctrl+D收藏本页
你会得到大惊喜!!

具体描述

Computers are everywhere, on every desk, in your iPod, cell phone, and PDA. To live well in the 21st century, you need to know how to make computers do things. And to really make computers do what you want, you have to learn to program. Fortunately, that's easier now than ever before. Chris Pine's book will teach you how to program. You'll learn to use your computer better, to get it to do what you want it to do. Starting with small, simple one-line programs to calculate your age in seconds, you'll see how to advance to fully structured, real programs. You'll learn the same technology used to drive modern dynamic websites and large, professional applications. It's now easier to learn to write your own computer software than it has ever been before. Now everyone can learn to write programs for themselves - no previous experience is necessary. Chris takes a thorough, but light-hearted approach that teaches you how to program with a minimum of fuss or bother.

作者简介

Chris Pine first discovered Ruby in early 2001 and immediately began using it to build tools for his day job: programming computer games. After hours, he volunteered with gifted children teaching them advanced mathematics. With Ruby, he began teaching his students programming as well. Chris finds writing about himself in the third person uncomfortably like listening to his own voice being played back to him. He enjoys board games and juggling, and is currently living with his darling wife and two darling children in Portland, Oregon.

目录信息

Preface to the Second Edition vii
Introduction x
What Is Programming? . . . . . . . . . . . . . . . . . . . . . . . xii
Programming Languages . . . . . . . . . . . . . . . . . . . . . . xiii
The Art of Programming . . . . . . . . . . . . . . . . . . . . . . xiv
1 Getting Started 1
1.1 Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Numbers 9
2.1 Did It Work? . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Introduction to puts . . . . . . . . . . . . . . . . . . . . . 10
2.3 Integer and Float . . . . . . . . . . . . . . . . . . . . . . . 10
2.4 Simple Arithmetic . . . . . . . . . . . . . . . . . . . . . . 10
2.5 A Few Things to Try . . . . . . . . . . . . . . . . . . . . . 12
3 Letters 14
3.1 String Arithmetic . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 12 vs. ’12’ . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 Variables and Assignment 19
5 Mixing It Up 23
5.1 Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.2 Another Look at puts . . . . . . . . . . . . . . . . . . . . 25
5.3 The gets Method . . . . . . . . . . . . . . . . . . . . . . . 26
5.4 Did It Work? . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.5 The chomp Method . . . . . . . . . . . . . . . . . . . . . . 27
5.6 A Few Things to Try . . . . . . . . . . . . . . . . . . . . . 28
5.7 Mind Your Variables . . . . . . . . . . . . . . . . . . . . . 28
6 More About Methods 30
6.1 Fancy String Methods . . . . . . . . . . . . . . . . . . . . 32
6.2 A Few Things to Try . . . . . . . . . . . . . . . . . . . . . 36
6.3 Higher Math . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.4 More Arithmetic . . . . . . . . . . . . . . . . . . . . . . . 37
6.5 Random Numbers . . . . . . . . . . . . . . . . . . . . . . 38
6.6 The Math Object . . . . . . . . . . . . . . . . . . . . . . . 40
7 Flow Control 41
7.1 Comparison Methods . . . . . . . . . . . . . . . . . . . . 41
7.2 Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7.3 Looping . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.4 A Little Bit of Logic . . . . . . . . . . . . . . . . . . . . . . 51
7.5 A Few Things to Try . . . . . . . . . . . . . . . . . . . . . 57
8 Arrays and Iterators 59
8.1 The Method each . . . . . . . . . . . . . . . . . . . . . . . 61
8.2 More Array Methods . . . . . . . . . . . . . . . . . . . . . 64
8.3 A Few Things to Try . . . . . . . . . . . . . . . . . . . . . 65
9 Writing Your Own Methods 67
9.1 Method Parameters . . . . . . . . . . . . . . . . . . . . . 71
9.2 Local Variables . . . . . . . . . . . . . . . . . . . . . . . . 72
9.3 Experiment: Duby . . . . . . . . . . . . . . . . . . . . . . 74
9.4 Return Values . . . . . . . . . . . . . . . . . . . . . . . . 76
9.5 A Few Things to Try . . . . . . . . . . . . . . . . . . . . . 80
10 There’s Nothing New to Learn in Chapter 10 82
10.1 Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
10.2 Rite of Passage: Sorting . . . . . . . . . . . . . . . . . . . 88
10.3 A Few Things to Try . . . . . . . . . . . . . . . . . . . . . 90
10.4 One More Example . . . . . . . . . . . . . . . . . . . . . . 90
10.5 A Few More Things to Try . . . . . . . . . . . . . . . . . . 97
11 Reading and Writing, Saving and Loading, Yin and... 98
11.1 Doing Something . . . . . . . . . . . . . . . . . . . . . . . 98
11.2 The Thing About Computers... . . . . . . . . . . . . . . . 99
11.3 Saving and Loading for Grown-Ups . . . . . . . . . . . . 100
11.4 YAML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
11.5 Diversion: Double-Quoted Strings . . . . . . . . . . . . . 103
11.6 Back to Our Regularly Scheduled Programming . . . . . 105
11.7 Renaming Your Photos . . . . . . . . . . . . . . . . . . . 107
11.8 A Few Things to Try . . . . . . . . . . . . . . . . . . . . . 110
12 New Classes of Objects 112
12.1 The Time Class . . . . . . . . . . . . . . . . . . . . . . . . 113
12.2 A Few Things to Try . . . . . . . . . . . . . . . . . . . . . 115
12.3 The Hash Class . . . . . . . . . . . . . . . . . . . . . . . . 115
12.4 Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
12.5 Stringy Superpowers . . . . . . . . . . . . . . . . . . . . . 118
12.6 A Few More Things to Try . . . . . . . . . . . . . . . . . . 120
12.7 Classes and the Class Class . . . . . . . . . . . . . . . . 121
13 Creating New Classes, Changing Existing Ones 122
13.1 A Few Things to Try . . . . . . . . . . . . . . . . . . . . . 123
13.2 Creating Classes . . . . . . . . . . . . . . . . . . . . . . . 123
13.3 Instance Variables . . . . . . . . . . . . . . . . . . . . . . 124
13.4 new vs. initialize . . . . . . . . . . . . . . . . . . . . . . . 127
13.5 Baby Dragon . . . . . . . . . . . . . . . . . . . . . . . . . 128
13.6 A Few More Things to Try . . . . . . . . . . . . . . . . . . 133
14 Blocks and Procs 134
14.1 Methods That Take Procs . . . . . . . . . . . . . . . . . . 135
14.2 Methods That Return Procs . . . . . . . . . . . . . . . . . 139
14.3 Passing Blocks (Not Procs) into Methods . . . . . . . . . 140
14.4 A Few Things to Try . . . . . . . . . . . . . . . . . . . . . 142
15 Beyond This Fine Book 145
15.1 irb: Interactive Ruby . . . . . . . . . . . . . . . . . . . . . 145
15.2 The PickAxe: Programming Ruby . . . . . . . . . . . . . . 146
15.3 Ruby-Talk: The Ruby Mailing List . . . . . . . . . . . . . 146
15.4 Tim Toady . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
15.5 THE END . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
A Possible Solutions 150
A.1 Exercises from Chapter 2 . . . . . . . . . . . . . . . . . . 151
A.2 Exercises from Chapter 5 . . . . . . . . . . . . . . . . . . 152
A.3 Exercises from Chapter 6 . . . . . . . . . . . . . . . . . . 154
A.4 Exercises from Chapter 7 . . . . . . . . . . . . . . . . . . 155
A.5 Exercises from Chapter 8 . . . . . . . . . . . . . . . . . . 162
A.6 Exercises from Chapter 9 . . . . . . . . . . . . . . . . . . 165
A.7 Exercises from Chapter 10 . . . . . . . . . . . . . . . . . 169
A.8 Exercises from Chapter 11 . . . . . . . . . . . . . . . . . 180
A.9 Exercises from Chapter 12 . . . . . . . . . . . . . . . . . 187
A.10 Exercises from Chapter 13 . . . . . . . . . . . . . . . . . 193
A.11 Exercises from Chapter 14 . . . . . . . . . . . . . . . . . 199
Index 206
· · · · · · (收起)

读后感

评分

如何学习编程?一本好教材当然是不可缺少的。一本好的入门教材更是不可或缺的。为什么我说入门教材?我自己非理工科专业更莫说计算机相关专业出身,学习编程并不能像受过系统训练的人一样,拿来一本教材或者手册,熟悉一下词法(lexical)结构即可上手。皆因已经掌握编程的基本概...  

评分

如何学习编程?一本好教材当然是不可缺少的。一本好的入门教材更是不可或缺的。为什么我说入门教材?我自己非理工科专业更莫说计算机相关专业出身,学习编程并不能像受过系统训练的人一样,拿来一本教材或者手册,熟悉一下词法(lexical)结构即可上手。皆因已经掌握编程的基本概...  

评分

作为面向没有编程经验者的书籍,这本书的学习曲线还是太陡峭了。 一则,ruby看似容易有趣,但得皮毛容易获精髓困难。如果不能熟练使用oo/iterator/blocks等ruby特性,那跟学习其他编程语言也没啥区别。 其二,作者试图回避传统编程书籍中的套路,对数字、字符串、方法等基本...

评分

如何学习编程?一本好教材当然是不可缺少的。一本好的入门教材更是不可或缺的。为什么我说入门教材?我自己非理工科专业更莫说计算机相关专业出身,学习编程并不能像受过系统训练的人一样,拿来一本教材或者手册,熟悉一下词法(lexical)结构即可上手。皆因已经掌握编程的基本概...  

评分

如何学习编程?一本好教材当然是不可缺少的。一本好的入门教材更是不可或缺的。为什么我说入门教材?我自己非理工科专业更莫说计算机相关专业出身,学习编程并不能像受过系统训练的人一样,拿来一本教材或者手册,熟悉一下词法(lexical)结构即可上手。皆因已经掌握编程的基本概...  

用户评价

评分

我竟然又一天开始自主学编程。没想到没想到

评分

我竟然又一天开始自主学编程。没想到没想到

评分

我觉得作者实际上给零基础的人带来了很多坏习惯。。。

评分

impressing

评分

我觉得作者实际上给零基础的人带来了很多坏习惯。。。

本站所有内容均为互联网搜索引擎提供的公开搜索信息,本站不存储任何数据与内容,任何内容与数据均与本站无关,如有需要请联系相关搜索引擎包括但不限于百度google,bing,sogou

© 2025 book.quotespace.org All Rights Reserved. 小美书屋 版权所有