How can I teach a bright person with no programming experience how to program?
programmers.stackexchange.com
programmers.stackexchange.com
I could not get through those three books but I get paid to program. My code is repetitive and shitty but I can produce a working web app as long as it doesn't have to support too many users, and it's fine.
My husband never read any books about formal programming and taught himself from those random "learn Java" or "learn python" books. He's a mathematician and programs to write simulations/solve equations, and he gets paid for it too.
If you can't get through those three books maybe you can't hope to be a computer scientist, fine. But you can certainly program, in the same way you don't have to be an English major to read or write.
You're right, I probably wouldn't work out at most programming jobs. I do contract work; the web app I'm writing now I had about 3 weeks to knock out, will be used by 2,000 people, and will only be used for about a month. But I'm still a "programmer," because I program.
We're not all writing mongodb or working at Google or whatnot.
I'm sorry, but what you're talking about sounds like it doesn't qualify as "programming" as much as web design and code plumbing. Note that in large part I'm talking semantics, here, in that my definition (and I suspect Joel's as well) differs from the way you're using the word).
I understand that you're likely paid well to do it -- as are plumbers. And it's a respectable job. I'm not trying to knock what you're doing.
But by your own admission your own code less than ideal. And Joel is talking about what a good programmer would need to be able to do, and if you want to start someone off on the path to becoming a good programmer, it's not a bad suggestion.
If you just want someone who can copy and paste code off of Github and doesn't really understand it, well, then you don't want a "good programmer" -- and frankly anyone worth their paycheck in IT probably already knows how to do that.
If you write code you're a programmer. End of story.
"Programming, and then there's programming" and "code plumbing" are, in fact, semantics.
If you do arithmetic, does that make you a mathematician? Some things are a matter of degree.
You could make the same analogy and prove any side of the debate depending on the job you choose:
If you do plumbing, does that make you a plumber?
If you do painting, does that make you a painter?
If you do physics, does that make you a physicist?
If you drive vehicles, does that make you a driver?
Really, the debate here is that some people consider the word programmer to mean "computer scientist" or "computer expert", while others consider it to mean "person who programs". It's a debate on the meaning of a word and this kind of debate cannot be settled, because the word has multiple meanings. Everyone's right in their own way.
This isn't an example of that, because nobody changed definitions partway through.
If you write code you're a programmer. End of story.
The 'no true Scotsman' fallacy does not apply when you are actually debating whether someone living in a border region with mixed parents can be considered 'a true Scotsman'.We don't call everyone that uses Excel a programmer, even though the simplest expression of the form sum(A11:A22) is, for every reasonable definition, 'code'. That would dilute the term far beyond what people generally mean when they talk about 'programmers'.
You cannot call yourself a writer, just because you passed English with a C for your essays and now write blog posts for a limited audience. You are not a programmer just because you can whip out webapps that strictly do the limited things you require of them.
However, the post was about the fastest way to learn programming and books are a terrific way to do that. Not the only one. Maybe not the best one for you. But for many people, books work great!
Yes, but these books teach you more than writing something that compiles. Just read the ToC of SICP: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html#...
Some people learn very well just by reading a book, most people don't. It's impossible to answer the original question in a good way without knowing how that person learns best, what he knows beforehand, what he's done so far, and what he wants to use programming for.
Try something simple. Work your way up to more and more complicated things just like any other learning endeavour.
If you want to stick to plumbing type programming then go for it. If you want to branch out into a more formal computer science type understanding, by all means grab some text books and learn some data structures, algorithms, abstractions, oop patterns, etc.
Really he needs to understand what object oriented is, variables, arrays, loops, conditionals, debugging and the actual .NET syntax. Understanding these thing the person will be able to do their job. That seems to be the most important thing. Certainly you may not consider the person a "real" programmer but, it is up to him to fill out the rest of his knowledge and grow as a programmer.
The "top" answer sounds suspiciously like today's XKCD
Things like pointer arithmetic, memory allocation, etc. distract from the basics and high-level concepts.
I would start with Python or Ruby these days. If Python is good enough for intros at places like MIT, it's good enough for me.
C is a masterpiece of elegance and simplicity and gives you a mental model of how a real computer works, and it gives you a foundation for understanding Unix, but I just think it overloads a beginner with stuff that gets in the way.
came to comments expecting a lot of reasons why Scheme or Lisp was a better choice LOL
The school in question is mostly low-income kids looking for a vocational experience, so we expected a bunch of kids who would be out of their depth if thrown in without a garbage collector. But then the teacher mentioned that none of the kids had a hard time learning C or C++, pointers included.
So the group of game developers who had come to advice pretty much all agreed that learning C/C++ first was actually the best thing that could happen to those kids. Show them C first to teach them what the machine is REALLY doing (with only a minimal abstraction layer), give them OOP with C++, and THEN transition them to a scripting language and higher level environment so they can produce something interesting before the class is over.
It used to. Now, with multicore systems and out-of-order execution and cache and nearly everything else that makes modern hardware fast enough to use, it is an over-simplified view of the abstraction the hardware wants you to see, but is not detailed enough to guide you when you need extra performance.
As an example, C says nothing about cache lines; its memory model is completely flat. Cache is ideally 'transparent', but we all know that cache hits are a lot faster than misses. C gives you no guidance on how to arrange your data structures to ensure as many hits as possible.
Sure, it takes a while for you to wrap your head around pointers. But it also takes a while for you to wrap your head around inheritance. By virtue of being a smaller language, C has less of these things to wrap your head around.
If you need a dynamic array, you have to build it yourself from what you already know. Instead of having to learn yet another opaque concept, you're reinforcing your knowledge of pointers and dynamic memory allocation. Double benefit!
And once you know C, it can give you a boost towards learning other languages - most of them are implemented using C! If I don't understand something, I can always look at the source to see how it works. Since they're implemented in C, many languages tend to map easily to C concepts.
The same cannot be said about going the other way. A Ruby programmer learning C has to unlearn all the assumptions and niceties Ruby has spoiled them with. How much of Ruby is going to be applicable to C?
As long as you want to teach someone programming and not computer science I think a high level language is much better suited.
Only if he wants to learn C.
But why bother? For the overwhelming absolute majority of programmers it's a complete waste of time.
C is to computer science as latin is to medicine. All medical doctors need to know a little bit of latin
If you want to do 'computer science' or engineering, eventually you have to learn both.
But for a beginner, who might end up just casually coding as part of another discipline, or wants to understand computers as part of a liberal arts education and never goes past the first language, I think the higher level abstractions are a better place to start. (And the languages are a little gentler)
Is this really the only way to be a good programmer? I'm someone that wants to study programming in my spare time and that's a bit of a daunting list for someone new to the industry... – toleero Jul 28 at 14:54
No, it is not the only way to be a good programmer. But if three books is a "daunting list" than you might be underestimating what it is that programmers do. – Joel Spolsky Jul 28 at 15:05
Seriously.
I would say "Learn Python the Hard Way" if you're absolutely new to it. It moves quickly and will give a good sense of what it's like to actually push the bits around. Most people who really like programming seem to have a similar first experience (like using BASIC on their PC or calculator); replicating that seems like a good first step, no?
Once they've done that they're set up for K&R, etc. I get the impression that the development environment is invisible to programmers because it's just there. But imagine someone handed you K&R and asked to to write and compile a program. What compiler would you download? How would you install it? Where would you go for help?
---EDIT--- the child comment shows my next paragraph is pretty stupid. (In my defence I was remembering a time before Google would know what C or C++ meant; and before students had Internet access during lessons.)
The other concept that beginners have trouble with in C is "how do I know the names of the functions that I'm supposed to use to do stuff? How do I know what displays text on the screen? How do I know what reads keyboard input?".
Search engines?
"How do I read keyboard input in C" → the first result is scanf() "How do I display text on the screen in C" → returns a tutorial on how to use puts and printf
It's a great exercise. Writing your own atoi function was one of the first things I did when teaching myself C.
This is the difference between learning the language as a training exercise, and learning the language with an eye to writing software in it. C is a very easy language to learn as a training exercise. It's only when you get into writing significantly complex programs that C becomes a language that takes a lot of time to master.
The goal here is to learn how to program, not learning how to write programs in C, so the sorts of tasks and things are really pretty approachable.
Ok, if you really want something more advanced, write a program that, say, shuffles a deck of virtual playing cards. Again, something a beginner at programming would learn a lot from (pointers, data structures, memory management) but a professional C programmer would laugh at as trivial.
Not all programming is cutting edge computer science.
It does not matter how smart you are.
It does not matter how much you WANT to become a programmer.
So the first thing I do when introducing someone to programming is point them at tools that will allow them to be productive quickly to see if they "get a kick" out of creating things with code.
I think Joel's advice to start with C is GREAT. But only if the question is "I think I love to program. But I'm a noob. I want to become a great programmer. How do I start to become one?"
You can learn to love something, largely because you find yourself successful at it. On other threads you can hear from people who hated math until they learned logic and they were off to the races. I am sure that programming has the same thing; in fact, I know programming has the same dynamic. I know this because there is a steady stream of "how Python/Ruby/mobile apps/ditching my boss made me fall in love with programming again" which suggests strongly that one can change affect. Too strongly for it not to be true.
True. Nothing is fun until you're good at it.
When I got my Apple ][ in 1980 I was not good at programming. But I had a freaking BLAST writing AppleSoft BASIC code till the cows came home. Weeks previously I probably couldn't have even SPELLED programmer.
Programming is first on the list, though you might say I had a natural aptitude for it. Despite the long road of learning (mostly) on my own, I enjoyed it all the way. (I say 'mostly' because there was a short programming class in 4th grade that introduced me to it.)
Bowling is another. I'm really not good at it. With practice I might be, but I don't practice enough. I enjoy it anyhow.
How many examples do we have without that qualifier (i.e. people who had never enjoyed in the past)?
I take that back, on HN, at least one, in this very thread it seems: http://news.ycombinator.com/item?id=3205485
None of them stuck. Part of it was that the concepts were too difficult to understand. In which case Joel's list might help, as it is more about concepts than teaching programming. I think a bigger part of the problem was that it was too difficult to write anything useful in those languages. After a semester of C (Intro to Programming) I don't think I could write a single useful program. If it was a semester of Python I'm damn sure I could write useful code after it.
I wish a book like "Learn Python The Hard Way" existed back then. It would have been great to understand the basic concepts of programming, and see the code actually work. I remember a C class where the instructor was teaching about arrays. I don't think a single person in the class really understood what he was talking about. Compare that to Python lists and dictionaries, you can see them work, you understand what they do and how to use them immediately.
I'll take Joel's advice and read those books. But I'm not sure they are best way for people to start.
Joel's method would have made me drop out and convinced me that programming was terribly boring-- much like a how a kid who wants to play the piano would feel after starting out on 6-months of only scales.
I learned so quickly because I loved it, and I loved it because I could be instantly productive making apps with Ruby on Rails. There was still a lot to learn, but those things could be learned later "in the field" as they were relevant.
Certainly K&R is a must-read, but Joel's advice...
"If you can't get through this sequence, you're not going to be able to program, so you might as well give up now."
...is terrible. There is more than one way to introduce someone to programming.
I understand where Joel is coming from with his advice, but I don't think I agree with it. I had read quite a few programming books in the past (C & Java), muddled through the exercises, and thought I understood the concepts, but until I dived into solving real problems, I didn't "get it".
And there is decades worth of research backing this up (problem-based learning, situated cognition), but CS education has been slow to adapt.
A friend who's in Med School wanted better working conditions than working at crappy call centers. I gave him a high-level overview of what programming is about and threw him the Django tutorial and made myself available for questions. As I gave him practical requests for useful web code, I delved into the details of Python and web programming in general, while slowly introducing him to tools of the trade like the shell, debuggers, and data structures, trying to make every step of the way easier for him.
Six months later he got a job at a biomedical NGO. He began by documenting and testing existing code, but now does quite a bit of coding by himself.
I've found that teaching theory along with the tools that utilize it to be a very good strategy.
One of the best ways to teach is to map known concepts to new concepts. For instance, I might introduce methods to people who already know what functions are, but talk about messages to those who don't.
What folks are often asking when they ask "how do I program?" is something entirely different.
How do I learn how to make a website? Use wordpress or yola or squarespace.
How do I learn how to make that website look better? Read design blogs, some starter tutorials on html and css and start diving into the CSS. It's not that hard a standalone thing to learn.
How do I learn how to make that website do something fancy like fade things out? Start diving into the javascript in the same way.
How do I learn how to make that website do something functional like send an email, or save a session? Pick a modern framework (Ruby on Rails, Node on Express), read/watch the starter tutorials on it, and dive in.
How do I learn how to make that website do something functional and NOT have it be a horrendous hack job? Time to start reading those programming books :D
Just sayin' it's not always step 1. Depends on what you need to get done, and what you really want to learn how to do. Yeah?
For application development, I'd start with an environment that actually tried to make things simpler for the programmer and showed how you can use programming to tweak a design first before programming from scratch - an IDE (see Microsoft's beginner resources http://msdn.microsoft.com/en-us/beginner/default.aspx ) or game development environment (like gamemaker or XNA).
See also actual curricula for high school or non-computer science students (CS0 courses), like
http://coweb.cc.gatech.edu/mediaComp-teach
I would not throw SICP at someone who didn't already know how to program.
The first book, Code - Charles Petzold, is only ten bucks on the Kindle right now (SOLD) and I own the other two.
I remember SICP being like 90 bucks for my hardcover copy and I'm pretty sure I bought it after reading the Joel on Software article "The Perils of Java Schools" while I was loving life as a bank IT guy so this is workable advice. It only took five years to become a "real" programmer after that. Also I sure don't remember K&R being $68[1]. (Yes I know SICP and K&R are both online for free)
[1] http://www.amazon.com/Programming-Language-2nd-Brian-Kernigh...
[2] http://www.joelonsoftware.com/articles/ThePerilsofJavaSchool...
For anyone interested, I found SICP at http://mitpress.mit.edu/sicp/
http://www.cs.bell-labs.com/who/dmr
The site is down now though. Some forums say it's temporary but I don't know for sure.
The student should get in and start hacking away at some non critical part of the code base. Perhaps the UI, or some reporting or tests. Something it's OK to break for a day or two.
Pair them up with a more experienced developer and make sure they do code reviews. Discus the code and talk about what went right and what went wrong.
Even as a beginner you can tackle small snippets of code using the basic control structures.
Sadly, this is how programming books used to be written. Case in point: about a decade ago in high school we learned programming from a book called C by example. It had a handful of well thought out programming exercises after every section. A few years later I went looking for the book to give to a friend who was starting out. Lo and behold, in an updated version the exercises were all removed! It's mind-boggling that somehow the publisher thought removing the exercises was adding value to the book. Perhaps your average reader feels exercises makes a book seem too technical, so they skip it for the Learn X in Y hours style books? Nowadays you can't find good programming exercises outside of a dry textbook.
Here is how I read this thread: Q: How do I quickly get a complete coder newbie up to speed to support .NET apps? A: Teach him Lisp and C
What a silly, dogmatic, and unpractical answer. No one even bothered to ask about what kind of work this person is going to be doing, what sort of apps he'll be writing, what industry he's working in, etc.
Obviously, the company where this guy works is giving him a shot at a super-entry-level programming job. If he has any hope of succeeding (which means being productive ASAP) in this job, learning C and Lisp is not going to help him.
A programmer is someone who programs for a living. I program for a living. I have never programmed in C, have no idea what generic programming is, and I really couldn't care less about hardware memory protection.
Really I just hate C++. The class was pretty good and bug hunting skills are not something to take for-granted. That's for sure!
I strongly believe that accomplishing a small scale project that as some value is the best way to learn.
My answer: Exacting logic.
C is a great language at teaching exacting logic. "Wax on, Wax off" kinds of things.....
I'm noticing that Students naturally discover many of the issues and tricks that they would otherwise have to "study" (such as flow of execution, nesting, variables)
I occasionally teach at schools in NY, and this semester my students "invented" the smalltalk syntax. It was heartwarming to witness.
Sounds more like "old-hats" regurgitating their learning process.
Why the line is always drawn with C as well, is interesting. Not assembly, not Java, or Python... but C.
An analogy: Go and learn to use a mouse and keyboard, before you get an iPhone, otherwise things like the "On-Screen Keyboard" and the idea of "Touching (Clicking)" things is too difficult to grasp.
But if you want them to "achieve enlightenment", you've got to get them on scheme. And if you want them to see through all the smoke and mirrors, and gaze upon the simplicity that is the machine, you've got to teach them C. Assembly will work too, with the proper arch (and x86 is not it).
The question is fundamentally flawed.
People want to build something, not learn to program.
To teach someone to build something, teach them how to use the tools of the trade. No carpenter ever learned the physics behind wood in order to build their first table.
The answers to this question all come from people with a perspective that this is what they would do if they wanted to take a bright person and put them into a developer role at their company. And, they all have the defeatist attitude that unless you read these three theory books, and spend four months of intense study, you cannot be a programmer. What hogwash.
Most people cannot take four months off from work and intensely study programming. But, anyone can learn to tinker on something they care about with the right mentorship and using the right tools. Anyone can learn to use jQuery, Ruby on Rails or HTML if-and-only-if the point of doing so is not to learn jQuery, RoR or HTML but is to build something that inspires them. All you need is a path with baby steps and inspiration.
Showed my middle son how to animate a java graphic on a website. He never stopped. Now is a CS graduate student at CM designing/implementing the next internet routing protocols (and writing Kinect games).
I know of no other way. You learn programming by programming. This, by the way, is exactly what a good CS curriculum will do.
You know what? I've actually unintentionally taught several people the basics of programming. I work at a small company with other bright people who are not programmers by study, but have learned how to communicate programming with me. I truly believe that teaching somebody to program is as easy as figuring out how to best explain something sequential to them. Usually, I begin my stealth teachings under the guise of me just trying to help them communicate their program requirements or ideas to me. I quickly jump into the lower level explanations of things and somehow I manage to get them excited or interested enough that they actually feel like talking "programming" with me will be cool. I try to explain to them that programming is like giving the computer an ordered list of things to do, and it'll do them exactly in that order. As simple as 1, 2, 3. I then explain loops. I don't get into functions and classes because that's not necessarily important to them understanding the flow of logic. Most people seem to easily grasp the concepts of if-then, and loops ... this is all really simple stuff for most people to understand at a basic level. I don't even necessarily mean code, but more so logically what an if-else means. I find that most people generally give you the "yea yea I got it" type of response while explaining this. Once I get them to this point, they're where I wanted them to be. I then try to include them in scenarios where I'm debugging something. I don't deliberately ask them to help me do my job, but I more so start talking out loud and usually they'll come over to help brainstorm. I show them my code, and explain the logic flow (if-else, loops, etc). You'll be surprised at how easy it is for people to actually help out here. Sometimes it's the non-programmers who can give the most obvious advice. At this point in time, it's up to them. If they're interested enough they'll progress from them, otherwise it may just no be their thing. I work with 8 people, and I have actually had one guy learn Python and he now writes Python tools for us - he knew zero programming. I also got our accountant into programming because he would always ask me the status of projects, and slowly over time I got him speaking "programmer-speak" with me, and now he basically understands all my programming yammer. I realize that these guys are not writing the next Redis or Twitter, but they were non-technical guys who are now on their way to being on their way to writing those things. :)
Course resources: http://www.stanford.edu/class/cs106a/cgi-bin/
"To get 'skills' and expertise in the technical parts of computing, especially for Web 2.0, here is an outline in 8 steps:"
Also it happens that that post, like the OP, is aimed at .NET.
Also the post emphasizes just one book which has introductions to HTML, CSS, Visual Basic .NET, ASP.NET, and ADO.NET, including relational database normal forms, and contains nothing on 'algorithms' such as in Knuth's TACP or subsequent, similar books. Also the post has nothing on C, C++, Java, Python, PHP, Ruby, or Linux.