Sunday, July 5, 2015

Gizmodo- Learning to Code

How Do You Learn To Code?

46,354
17
Roshan Choxi - Quora
How Do You Learn To Code?1
It’s been my sole focus to answer this question for the last two years. I’ve noticed there are three strategies that successful students consistently use better than anyone else regardless of what resources they use:
1. Focus on habits, not goals
2. Learning alone is painful
3. Build things

1. Focus on habits, not goals

It seems counterintuitive that you shouldn’t focus on goals, but hear me out—it’s all about leverage. Anyone who works with me knows that I dweebishly reference the R’as Al Ghul scene in Batman Begins pretty much 3-4 times a day:
How Do You Learn To Code?
R’as tells Bruce: 
“Rub your chest, your arms will take care of themselves.”
If you focus on building the habit of programming for 20-30 hours a week, you will reach your goal of being a web developer. If you focus on the goal of being a web developer in X months, you get nothing from that but stress and insecurity about how far along you are. Focus on the habit, not the goal. Rub your chest, your arms will take care of themselves.
So here’s what you should do right now: put 15 minutes a day on your calendar to spend time programming. Don’t do more than 15, just focus on doing 15 minutes a day. If you can do it successfully with no excuses for a week, try bumping it up to 20 minutes a day. Don’t try to overextend yourself by doing an hour a day right off the bat, this is going to be a 10,000 hour marathon so we’re focusing on developing the habit right now. The number of minutes you put in isn’t as important as you showing up each day.

2. Learning alone is painful

When I was learning web development, the two biggest social components to my learning were having a mentor and belonging to a community.
Having a mentor: I worked at a small startup called merge.fm while in college. I learned more in the summer I spent working with one of their cofounders than I did in the entire previous year at my university. There’s just something about working alongside an expert who knows more than you that really accelerates your learning, you’re able to pick up on how they think and unveil what you don’t know you don’t know. There’s a reason why mentorship used to be the de facto standard of learning a new trade, it’s very effective.
Belonging to a community: For me, the two communities I belonged to were the Illini Entrepreneurship Network (a student organization at my university) and HackerNews (a large hacker/startup oriented online community).
I didn’t learn what objects and classes were from HackerNews, but I learned a different category of things. I learned that nobody likes Javascript. I learned that Rubyists are the hipsters of programming. I learned that Bret Taylor, Rich Hickey, and John Carmack are programming gods, and that software companies that are truly serious about coffee have kitchens that look like meth labs.In short, I learned how to talk shop. That turns out to be important when you’re working with other developers, but it’s also the thing that makes you feel like a developer.

3. Build things

In the first year of learning web development, I built:
  • A Digg Clone (from a Sitepoint book on Rails, I believe it’s out of date now though)
  • An E-Commerce App (from Agile Web Development with Rails 4)
  • A GeekSquad-esque App (personal project)
  • A Realtime, Online Classroom (personal project)
  • A Foreign Language Flashcard App (class project)
I think building real projects is important for many reasons, but the most important one to me is because it’s fun. That’s something that is tragically lost in classical education, but I think it’s important enough to be on this list. Look for resources that show you how to build things; http://ruby.railstutorial.org/ is a good one.

4. Be a cockroach

I secretly added a 4th item for those of you who’ve stuck around to read this far down the page.
Paul Graham once told the founders of Airbnb:
“You guys won’t die, you’re like cockroaches.”
You’ll probably want to quit learning how to code at some point. Like anything worthwhile, it’s difficult and will make you feel stupid at times. This is why #1 on this list is so important—stop worrying so much about whether you’re making progress or how much longer it’ll be until you feel like you’ve “made it.” All you have to do is focus on showing up, for 10-30 hours a week. Be as mindless as a cockroach about everything else, and don’t “die.”

About the author: Roshan Choxi, Cofounder and CEO of Bloc, “The World’s Largest Online Bootcamp”
How do I learn to code? originally appeared on Quora. You can follow Quora on TwitterFacebook, and Google+.
This answer has been lightly edited for grammar and clarity.

