Share E-Book

The Self-Taught Programmer The Definitive Guide to Programming Professionally (Cory Althoff)(Z-Library)

Author

Rating 3.5 AI initial rating

Log in to rate

Programming
Language English

I am a self-taught programmer. After a year of self-study, I learned to program well enough to land a job as a software engineer II at eBay. Once I got there, I realized I was severely under-prepared. I was overwhelmed by the amount of things I needed to know but hadn't learned yet. My journey learning to program, and my experience at my first job as a software engineer were the inspiration for this book. This book is not just about learning to program; although you will learn to code. If you want to program professionally, it is not enough to learn to code; that is why, in addition to helping you learn to program, I also cover the rest of the things you need to know to program professionally that classes and books don't teach you. "The Self-taught Programmer" is a roadmap, a guide to take you from writing your first Python program, to passing your first technical interview. I divided the book into six sections: 1. Learn to program in Python 3 and build your first program. 2. Learn Object-oriented programming and create a powerful Python program to get you hooked. 3. Learn to use tools like Git, Bash, regular expressions and databases. Then use your new coding skills to build a web scraper. 4. Study Computer Science fundamentals like data structures and algorithms. 5. Finish with tips for working with a team and landing a programming job. You CAN learn to program professionally. The path is there. Will you take it?

Format PDF
Size 40.1 MB
(First 20 pages)

Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Page 1
(This page has no text content)
Page 2
The Self-taught Programmer Cory Althoff Copyright © 2016 by Cory Althoff All rights reserved. This book or any portion thereof may not be reproduced or used in any manner whatsoever without the express written permission of the publisher except for the use of brief quotations in a book review. ISBN 978-1-940733-01-2 Library of Congress Number www.theselftaughtprogrammer.io
Page 3
This book is dedicated to my parents Abby and James Althoff for always supporting me.
Page 4
(This page has no text content)
Page 5
(This page has no text content)
Page 6
Part I Introduction to Programming
Page 7
(This page has no text content)
Page 8
Chapter 1. Introduction "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." — Linus Torvalds I majored in Political Science at Clemson University. Before I chose this path I considered Computer Science. I even enrolled in an Introduction to Programming class my Freshman year, but quickly dropped it. It was too difficult. While living in Silicon Valley after graduation I decided I needed to learn to program. A year later, I was working as a software engineer II at eBay (above an entry level software engineer, but below a senior software engineer). I don’t want to give the impression that this was easy. It was incredibly challenging. In between throwing things at the wall, it was a lot of fun too. I started my journey learning to program in Python, a popular programming language. This book, however, is not about teaching you how to program in a specific language (although it does). There are plenty of amazing books, classes and resources that do that already. The focus is everything else those standard resources do not teach you. It’s about the things I had to learn on my own in order to become a software engineer. This book is not meant for someone looking for a casual introduction to programming so they can write code as a hobby. This book is written specifically for those looking to program professionally. Whether your goal is to become a software engineer, an entrepreneur or to use your new programming skills in another profession, this book was written for you. Learning a programming language is only part of the battle. There are other skills you need in order to speak the language of computer scientists. I will teach you everything I learned on my journey from programming novice to professional software engineer. I wrote this book to give aspiring programmers an outline of what they need to know. As a self-taught programmer, I didn’t know what I needed to learn. The introduction to programming books are all the same. They teach you the basics of how to program in either Python or Ruby and send you on your way. The feedback I’ve heard from people finishing these books is, “What do I do now? I am not a programmer yet, and I don’t know what to learn next.” This book is my answer to that question. How This Book Is Structured This book is divided into six parts, based on moving through the following stages: learning to program, learning object-oriented programming, learning to use programs (like your operating system) that will make you a better programmer, learning Computer Science, learning to program for production and getting a job and working on a team.
Page 9
Many of the subjects covered in a single chapter of this book could be—and are— covered by entire books. My goal is not to cover every detail of every subject you need to know. My goal is to give you a map—an outline of all of the skills you need to develop in order to program professionally. Part I: Introduction to Programming. You will write your first program as quickly as possible, hopefully today. If you already know how to program you can use this section to start learning Python. If you already know Python, skip it. Part II: Introduction to Object-oriented Programming. I cover the different programming paradigms—focussing on object-oriented programming—and build a game that will show you the power of programming. After this section, you’ll be hooked on programming. Part III: Introduction to Programming Tools. You learn to use different tools to take your programming productivity to the next level. By this point you are hooked on programming and want to get even better. You will learn more about your operating system, how to collaborate with other engineers using version control, how to use your Interactive Development Environment to boost your productivity and how to install and manage other people's programs. Part IV: Introduction to Computer Science. Now that you can program, you will have all kinds of questions about how everything works. This section is where a lot of those questions get answered. I cover algorithms and data structures, network programming and computer architecture. Part V: Programming for Production. You will learn to program for production ( create code that is actually used by other people). I cover the software development process, testing and best programming practices. Part VI: Land a Job. The final section is about getting a job as a software engineer, working on a team and improving as a programmer. I provide tips on how to pass a technical interview, work on a team as well as advice on how to further improve your skills. If you don’t have any programming experience, you should try to practice programming on your own as much as possible between each section. There are additional resources to explore provided at the end of each section. Don’t try to read this book too quickly. Instead, use it as a guide and practice for as long as you need in between sections . Endgame First The way I learned to program is the opposite of how Computer Science is usually taught, and I structured the book to follow this approach . Traditionally, you spend a lot of time learning theory ; s o much so, that many Computer Science graduates come out of school not knowing how to program. In his blog, Why Can’t Programmers.. Program? , Jeff Atwood writes: “Like me, the author is having trouble with the fact that 199 out of 200 applicants for every programming job can’t write code at all. I repeat: they can’t write any code whatsoever .” This led Atwood to create the FizzBuzz coding challenge, a programming
Page 10
test used in programming interviews to weed out candidates. Most people fail the challenge, and that’s why we spend so much of this book learning the skills you will use in practice. Don’t worry, we also learn how to pass the FizzBuzz test. In The Art of Learning , Josh Waitzkin of Searching for Bobby Fischer fame, describes how he learned how to play chess in reverse. Instead of studying opening moves, he started learning the endgame (where there are only a few pieces left on the board) first. This gave him a better understanding of the game , and he went on to win many championships. Similarly, I think it is more effective to learn to program first , then learn theory later, once you are dying to know how everything works under the hood. That is why I wait until the fourth section of the book to introduce Computer Science theory. While theory is important, it will be even more valuable once you already have programming experience. The Self-taught Advantage Learning how to program outside of school is increasingly common. A 2015 Stack Overflow (an online community of programmers) survey found 48 percent of respondents did not have a degree in computer science 10 . When I was hired at eBay, I was on a team that included programmers with CS degrees from Stanford, Cal and Duke, as well as two Physics PhD’s. At 25, it was intimidating to realize that my 21-year-old teammates knew 10 times more about programming and computer science than I did. As intimidating as it might be to work with people who have bachelor ’s, master ’s and PhD’s in Computer Science, never forget you have what I like to call the “self-taught advantage .” You are not reading this book because a teacher assigned it to you, you are reading it because you have a desire to learn, and wanting to learn is the biggest advantage you can have. Why You Should Program Programming can help your career regardless of your profession. If you are reading this book I assume you have already decided you want to learn to program. But I’m still going to cover why you should to give you extra motivation. Learning to program is empowering. I love coming up with new ideas, and I always have a new project I want to work on. Once I learned how to program, I could sit down and build my ideas without needing to find someone to do it for me. Programming will also make you be better at everything. Seriously. There aren’t many subjects that don’t benefit from finely tuned problem-solving skills. Recently, I had to do the very tedious task of searching for housing on Craigslist, and I was able to write a program
Page 11
to do the work for me and email me the results. Learning to program will free you from repetitive tasks forever. If you do want to become a software engineer, there is an increasing demand for good engineers and not enough qualified people to fill the available positions. By 2020, an estimated one million programming jobs will go unfilled 45 . Even i f your goal isn’t to become a software engineer, jobs in fields like science and finance are beginning to favor candidates with programming experience. Sticking With It If you don’t have any programming experience and are nervous about making this journey, I want you to know you are absolutely capable of doing it. There are some common misconceptions about programmers like they all are really good at math. This isn’t true, but it is hard work. Luckily, a lot of th e material covered in this book is easier to learn than you think. In order to improve your programming skills you should practice programming every day. The only thing that will hold you back is not sticking with it, so let’s go over some ways to make sure you do. I used a checklist to make sure I practiced every day and it really helped me stay focused. If you need extra help, Tim Ferriss, a productivity expert, recommends the following technique to stay motivated. Give money to family or friends with the instructions that it is either to be returned to you upon completing your goal within a timeframe of your choosing, or donated to an organization you dislike. How This Book is Formatted The chapters in this book build on one another. If you see something you don’t understand, it might have been covered in a previous chapter. I try not to re-explain concepts, so keep this in mind. Important words are italicized when they are defined. There is a vocabulary section at the end of each chapter where each italicized word is defined. Technologies Used In This Book This book teaches certain technologies in order to give you as much practical programming experience as possible. In some cases I had to choose between many different popular technologies. In Chapter 20: “ Version Control ” (for those readers who are
Page 12
unfamiliar with version control, I will explain later), we go over the basics of using Git, a popular version control system. I chose Git because I consider it the industry standard for version control. I use Python for the majority of programming examples because it is a popular first programming language to learn, and it is a very easy language to read, even if you have never used it. There is also a huge demand for Python developers in just about every field. But, I try to be as technology agnostic as possible: focusing on concepts instead of technologies. In order to follow the examples in this book you will need a computer. You computer has an operating system —a program that is the middleman between the physical components of the computer and you. What you see when you look at your screen is called a graphical user interface or GUI, which is part of by your operating system. There are three popular operating systems for desktop and laptop computers: Windows , Unix and Linux . Windows is Microsoft’s operating system. Unix is an operating system created in the 1970s. Currently, the most popular Unix operating system is Apple’s OS X. Linux is an open-source operating system used by the majority of the world’s servers . A server is a computer or computer program that performs tasks like hosting a website. Open- source means the software is not owned by a company or individual, instead it is maintained by a group of volunteers. Linux and Unix are both Unix-like operating systems, which means they are very similar. This book assumes you are using a computer running Windows, OS X or Ubuntu (a popular version of Linux ) as your operating system. Vocabulary FizzBuzz : a programming test used in programming interviews to weed out candidates. operating system : A program that is the middleman between the physical components of the computer and you. open-source : Software that is not owned by a company or individual, but is instead maintained by a group of volunteers. Windows : Microsoft’s operating system. Unix : An operating system created in the 1970s. Apple’s OS X is a version of Unix. Linux : An open-source operating system used by the majority of the world’s servers. server : A computer or computer program that performs tasks like hosting a website. Challenge Create a daily checklist that includes practicing programming.
Page 13
(This page has no text content)
Page 14
Chapter 2. Getting Started “A good programmer is someone who always looks both ways before crossing a one-way street.” —Doug Linder What is Programming Programming is writing instructions for a computer to execute. The instructions might tell the computer to print Hello, World! , scrape data from the internet or read the contents of a file and save them to a database. These instructions are called code . Programmers write code in many different programming languages. In the past, programming was much harder, as programmers were forced to use cryptic, low-level programming languages like assembly language . When a programming language is low- level it is closer to being written in binary (0s and 1s) than a high-level programming language (a programming language that reads more like English), and thus is harder to understand. Here is an example of a simple program written in an assembly language: global _start section .text _start: mov rax , 1 mov rdi , 1 mov rsi , message mov rdx , 13 syscall ; exit(0) mov eax , 60 xor rdi , rdi
Page 15
syscall message: db "Hello", 10 43 Here is the same program written in a modern programming language: print ( "Hello, World!" ) As you can see, programmers today have it much easier. You won’t need to spend time learning cryptic , low-level programming languages in order to program. Instead, you will learn to use an easy-to-read programming language called Python. What is Python Python is an open-source programming language created by Dutch programmer Guido van Rossum and named after the British sketch comedy group, Monty Python’s Flying Circus . One of van Rossum’s key insights was that programmers spend more time reading code than writing it, so he created an easy-to-read language. Python is one of the most popular and easiest to learn programming languages in the world. It runs on all the major operating systems and computers and is used in everything from building web servers to creating desktop applications. Because of its popularity, there is a large demand for Python programmers. Installing Python In order to follow the examples in this book, you need to have Python 3 (version 3 of Python) installed. You can download Python for Windows and OS X at http://python.org/downloads . If you are on Ubuntu, Python 3 comes installed by default. Make sure you download Python 3, not Python 2. Some of the examples in this book will not work if you are using Python 2. Python is available for both 32-bit and 64-bit computers. If you have a new computer, purchased after 2007, it is most likely a 64-bit computer. If you aren’t sure if your computer is 32-bit or 64-bit, an internet search should help you figure it out. If you are on Windows or a Mac, download the 64- or 32-bit version of Python, open the file and follow the instructions. You can also visit
Page 16
http://theselftaughtprogrammer.io/installpython for videos explaining how to install Python on each operating system. Troubleshooting From this point forward, you need to have Python installed. If you having problems installing Python, please skip ahead to chapter 11 to the section titled “Getting Help”. The Interactive Shell Python comes with a program called IDLE (short for interactive development environment ); it is also the last name of Eric Idle, one of the members of Monty Python’s Flying Circus . IDLE is where you will be typing your Python code. Once you’ve downloaded Python, search for IDLE in Explorer (PC) , Finder (Mac) or Nautilus (Ubuntu) . I recommend creating a desktop shortcut to make it easy to find. C lick on the IDLE icon, and a program with the following lines will open up (although this could change so don’t worry if the message is absent or different) : Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44)
Page 17
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "copyright", "credits" or "license()" for more information. This program is called the interactive shell. You can type Python code directly into the interactive shell and the shell prints the results. At the prompt (>>>) t ype: print ( "Hello, World!" ) and press enter. IDLE might reject code that is copied from Kindle , other eBooks or word processors like Microsoft Word. If you copy and paste code and get an unexplainable error message, try typing the code directly into the window . You must type the code exactly as it is written in the example, including quotation marks, parentheses and any other punctuation. The interactive shell will respond by printing Hello, World!
Page 18
In the programming world, when you teach someone a new programming language, it is tradition that the first program you teach them is how to print Hello, World! So, congratulations! Y ou just wrote your first program. Saving Programs The interactive shell is useful for quick computations, testing small bits of code and writing short programs you don’t plan on using again. You can also use IDLE to save a program for reuse. Start the IDLE application, click “File” (in the menu bar on the top left of the IDLE editor) then select “New File.” This will open up a t ext editor , which usually has a blank white background . You can write your code in this text editor, then save it to run later.
Page 19
When you run your code, the output of the code you wrote will appear in the interactive shell. You need to save your changes while editing code before running it again. Type the Hello, World! program into the text editor: Go to “File” again and select “Save As.” Name your file “hello_world.py” and save it. Python files have to end with .py. Once you’ve saved your file, click “Run” (again, in the menu bar in the top left corner of the IDLE editor) and select “ Run Module .” Alternatively, you can press the F5 key command, the equivalent of selecting “Run Module” from the menu bar. Hello World! will print in the interactive shell, as if you had typed th is line of code. However, in this case, since you saved your program, you can run it as many times as you like. The program you created is simply a file with a .py extension, located on your computer wherever you saved it. The name I chose for the file—“hello_world.py”—is completely arbitrary, you can name the file anything. Like this example, writing programs in
Page 20
Python simply involves typing text into files and running them using the interactive shell. Easy, right? Running Example Programs Throughout the book, I will give examples of code and the results that print out when you run it. Whenever I do this, you should enter the code and run it yourself. Sometimes you should type the code in the interactive shell, and sometimes you should type the code into a new .py file. I will explain how you will know where to run your code in the next chapter. The reason for this is short examples are best run using the shell, and the text editor is better for longer programs you want to save and edit. In the interactive shell, if you make a mistake in your code—a typo for example—and the code doesn’t work, you have to type everything again. Using the text editor lets you save your work, so if you make a mistake, you simply edit the mistake and rerun the program. Another reason the distinction is important is the output of a program running from a file versus the shell can be slightly different. If you type 100 into the interactive shell and press enter, the interactive shell will output 100 . If you type 100 into a .py file and run it, there will be no output. This difference can cause confusion, so be mindful of where you are running a program from if you do not get the same output as the example. Vocabulary programming : Writing instructions for a computer to execute. code : The instructions programmers write for a computer to execute. low-level programming language : A programming language closer to being written in binary (0s and 1s) than a high-level programming language. assembly language : A type of difficult to read programming language. high-level programming language : A programming language that reads more like English than a low-level programming language. Python : The easy to read, open-source programming language you will learn to use in this book. Created by Guido van Rossum and named after the British sketch comedy group, Monty Python’s Flying Circus. Challenge Try to print something other than Hello, World! .
The above is a preview of the first 20 pages. Register to read the complete e-book.

Recommended for You

Loading recommended books...
Failed to load, please try again later

Tip the Site

Scan the WeChat Pay or Alipay code to tip. No login required.

WeChat Pay
Alipay
← Back to List