The First 20 Hours: How to Learn Anything . . . Fast! by Kaufman Josh

The First 20 Hours: How to Learn Anything . . . Fast! by Kaufman Josh

Author:Kaufman, Josh [Kaufman, Josh]
Language: eng
Format: epub, mobi, pdf
Publisher: Penguin Group US
Published: 2013-06-13T00:00:00+00:00


Rage Against the Machine

I want to clarify something: the process I described sounds very linear and straightforward. That’s because, up to now, I’ve been describing what worked, not what didn’t.

Coding a useful, working web application is a bit like putting together a puzzle with a few extra challenges: you don’t know which pieces exist, you have to create some of the pieces yourself, and if you make a mistake, the puzzle explodes.

Here’s what my programming process actually looked like: I’d come up with an idea for how I thought part of the program would work. I wrote some code, tested it, and it broke the program. I’d try to modify it. Sometimes my change would fix the program, sometimes it wouldn’t, and sometimes it would break even more things. If I got seriously stuck, I’d search for the error message or library on Stack Overflow or Google.

When you’re still learning what everything does, your application is broken way more often than it’s working. You also learn about the value of things like version control, which lets you roll back your code to a previous working version.

Remember when I mentioned I didn’t really grok what git was for? It’s for this: if you’re editing files and something breaks, you may not be able to find what’s broken. Rolling back to a previous version that works is a godsend and a relief. If you can’t, you panic.

Around the point where I started coding the Add to Sidebar feature, I broke the application. I tried to find what I did wrong, but I couldn’t figure it out. If I had hair on my head, I would’ve torn it out.

That’s when you learn the value of git branch and git merge: you can create experimental copies of your program, then make your modifications. If your code works, you can merge it back into the master copy. If you screw things up, you can delete your experimental branch without losing all of your previous work.

Programming is hard, and there are millions of ways to screw it up. The computer is unforgiving, and doesn’t suffer ill-formed commands. Likewise, it’s easy to overlook little details that produce unexpected results. I was having a terrible time with a bug that was saving a bunch of blank records to the database, which showed up on the “List all” page.

Every time I viewed the page, more phantom pages would appear in the list, and I couldn’t figure out where they were coming from. It ended up being a bug in the “list all” route: I was using an incorrect command to retrieve the records from the database.

Every time I broke something, I learned something. That’s one of the hidden benefits of programming. The computer is the fastest of all feedback loops. If you do something wrong, you know it right away. If you do it right, you get to see the results of your work immediately. If you can avoid the impulse to throw your computer across the room, the instant feedback can make programming quite addictive.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.