If you have tips, advice, or preferred coding resources, tell us about them in the comments. How did you start out?
17 65Reply
The following replies are approved. To see additional replies that are pending approval, click Show Pending. Warning: These may contain graphic material.
  • DrealmarRoshan Choxi - Quora
    I was lucky enough to learn programming (or more accurately STARTED to learn programming) at the age of 7 in BASIC on an old 8-bit computer, and been a software engineer for nearly 25 years now, and still LOVE every single bits of it (pun intended).
    I respectfully disagree with 1 and 2. They are not wrong, and they are surely right for many people, but they are definitelly not universal or maybe even for the majority. I’ve always been obsessed and passionate with programming, and keep working at it, and learning, because I’ve always had dream goals in my head.
    Learning a language by doing exercices is probably the worst, in my opinion. At least for me. Set yourself an attainable goal. A small, but exciting software or game you’d want to *make*. Then learn as you go from there. 
    You gonna hit real life speed bumps, you gonna lose a lot of running in circle inside dead ends before realizing you need to drop buckets of code, backtrack, and start a chunk of it from scratch. You’ll spend a few hellish and painful nights doing nothing but googling an issue and tracing through your code. 
    But everything you learned will be burned on your brain like a white hot branding iron and it will never go away.
    So yeah, your #3 is the universal one. The one everyone should go for.
    BUILD THINGS! :)
    • I mostly agree with this. I started coding in 5th grade on a Commodore 64 and even to this day, still love coding. My passion drives me.
      However, I also like mentoring people in how to code. Mostly so that people do it my way and I don’t have to suffer through someone’s messed up code.... :) But when I mentor people, I start with finding a project that interests them and we write it multiple ways (Windows app, Web page, Web app with an API, Mobile app, etc.) I make them take a small app through all of these different styles so that they can see the differences and the similarities. But making it an app that “they’ve always wanted to have”, they are more vested in the outcome instead of it feeling like homework from a class. There are also more real-world scenarios that they encounter than any trivial exercise would raise.
      • Hey, I’m a nerd and my kids (currently 9, 7, and 3) are nerds, and my oldest one is really intrigued about the whole ‘making video games’ bit. 

        So I want to teach him to code.

        I’m not a programmer, but I’ve tried taking it up a time or two. I’m bad about getting tired of a project, though, so I still haven’t made anything more than a couple unfinished text ‘Adventure’ type games, one in TI-BASIC on my calculator back in high school and one in Python (lost to an HDD crash). 

        Anyway, from your experience, what kind of suggestions do you have for teaching my kids about coding? Should I start with BASIC, do you think?
        • I was going to make the same observation. I learn best from actually doing things. Just find a project to work on, perhaps some application that you wish that you had, and build it. Also, look at other peoples code. Look at it and understand it. I learned a lot in my early years by working as a Junior programmer on a team with some great developers and learned a lot just from looking at their code. 
          • I agree with you, habits mean nothing if do not try to acomplish a goal.
            But you need a concrete and modest goal to begin with. But not too modest so it do not push you beyond your limit, and a tangible one, like making an application to do this or that, not an abstract one like becoming this or that, or take some title or position, or that certification or job, or salary.
            You need to program like a vocation (from latin vocare, to call), a calling, not because it may pay well.
            Programming is difficult, frustating at times, but very fullfilling, but without felling it like a vocation it is only a burden. painfull like a diet and meaningless like a convenience marriage.
            With a goal you have a sense of acomplishment, and if it is a well chosen one you will drawn to it like an irresistible impulse and 10 hours will look like an instant.
            Then programming will not be an habit but a necessity, and the other things will be a natural consequence.
          • allan jonesRoshan Choxi - Quora
            I always say the best coders are the long-term lazy people. it takes a specific mindset to want to spend two days writing code to automate something that takes ten minutes to do. but if you do that ten minutes at least once a day? it pays for itself - eventually. if you don’t have that mentality to start with, you’ll solve the problem in front of you, but never see the underlying issue causing it in the first place. identifying the issue is, imo, the single most important skill in development. 
            as a practical example - what’s the solution to wil e. coyote’s problem? easy: go to a restaurant. hunger is the problem, not catching road runner. learning the difference is huge when it comes to solving problems with code. 
            as to learning - hands-on effort on something that interests you, coupled with feedback from someone who knows what they’re doing. but that comes, initially, from passion for what you’re doing. without that all the book learning and mentorship in the world won’t help. 
            • Yup, those people that do “quick fixes” just to do them annoy the fuck out of me. So you want to keep supporting that for the next year? Fine. I’m not touching a single fucking project where I have to put that bullshit in place or make it work with something else just because the lead asshole says it’s the only way to do it.
            • TelRoshan Choxi - Quora
              [quote]
              1. Focus on habits, not goals
              2. Learning alone is painful
              3. Build things
              [/quote]
              Your right for a lot of people but your also wrong. 
              Programming is goals, a hundred thousand simple steps that executed one after the other are a program. Breaking a problem down to it’s absolute simplest steps, learning those absolutely simple steps, that’s the habit, that’s the goal you should focus on. It is much more a task a day habit than coding as a habit.
              Your right however that learning alone is painful. Coding is elitest. There is no handholding in this job and failure is always an option. You will often need to know the answers that are only apparent six months in on the first day, and to make it alone you need to be a quick study with rock solid fundamentals. Having somoen to turn to can be a life saver.
              You are absolutely right every programmer should build things. Build programs to test features, build features to test improvements. You know your a coder when you program an application just to learn how to code it’s features. It’s not even limited to pure coding, it’s fairly common for coders to build game levels just to test how new shaders behave in their proper environment.
              • If it’s not on there, post your own questions, and you might just start a debate on the site about how it works
              • MonkeyTRoshan Choxi - Quora
                I suppose you can’t learn like I did: walk to Radio Shack after school with a backpack of Byte Magazine tutorials and plop down in front of their TRS-80 floor display for a few hours each week.
                • Those were the days! My step father used to take me to NY Amateur Computer Club meetings once upon a time. 
                • hayesmpRoshan Choxi - Quora
                  Having now worked professionally as a Rails engineer for the past 3.5 years: got started with Rails for Zombies on Code School and then just built projects. Converted a iphone app into Rails site, built a crowd-funding site from scratch, etc. Doing real world projects is by far the fastest way to get up to speed. 
                  Now having said all that, I worked as an iOS developer for 2 years before that, and grew up writing code in Basic and C, so YMMV. I’m not sure what it would like coming from someone with no previous programming experience.
                  • Danny DaltonRoshan Choxi - Quora
                    I spent nearly my whole life wanting to be in a field with computers. One story I hear a lot is changing all of the names of the files on the computer to my name when I was extremely little, and I’m guessing that thing had Windows ME on it, if I remember correctly.
                    I started coding by a YouTube video saying “How to make a virus” because, hey, I was a bored kid. It was a video telling me to type into Notepad this line:
                    MsgBox(“This is a virus”)
                    And save it as a “.vbs” file. I learned a bit later that it was simply a VBScript file (a script using Visual Basic as a language). I also eventually got books on how to program in Visual Basic, HTML4 (2 of those, and HTML4 was the standard in my time, and those books also covered some now-deprecated elements such as and , in addition to some basic CSS). I learned a slight bit of JavaScript from using W3C as a reference, and I think I did a PHP form submit on a website I had when I was maybe 12 or 13. It just was a little thing that redirected you, but, hey, it was neat.
                    In the span of the time between me being 12 or 13 and now at age 18, fresh out of high school, I’ve made a couple applications in VB.Net, including:
                    • A thing to see the contents of your clipboard
                    • A bit of a tool to automatically count Monopoly Money and Yahtzee scores
                    • A tool that can resize pictures in batch from one set of dimensions to another (say, 16 MP to 640x640), and it offered a variety of options to compensate for differing aspect ratios, and it can use the C# SDK for Facebook’s API to post your pictures to Facebook
                    • A tool that I could use for trig equations that weren’t solvable on a graphing calculator (such as sec(x) or a solver for any quadratic equation)
                    Now, I have a Mac, and I’m making a game using Objective-C and SpriteKit called “Throw, Catch, Throw!” where you throw a ball into the air and catch it. It’s currently “Waiting for Review” in iTunes Connect.
                    My advice? Have fun with it. It’s like writing a book; you can’t start unless you have an idea of what you want to accomplish. See something that might be fun to mess around with in the auto-completion menu? Mess around with it and see what happens, and you might just be able to turn a concept you might come across into a working application.
                    I don’t like to do exercises because they disrupt a programmer’s creative flow. When I hear someone complain about my school’s educational system, they talk about how the system restricts them from what they actually want to do/study. There can be the predicament that the school doesn’t have the program that they want to study, but it’s not just that. A lot of the time, the examples actually disrupt the creative thinking process. A kid can’t make up a story while a book is being read to them. Kids can’t think creatively while trying to think in a formula. Although the adolescent brain and the adult brain are very different, they both learn in a similar fashion, and, for some, it might not just be “monkey see, monkey do.” 
                    If I were ever a CS professor at a college/university, I’d require a creative writing class be taken first, so the kids can prove that they have the imagination to create a story. A good game, most of the time, has a good story to back itself up with. It doesn’t HAVE to, but it needs some sort of leading idea. Some sort of passion.
                    That’s my advice. Although I’m new here, I’m hoping my simple game of throwing a ball into the air and catching it is fun to many and that people like it. I know that money can be made doing it, but it doesn’t necessarily have to be about money. It can simply be fun.
                    • clarksbrotherRoshan Choxi - Quora
                      It was kind of 2 parts for me. I’ve always been a nerd - if I really needed something that didn’t exist that wasn’t too complex/time intensive, I’d try and code it myself one way or the other. (Tutorials on the web are your best friend). That gave me enough of a basis to wade into just about any project.

                      Then, an opportunity through work occurred which basically put me into a high pressure driver seat to pretty much independently develop and deploy a lot of applications in a a relatively short period of time. Spending 50 hours a week learning and diving head first into something is the surest way to pick it up. I really felt it was no different than if I got dropped off in the middle of a foreign land where no one spoke English. Eventually through a lot of trial and error, I would start to get pretty fluent in the language if out of immediate need if nothing else. 
                      Now, my applications are seem by millions of people every day... but used by only a handlful... (have fun with that riddle!)
                      • ShadowofTime01Roshan Choxi - Quora
                        I tried to self teach when I was like 10 or 12, but I didn’t really understand coding until I was in college when we had to use MATLAB for my aerospace engineering classes. That opened up a door that allowed me to read most code and learn it it pretty quickly. I think once you understand the logic behind how most scripts are set up, it’s easy to at least have a base understanding of most coding languages. Unlike spoken languages, computing languages all have their “grammar” rooted in logic, whereas the former has grammar that is influenced by culture. This makes most coding languages easier to understand once you have a grasp of one of them, it’s just the “vocabulary” that changes.
                        Load More

                        No comments:

                        Post a Comment

                        Please leave a comment-- or suggestions, particularly of topics and places you'd like to see covered