Want to learn to code? Start here.
blog.zackshapiro.com
blog.zackshapiro.com
1. Shell? SSH? Wtf is this? Console? Huh? Why am I using something that looks like DOS, it's 2013! Where is the GUI and menus?!
So I learned about Shell/SSH, connected to my server, root and all that stuff.
2. Navigating folders and directories - dear god, this was a nightmare. I never used 'cd \' since '98 and that's only cause I wanted to run DOS games.
3. Kept seeing all these commands with '-' that makes installing extensions seem oh so easy! I wanted APC for PHP, stared at this page (http://pecl.php.net/package/APC) for an hour, trying to figure out what to do. Googled like mad. Searching for anything.
Learned about "pecl install APC", nope no luck. Then I was told to compile it from source. Yeah, I know exactly what that means! Spent the next 4 hours trying to understand why phpize wouldn't work!
Oh, I wasn't doing it from the right directory. -_-
I mean, I'm slowly beginning to see how it all fits together but none of the education sites teaches you this stuff!
It's like learning cooking recipes when you don't know how to turn the stove on, or what a stove even looks like. Or what's the difference between gas and electricity stove, how to turn on the tap to get water, etc. You learn a great recipe, know all the ingredients and the cooking time down to the second, but when it comes to use the tools and actually cook? Nope - cause I don't know how to turn on the stove or know what a stove looks like! (I know this is an extreme analogy)
I wish tutorials would start with projects and setting it up from scratch. If you're going to show me how to do something localhost, you have to show me how to do it on a server (and set up) as well or else I'll never be able to make that connection. (Well not never, but makes it harder)
Oh, editing files in the terminal is a blast too :P http://amath.colorado.edu/computing/unix/vi/ This saved my life that day.
So…I definitely vote for teaching the environment before programming.
PS: I did eventually install APC…after an entire day :P Now I'm trying to find and learn about setting up master/staging/production (and what it all means).
Edit: Just to give some context of why I needed VPS - I wanted root access so I can make a wiki have clean URL (rewrite) and figured why not, learn about VPS. Then that's where I realized I need to learn 10 other things to do this one single thing. The APC was a suggested caching option to improve the site, and trying to do that also needed me to learn more stuff. So it's all kind of ties together when you're trying to accomplish a (seemingly) tiny thing.
Furthermore, most operating systems already have enough of the basics installed that you're able to get up and running with simple programming pretty quickly anyway. Learning to develop locally and deploying to a live server are very different. Yeah, both run just about identical software but the process is different. Locally, someone who's learning will install MAMP or xampp or something or copy and paste a line of code to get homebrew or rvm on their machine. There's a 50/50 mix of comfortable clicking around the GUI and typing in the terminal. If you're just learning and go right to the vps I think you're jumping the gun. The system may be the same but it takes some experience before you realize that what you were comfortable with when clicking around is almost the same thing you're doing in the vps over ssh except you have to know which command to run rather than clicking "install".
Beginner books always have a section dedicated to setting up your environment and sometimes take you all the way through deployment. Articles online don't necessarily need that as they mostly assume you'll find that information elsewhere and only concern themselves with the task at hand - coding.
Beyond all that I think that your frustrations are something you'll be grateful for in the future when you do get it. I knew how to code before I knew how to run a server. If I had learned the server stuff first and didn't quit then I wouldn't have understood why I was doing these things and I wouldn't have the knowledge of how everything from the language I was using to the server to the OS all worked together which is invaluable. If I were blindly following instructions on how to set up a lamp stack I wouldn't know that hey I don't need these apache modules or oh I can disable this ini setting, etc.
On one level I get your gas stove/kitchen tools analogy. But as someone who understands these things now, on another level I don't think it fits. These topics are so incredibly broad and complex that it makes sense not to lump them together. Besides, there are plenty of places where you can just plop your code and have it run from shared hosting to PAAS's like Heroku and such.
In the end its like the article says - these challenges are what'll teach you. I don't know any good programmers that simply memorized how to do things without having to earn the knowledge of how something works through tons of failure.
Maybe most operating systems do, but most laptops and PCs don't. Like 92% of laptops and PCs. Which makes your comment seem divorced from reality.
Worse still a lot of programming guides assume you have a linux variant which is so far from reality it's painful to watch. Though it's got a lot better recently as the ruby/python package managers are a lot easier to install on windows now.
A year or so back I was having a discussion with another HN user who was running free Python programming workshops. He actually ended up specifying no windows because it took so long to get everything working on them.
I suspect the more novice a programmer, less likely they are to have a Mac. You will only have a mac if you're rich, a programmer or your parents are rich. It's not an entry level OS. Let's not even pretend about linux.
I've had many conversations with other programmers about solving this problem. We always fantasize about building an installer that just sets up everything you need for, e.g. Ruby on Rails. And people have tried! Every so often, you see an announcement about an open source project that promises to do just that. Even though this has been going on for years, I don't know anyone who actually uses these projects.
I think part of the problem is that the technology moves too fast for these one-click installers. They can't seem to stay current. Every time you get an update to the operating system, the database, the webserver, the web framework, the language runtime, etc etc, there's a potential for the one-click installer to break.
Another issue is interference from other stuff installed on the computer. I can't tell you how many times a piece of Unix software has failed to install because of something else I'd put on my computer and long since forgotten.
So one-click installers haven't been a panacea thus far. But I will say that the situation has improved dramatically in the last five years or so. Package managers--programs that automate installation of individual components--have gotten way, way better. It used to be that every other package I installed would fail the first time, and I'd have to do some kind of troubleshooting. That hardly ever happens anymore.
Now, this doesn't exactly make everything easy for new programmers. You still have to learn a lot of system administration to get anything done. Which brings me to my last point, which is a bit of advice for people just starting out:
You'll want to read some tutorials on various aspects of the Unix operating system. These will be very relevant to the problems mentioned in the parent comment: SSH, shell, installing packages, compiling from source, etc.. Generally, programming tutorials won't get into this stuff. You need Unix tutorials. This stuff will probably seem pretty boring in comparison to actual programming. It sure is for me. But it's a bit of unavoidable drudgery if you want your code to actually run.
Everyone says, "Just pick something you want to build, and learn how to build it." I don't know what I want to build, because I don't know what I can build. That's like taking someone who says "I want to learn calculus" and saying "Well just think of a problem you want to solve."
Build something that you do every day in your job. Build something where you click a button and you get a response.
Build something that makes your current job easier.
Build a piece of your favorite app, a very small piece.
So as a marketing person, think of some types of reports you would like to see given some data that you have. Remember that the input data should consist of a number of items (records or lines) that have consistent characteristics, somewhat like you would get from a spreadsheet. Maybe you want to get a list of how many customers from each zip code bought a blue widget vs. a green widget. So in this case you would write down a mock up of what your resulting report would look like, then figure out what manual steps you would do to get there.
When going through this exercise manually, pretend that you can't remember anything but your current thought, and that you have to write down everything else. Each thing you write down on paper translates to a program variable. Then, every time you have to change what is written down, make sure that is done via a repeatable list of steps. That then translates into an algorithm, which directly translates into lines of code.
Most of the first programs I had to do in "the real world" consisted of simply taking data from multiple sources, and making reports that others in the business could analyze. In some cases it was simple compound interest reports based on employee deposits/withdraws in a company savings account (kind of like an in-house mini credit union). Other times it was something like an Inventory Turns report for our head of purchasing (a report of how many times each product would completely cycle in inventory in a given month). These were all done on a Unix command line, using a combination of shell scripts, sort, join, uniq, and awk (this was well before perl came out). Eventually this type of work became second nature (so i didn't have to think through the logic), and I was able to move on to more advanced programming.
On the contrary, I'm now doing One Month Rails, a $20 course from Skillshare. The very first lesson taught me how to set up Git, get Ruby & Rails all set up on my machine, created a new project, and deployed it to Heroku. This was already a world more helpful than the Codecademy lessons. (I'm blogging about it here in case anyone is interested: https://cuppycode.wordpress.com/ )
Next I'm going to go through the Rails 3 Tutorial. If there are things like this (project focused, help you set up the dev environment) for Python, could anyone recommend?
For starting python I've seen http://learnpythonthehardway.org/ recommended a lot on here. It is also free online.
I'm also in the process of learning more about Rails via Michael Hartl's book: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
Hartl's book is awesome, but a LOT of new information thrown at you at once, and very opinionated. Still a great resource, though - especially for the low, low cost of free.
Also, I think a huge skill for any programmer is being able to search and find answers quickly and efficiently. It sounds silly, but being able to quickly Google search for a particular answer or abstract a StackOverflow question to apply to your situation is huge when getting started because those are the resources you come to use all the time when you're actually building a product.
Just my $0.02.
Not sure how I feel about (1) since that's the maximum most people can afford to put in (they have to pay rent, etc) and I'm ambivalent about telling them "your max effort isn't enough. You have to go all in". I agree with the premise but I'm really not sure how practical it is in practice.
That being said, love the rest of the post.
I'm worn out after 40 hours of work, so creating my own projects and/or working on open source projects is difficult. However, without doing that, I don't feel that I can move on to a more challenging development position because I have no code I can show.
1. Do it for money. I find working for someone else motivates me pretty well. I wanted to learn how to use JS frameworks like ember or angular so I've done a couple of simple restaurant menu CMS systems for local businesses. I did them for peanuts on the condition that I didn't have hard deadlines. Even though I have the luxury of taking as much time as I feel like, I feel some obligation to anyone paying me for work. I've also found that it effectively narrows the focus of the work in a way that might be more challenging in a more free form project. It's a lot harder for me to not start including "cool" but often-useless features in my own projects while I tend to keep my work for others limited to what was agreed upon originally.
2. My other method is to set myself up with two or three productive activities and force myself to rotate between them. I might choose learning German vocabulary, refreshing math online and writing a simple app in a new language for a night and make an effort to always be doing one of those tasks. I try to look at this time as relaxation and free time itself, so I try to set few expectations. When I get bored/frustrated, instead of turning on the TV or opening the news, I switch to the next activity and repeat until its time for bed. You can move forward on unrelated hobbies this way, something that frustrated me when I first learned how to code and overdid the focus and attention I gave it, to the point of severe frustration.
Lastly, try to relax and take it easy. If you put yourself through Hell every night you'll quit and get nowhere. Take nights off when needed and get to bed at a decent hour. You won't see immediate returns so any strategy has to be looking toward the long haul.
Can you switch jobs? There are so many companies that need even just a passable engineer. If you're not growing and learning in your current role, maybe it's time to find a new one?
I'm at a point somewhere between not knowing how to code and not being skilled/experienced enough for a jr developer position, and would work for next to nothing, but every internship I see requires that you be in pursuit of a BS in CS.
Above all else don't let yourself get discouraged. There will probably be a dozen no's and/or people who just don't respond to your query but the person that gives you that first opportunity is probably the kind of person you want to be working with anyway.
Plenty of startups will take you on as an intern with little to no experience. If you put your reputation on the line and give them a few months of your time to figure it out and build something they need, they might hire you full time as a junior engineer. Shoot me an email if you'd like to talk more about this zack@zackshapiro dot com
Actually, I think that sometimes it is the best time to learn new skills or master old ones. And, arguably, it is the way how most of people start their adventure with coding (and probably most of good programmers).
The thing is how _serious_ you can be. If "nights and weekends" is a synonym of 2nd, 3rd or nth priority - then in may be bad. Otherwise - why not?
At Thinkful (http://thinkful.com/) our students spend more than half their time on projects they start from scratch, using real tools for exactly this reason. As a result they have 10x the engagement and completion rates vs other online ed tools (MOOCs et al).
Failing is learning, but failing is tough. We make that easier.
I set it up to show my sessions including any little lags, typos, or whatever else I might make along the way. The idea is to show how a real person works at this stuff, and to encourage other people to give it a spin at their leisure. To that end, I have a pause button, variable speed playback, buttons for jumping forward and backward, and of course unlimited restarts. All of this happens in the browser, and it's just text, not video, so it's pretty quick.
I use my own favorite text editor and build tool, but anyone so inclined can certainly use their own favorites and it will work out just the same. I try to twiddle a few things here and there to show what sort of differences they make in the end.
So far, people really seem to dig it.
Unfortunately, to truly capture how I normally work on things, I'd have to have it grab multiple windows in parallel. I don't normally drop out of my editor to run compilers. That's just something which happens for those "lessons".
Just something that works for me; not sure if you've tried it. YMMV.
"Here's why Codecademy doesn't work in the long term... You don't know how to set up a development environment. Any time you have the slightest inkling to build something for yourself leveraging what you've learned in Codecademy, you can't and probably don't know where to start."
I'm all for encouraging a solid understanding of the syntax of code, but it's a totally different skill set from building web applications – which requires an understanding of topics like MVC, authentication, authorization, deploying, and using 3rd party libraries (and which to use).
This is the kind of stuff people want to learn when they talk about learning how to code and most sites bait and switch them into learning loops, variables, and functions.
"Learning to code is a try{}catch{}. Always be prepared to handle things going to wrong, because they will. Every language has a try catch for a reason. Try() is doing, Catch() is learning"
You do realize that not every language has a try catch?
People I know who have tried codeacademy or something similar complain that they are just typing "magical" words that produce effects on the screen. Perhaps a way to remedy this is to have them actually download the source files after a lesson is done or something so they can see what they've actually created, outside of the course's blackbox framework.
I'd argue that an aspiring programmer's ability to deal with frustration is probably the single biggest indicator of "success". Obviously it's an on-going process, and you're always learning, but I'd say the biggest difference between "trying to learn" and being able to do some basic programming is how you deal with those initial frustrations. It's really easy to give up and go do something you think you're better at.
I found that by setting it aside and working on something else, I gained new perspectives as to how to approach the problems that I got stuck on with my first project.
I had no intention of publishing it to the official Google Play Store, but I did, purely as a learning experience (and I sure learned a heck of a lot because it's definitely not a straightforward process).
And I'm sure we all have experiences like that, right? You'll be amazed at what you can do by just jumping in.
Quit my cube job, got a technical internship, and code practically every breathing moment I'm not at work...friends and fun...what are those again? :P
I get what he is saying but I disagree, in that I think that coding is actually succeeding to get something working by any means necessary, even if you don't quite understand why. Be it getting your first web site up and running, getting your first program compiled, fixing your first bug, etc. There are a lot of hurdles and roadblocks you will face, especially when you are starting out, it will seem that every single piece of information is just out of your reach, like Tantalus and the grapes. It takes a lot of patience and perseverance to get through most programming problems, but that feeling of satisfaction of getting past these roadblocks is amazing. I still get that feeling of satisfaction and accomplishment, even though I'm 20+ years into my programming career.
The followup to that is that you look back at your code 6 months later, cringe, and then rewrite it to something that is an order of magnitude better.
Zack, you say pick a language "Ruby or Python". I started out in PHP (I have no recollection why) and while I'm far from perfect, I know it well enough to build functioning things and more importantly to figure where to find answers when I'm stuck.
Yet whenever I read other people's writing about coding, almost without fail people say "PHP sucks, do Python" or "PHP sucks, learn Ruby".
Without getting into the arguments about which language is better (I am fairly aware of the differences), can people who have experience with all three opine on whether it makes sense to throw out the time and energy I have invested in PHP (not to mention lot of well functioning code) and start from scratch with one of the other two?
This. Getting everything installed and the environment configured is huge.
Learning to set up your own environment builds tenacity. Having a one click install would take away from the learning experience and the beginner maybe more likely to quit if something breaks or goes wrong instead of googling around for a fix.
Whenever I've hit challenges when learning to set up things (like recently making the move from Windows -> Linux and having to start from scratch with my dev environment) I've learned the most. Also, it teaches you that you've got the determination to succeed, which at some point you will need to be an effective programmer.
Actually, though, Python is probably sufficient, especially with the nice-ish tools that come with it on Windows (nice-ish meaning less ugly than a cmd window).
I agree with the rest of it, but would also add that in addition to writing out code, take notes, too. This can be alongside the code you just wrote or somewhere else, but take notes somewhere. This has a couple benefits: it usually means that you'll have to read an article or watch a video twice, plus it allows you think about what code is doing. Even if you're taking the advice to write out code, it's easy to gloss over that part.
You've gotta get started somewhere, and a safe place, in your browser, that doesn't require arduous setup ain't too shabby.
As Zack points out, there's a true difference between someone who "thinks they should code" and one who really wants it. Codecademy welcomes all comers, so it's hard to tell the difference. That shouldn't necessarily be an indictment those who start there.
At Thinkful (http://thinkful.com/) we send students to some Codecademy lessons, along with hundreds of hours of real-world projects and other resources.
Does Thinkful use mostly freely available sources from the web as a way have students learn the material?
There's some great CodeSchool work that we use and they're a paid source.
The projects and curriculum are all our own design.
P.S. Glancing at your other posts, I really like what you and Steve have said about g|school having high expectations for your students.
P.S.S- Look out for me in the applications, I am hoping to submit my application the end of April.
-Brian Hall
i'd like to see some sort of matching service that helps match potential programmers with mentors, based on common interest. the "student" gets to learn in a context relevant to their interests, and the mentor gets an extra hand on their project.
Sometimes when you're learning something you need some hand-holding. I think it's a major weak point in the process of learning to code. Just googling for answers isn't always the answer.
It walks you through the thought process of various things you do when you write code and makes you actually write it, which is awesome. But that's where it ends so you've got to take the leap from there and actually BUILD something.
I do ALWAYS recommend starting to Codecademy just to see if programming itself gets you off and to get your feet wet. Even now I still use it for that.
Incidentally, I still don't know how to use Ruby or Python functionally, so that's a pretty big failing of my learning so far. Like, I can write Python and Ruby scripts way better than Php, but Php is always installed and configured on every server and I know exactly how to use it in my dev environment, so I always default to that.
I'm making a Twitter App right now, and for speed I'm using a PHP API wrapper that is way worse than just writing the requests in Ruby. But. I don't know how to actually USE Ruby.
That felt good to say out loud, er, on the Internet.
However, LPTHW wouldn't have made sense to him if he hadn't already done CA, so he liked having done them both.
If I knew nothing about programming then I would find the basics of coding that Codecademy teaches to be useful as it is a different way of problem solving that needs to be learned.
That's a good phrase.
Though it does a great job mastering you in syntax and semantics, with which you could solve trivial problems the world's never going to face, real learning comes from setting up a dev environment in your machine, and diving in. Learning from mistakes best apply in learning to code, more than any other context.
I would say this last point is the most important one. And it also kind of cripples most of the other points.
Is that someone actually the exact same person (looks like it) ? Does he know that code can be executed outside of a browser ?