Seven Languages in Seven Weeks A Pragmatic Guide to Learning Programming Languages Bruce A. Tate All Chapters Instant Download
Seven Languages in Seven Weeks A Pragmatic Guide to Learning Programming Languages Bruce A. Tate All Chapters Instant Download
com
https://ebookmeta.com/product/seven-languages-in-seven-
weeks-a-pragmatic-guide-to-learning-programming-languages-
bruce-a-tate/
OR CLICK BUTTON
DOWNLOAD NOW
https://ebookmeta.com/product/programming-phoenix-liveview-bruce-a-
tate/
ebookmeta.com
https://ebookmeta.com/product/programming-languages-and-systems-ilya-
sergey/
ebookmeta.com
https://ebookmeta.com/product/her-fate-his-mate-wolves-of-windsor-
woods-1-1st-edition-krista-ames/
ebookmeta.com
In the Roar 1st Edition Milly Taiden
https://ebookmeta.com/product/in-the-roar-1st-edition-milly-taiden/
ebookmeta.com
https://ebookmeta.com/product/model-and-mathematics-from-the-19th-to-
the-21st-century-1st-edition-michael-friedman/
ebookmeta.com
https://ebookmeta.com/product/chosen-by-the-alien-dragon-a-fated-
mates-sci-fi-romance-1st-edition-ava-hunter-milly-taiden-3/
ebookmeta.com
https://ebookmeta.com/product/experimental-legal-education-in-a-
globalized-world-the-middle-east-and-beyond-1st-edition-mutaz-
qafisheh/
ebookmeta.com
Stud Muffin Rugged Dad Bods On The Mountain The Husky
Hunks Of Bourbon Peak Book 2 1st Edition Kelsie Calloway
https://ebookmeta.com/product/stud-muffin-rugged-dad-bods-on-the-
mountain-the-husky-hunks-of-bourbon-peak-book-2-1st-edition-kelsie-
calloway/
ebookmeta.com
What Readers Are Saying About
Seven Languages in Seven Weeks
Knowing multiple paradigms greatly influences our design abilities, so I’m always
on the lookout for good books that’ll help me learn them. This book nicely brings
prominent paradigms together. Bruce has experience learning and using multiple
languages. Now you can gain from his experience through this book. I highly
recommend it.
➤ Antonio Cangiano
Software engineer and technical evangelist, IBM
Fasten your seat belts, because you are in for a fast-paced journey. This book is
packed with programming-language-learning action. Bruce puts it all on the line,
and the result is an engaging, rewarding book that passionate programmers will
thoroughly enjoy. If you love learning new languages, if you want to challenge
your mind, if you want to take your programming skills to the next level—this
book is for you. You will not be disappointed.
➤ Frederic Daoud
Author, Stripes ...and Java Web Development Is Fun Again and Getting Started
with Apache Click
Do you want seven kick starts into learning your “language of the year”? Do you
want your thinking challenged about programming in general? Look no further
than this book. I personally was taken back in time to my undergraduate computer
science days, coasting through my programming languages survey course. The
difference is that Bruce won’t let you coast through this course! This isn’t a
leisurely read—you’ll have to work this book. I believe you’ll find it both mind-
blowing and intensely practical at the same time.
➤ Matt Stine
Group leader, Research Application Development at St. Jude Children’s
Research Hospital
➤ Travis Kaspar
Software engineer, Northrop Grumman
I have been programming for 25 years in a variety of hardware and software
languages. After reading Seven Languages in Seven Weeks, I am starting to under-
stand how to evaluate languages for their objective strengths and weaknesses.
More importantly, I feel as if I could pick one of them to actually get some work
done.
➤ Chris Kappler
Senior scientist, Raytheon BBN Technologies
Seven Languages in Seven
Weeks
A Pragmatic Guide to Learning Programming Languages
Bruce A. Tate
Acknowledgments . . . . . . . . . . . xi
Foreword . . . . . . . . . . . . . xv
1. Introduction . . . . . . . . . . . . 19
1.1 Method to the Madness 19
1.2 The Languages 21
1.3 Buy This Book 22
1.4 Don’t Buy This Book 24
1.5 A Final Charge 26
2. Ruby . . . . . . . . . . . . . . 27
2.1 Quick History 28
2.2 Day 1: Finding a Nanny 29
2.3 Day 2: Floating Down from the Sky 37
2.4 Day 3: Serious Change 49
2.5 Wrapping Up Ruby 57
3. Io . . . . . . . . . . . . . . . 61
3.1 Introducing Io 61
3.2 Day 1: Skipping School, Hanging Out 62
3.3 Day 2: The Sausage King 74
3.4 Day 3: The Parade and Other Strange Places 83
3.5 Wrapping Up Io 91
4. Prolog . . . . . . . . . . . . . . 95
4.1 About Prolog 96
4.2 Day 1: An Excellent Driver 96
4.3 Day 2: Fifteen Minutes to Wapner 108
viii • Contents
5. Scala . . . . . . . . . . . . . . 133
5.1 About Scala 133
5.2 Day 1: The Castle on the Hill 137
5.3 Day 2: Clipping Bushes and Other New Tricks 150
5.4 Day 3: Cutting Through the Fluff 164
5.5 Wrapping Up Scala 173
6. Erlang . . . . . . . . . . . . . 177
6.1 Introducing Erlang 177
6.2 Day 1: Appearing Human 181
6.3 Day 2: Changing Forms 191
6.4 Day 3: The Red Pill 202
6.5 Wrapping Up Erlang 214
7. Clojure . . . . . . . . . . . . . 217
7.1 Introducing Clojure 217
7.2 Day 1: Training Luke 219
7.3 Day 2: Yoda and the Force 236
7.4 Day 3: An Eye for Evil 249
7.5 Wrapping Up Clojure 257
8. Haskell . . . . . . . . . . . . . 261
8.1 Introducing Haskell 261
8.2 Day 1: Logical 262
8.3 Day 2: Spock’s Great Strength 277
8.4 Day 3: The Mind Meld 286
8.5 Wrapping Up Haskell 300
9. Wrap-Up . . . . . . . . . . . . . 305
9.1 Programming Models 305
9.2 Concurrency 308
9.3 Programming Constructs 310
9.4 Finding Your Voice 313
Index . . . . . . . . . . . . . 317
Dedication
The five months from December 2009 through April 2010 were among the
most difficult of my life. My brother, not yet 47 years old, had emergency
bypass surgery. No one had any clue that anything was wrong at all. (He
came through the surgery without further incident and is doing well.) In
late March, my sister was diagnosed with breast cancer. The biggest shock
of all came in early March. My mother was diagnosed with terminal cancer.
A few short weeks later, she was gone.
As you would expect, I am left to struggle with the grief of a jarring and
unexpected loss because of a brutally efficient disease. I would not be human
otherwise. But strangely, this experience has not been an entirely negative
one. You see, my mother was at peace with the remarkable life she lived,
her relationships with her family were strong and fulfilling, and she was
exactly where she wanted to be with her faith.
Lynda Lyle Tate put her creative energy into painting with watercolors. She
shared her art primarily through her Madison Avenue Art Gallery and her
classes. Before I left home, I had the opportunity to take a few lessons from
her. For someone from a technical profession, the experience was always a
little disorienting. I would visualize the masterpiece on my blank canvas.
As the actual image took shape, it drifted further and further from my
original vision. When I despaired that things were beyond my ability to fix,
Mom looked over my shoulder and told me what she saw. After a few flicks
of her talented wrist added darks to accentuate depth and highlights to add
clarity and detail, I would realize that I had not been too far astray at all. It
just took a gifted touch to bring back my creation from the brink of disaster.
Then, I would throw my excited arms up in victory and tell everyone in the
class about this thing I had created, not yet realizing that each member of
the class was going through their own private burst of joy.
After a little while, I learned that Mom was working on another canvas as
well. Through her church and through her profession, she’d find broken
When I told my mother that I would dedicate this book to her, she said that
she would like that, but she had nothing to do with computers. That is true
enough. The very thought of Windows would leave her helpless. But Mom,
you have had everything to do with me. Your well-timed words of encourage-
ment inspired me, your love of creativity shaped me, and your enthusiasm
and love of life guide me even now. As I think about these experiences, I
can’t help but feel a little better and a little stronger because I, too, am a
canvas shaped by the master.
In the Prolog community, thanks to Brian Tarbox for sharing your remark-
able experience with my readers. The dolphin projects, featured on Nova,
certainly add a dramatic flair to the Prolog chapter. Special thanks go to
Joe Armstrong. You can see how much your feedback shaped the chapter
and the overall book. Thanks also for contributing your map-coloring example
and your ideas for Append. They were the right examples delivered at the
right time.
In the Erlang community, I again thank Joe Armstrong. Your kindness and
energy have helped me form the ideas in this book. Your tireless promotion
of the way distributed, fault-tolerant systems should be built is working.
More than any other idea in any other language in this book, Erlang’s “Let
it crash” philosophy makes sense to me. I hope to see those ideas more
broadly adopted.
In the Clojure community, thanks to Stuart Halloway for your reviews and
ideas that forced me to work harder to bring a better book to my readers.
Your insights into Clojure and your instincts helped me understand what
was important. Your book was also hugely influential in the Clojure chapter
and actually changed the way I attacked some problems in other chapters
as well. Your approach in your consulting practice is greatly appreciated.
You’re bringing much-needed simplicity and productivity to this industry.
Thanks also to Rich Hickey for your thoughtful ideas on the creation of the
language and what it means to be a Lisp dialect. Some ideas in Clojure are
intensely radical and yet so practical. Congratulations. You’ve found a way
to make Lisp revolutionary. Again.
The reviewers did an outstanding job with this book. Thanks to Vladimir G.
Ivanovic, Craig Riecke, Paul Butcher, Fred Daoud, Aaron Bedra, David
Eisinger, Antonio Cangiano, and Brian Tarbox. You formed the most effective
review team I’ve ever worked with. The book is much stronger for it. I know
that reviewing a book at this level of detail is thankless, demanding work.
Those of us who still like technical books thank you. The publishing business
could not exist without you.
I also want to thank those of you who shared your ideas about language
choice and programming philosophy. At various times, Neal Ford, John
Heintz, Mike Perham, and Ian Warshak made significant contributions.
These kinds of conversations made me look smarter than I really am.
Beta readers, thank you for reading the book and keeping me working. Your
comments have shown me that a good number of you are working through
the languages rather than casually skimming. I’ve changed the book based
on hundreds of comments so far and expect to do even more throughout
the life of the book.
As always, mistakes that slipped through this fine team are all mine. For
those of you I missed, I offer my sincerest apologies. Any oversight was not
intentional.
Finally, thanks to all of my readers. I think that real hard-copy books have
value, and I can follow my passion and write because you do, too.
Bruce Tate
“Disgraceful,” said Margery, “the sign of an illiterate programmer and a decadent culture.”
“We must insist that the next programmer we hire has read all of ‘A la recherche du temps
perdu.’”
“Will it make them better at punctuation and make them get their quotes right?”
“Not necessarily, but it will make them a better programmer. It’s a Zen thing….”
It’s the same with programming. The first steps are the most difficult, and
you need a good teacher to encourage you to jump into the water.
Bruce Tate is such a teacher. This book gives you the opportunity to start
with what is the most difficult part of learning to program, namely, getting
started.
Let’s assume that you’ve actually managed the difficult task of downloading
and installing the interpreter or compiler for the language you are interested
in. What should you do next? What will be your first program?
Bruce neatly answers this question. Just type in the programs and program
fragments in this book to see whether you can reproduce his results. Don’t
think about writing your own programs yet—just try to reproduce the
examples in the book. As you grow in confidence, you will be able to tackle
your own programming projects.
The first step in acquiring any new skill is not being able to do your own
thing but being able to reproduce what other people have done before you.
This is the quickest way to mastering a skill.
Once you’ve gotten through the mechanics of entering and running programs,
you can sit back and relax. Your subconscious does the rest. While your
conscious brain is figuring out where to put the semicolons, your subcon-
scious is figuring out the deep meaning that lies underneath the surface
structures. Then you’ll wake up one day suddenly understanding the
deeper meaning of a logic program or why a particular language had a
particular construct.
Knowing a small amount about many languages is a useful skill. I often find
that I need to understand a bit of Python or Ruby to solve a particular
problem. The programs I download from the Internet are often written in a
variety of languages and need a little tweaking before I can use them.
Each language has its own set of idioms, its strengths, and its weaknesses.
By learning several different programming languages, you will be able to
see which language is best suited to the kinds of problems that interest you
most.
A Zen master might tell you that to be better at mathematics you’d better
study Latin. Thus it is with programming. To better understand the essence
of OO programming, you should study logic or functional programming (FP).
To be better at FP, you should study Assembler.
Saval úr, akit Mantes-ben csak Saval apónak hívnak, most kelt fel.
Esik az eső. Szomorú őszi nap; a levelek hullanak. Lassan hullanak
az esőben, mint egy másik, sűrűbb és lassúbb eső. Saval úrnak nincs
jókedve. Elmegy a kandallótól az ablakig, aztán az ablaktól a
kandallóig. Az életnek vannak sötét napjai. És Saval úrnak ezentúl
már csak ilyen sötét napjai lesznek, mert már hatvankét éves!
Magányosan él, igazán agg agglegény, aki körül nincsen senki.
Milyen szomorú így meghalni, egészen egyedül, minden odaadó
érzés híjával!
Az életére gondol, a letarolt, üres életére. Visszaemlékszik a
régmúlt időkre, a gyerekkorára, a gyerekkorában egy házra, arra,
amelyikben a szüleivel élt; aztán a kollégiumra, a vakációkra, a
párizsi jogászévekre. Aztán az apja betegségére, halálára.
Akkor visszajött, haza, hogy együtt legyen az anyjával. Így éltek
kettesben, a fiatal legény és az öreg asszony, békességben, semmi
többet nem is kívánva. Aztán az anyja is meghalt. Hajh, milyen
szomorú is az élet!
Egyedül maradt. És most már nemsokára ő rá is rákerül a sor, ő
is meghal. Eltűnik a világból és azzal vége. Paul Saval nem lesz
többé. Micsoda borzalmas história! A többi ember élni fog,
szeretkezni fog, nevetni fog. Úgy bizony, élik majd a világukat és ő, ő
nem lesz sehol! Mily különös, hogy az emberek nevetnek, mulatnak,
jókedvűek tudnak lenni a halálnak e mellett az örök bizonyossága
mellett! Még ha csupán valószínű volna ez a halál, akkor még
lehetne remélni; de több annál, – kikerülhetetlen! – olyan
kikerülhetetlen, mint az éjszaka a nappal után.