views:

1372

answers:

16

Possible Duplicate:
What programming language should be taught in Computer Science 101?

My girlfriend hates feeling completely out of the loop when my friends and I talk about anything related to computers, so she asked me to teach her how to program. I'm pretty happy she asked, but I want to be able to teach her enough to know the basics without her completely losing interest or getting too frustrated. She is a very smart girl, probably smarter than me, but her computer related skills are pretty minimal. What language should I teach her and why?

+7  A: 

Python is easy to start with.

VB.NET or C# are not hard and they're good as it's really easy to design forms and such, something that might be important for someone that's getting into programming.

devoured elysium
+1 for visual forms designers
pyrochild
+31  A: 

You should not teach her any language. Programmers/engineers expect too much of non-programmers, especially if the student is thought to be smart. This will cause so much relationship friction, you'll wish you hadn't. Find a good programming class and enroll her in it. Help her when she needs it, but don't try to set a curriculum or show her things you think are interesting. —signed, sad experience (three times)

wallyk
I was thinking that would be a good idea. However, she did ask me, and more than just once. So I thought it wouldn't be too bad. I guess I'll have to proceed with caution.
vanstee
That's unfortunate that it turned out that way for you wallyk :( I've had pretty much the opposite experience with my wife, but I'm sure it depends a lot on the individual.
phoebus
+42 if I could. Find some other things to talk about socially in the meantime, and let someone else be the bad cop.
seanb
I don't think you should completely discourage vanstee from trying to do some teaching himself, though. Being able to talk to my wife, in detail, about something I'm passionate about has actually been good for our relationship and made her more interested in my day-to-day job.
phoebus
There was no negative stuff - friction/me wishing I hadn't at all when I went about it. The worst t hing that happened was I bored her after some time :D
Senthil
I had the experience of good things coming from teaching programming for awhile, but that led to—what turned out to be—too much enthusiasm on my part. It was much better—relationshipwise—to take up scuba diving with one, so we were both learning things together.
wallyk
Ah, yes, that I can see. We kind of went a different way to mitigate that, and she's been teaching me about literary criticism, since that's her specialty.
phoebus
I would say it depends on whether your significant other can learn from you. Not all students learn the same way. And, as a general rule of thumb, programmers are not good teachers to those whom do not possess decent knowledge of the internal workings of a computer.
Eddie
+1  A: 

Since you will be the one teaching her and will have to be debugging any particular problems she is having, you should really teach her in whatever language you are most comfortable in.

The language itself does not really matter as really what you will be teaching her are concepts, such as inheritance, recursion, and flow control.

If what you and your friends are normally discussing around her are the particulars to a specific language then by all means teach that, otherwise, you will find it much easier on everyone involved to teach your strongest language so that you can feel confident in debugging the issues that she will have.

Also normally that language you are strongest in is the one you know the most gotchas for, and these are as important to understand as the programming techniques.

Brandon Bodnár
+32  A: 

My wife came to me about 3 months ago with the same sentiments.

Here's the progression we've gone through in rough order:

  • The different parts of a computer and how they interact at the macro level
  • The interaction between memory and the CPU
  • What is binary and what are other base systems, and how do they work
  • The concept of different levels of language, i.e. machine code, assembly, unmanaged high level, managed high level
  • Machine code and assembly (not directly, but just conceptually)
  • Basic parts of a program in C++
  • concepts of variables
  • concepts of functions
  • conditionals
  • control flow

This is with about a couple of hours a weekend of actual instruction.

That's about where we are now, and she can write basic C++ programs with standard control structures. Next week we are starting concepts of memory allocation/pointers, and heap vs. stack.

Many will say that C++ is not a good teaching language, but IMO it's just fine. The fact is that my wife wants to learn the real concepts behind programming, not just how to throw some .NET stuff together. If she were going to become a corporate programmer, then that'd be one thing, but she's just academically interested in the science of it, and for that I think C++ is ideal.

She's a high school English teacher, but she double-majored in English and Biology. She's smart, but not mathematically-oriented, and this has been both fun and challenging for her I think. Her computer literacy prior to this did not extend much past office applications, a little gaming, and a web design class she took in high school (where we met while I was a TA for a class, incidentally).

phoebus
+1 The order is nice. That's how anyone who's new to computers should be taught.
Senthil
That's a very good syllabus! :-P From my experience in teaching people new to programming, you should pay attention to some details that us programmers take for granted. For ex: lines of code are always executed sequentially, same lines of code are always executed the same way, same input give same output.
HH
@HH That's a very good point.
phoebus
I don't care how parts of computers interact ... It's not necessary for programming.
Dario
@Dario I guess it's a good thing that I wasn't trying to teach you, but instead someone actually interested in the science behind what they are doing.
phoebus
@Dario: It's necessary for any programming other than TOTAL FAIL.
Ben Voigt
+1  A: 

My suggestion would be ActionScript. It is simple and has graphics to play with. Learning curve is short, and there are a lot tutorials around.

Way interesting than hardcore languages like C++.

Shivan Raptor
I think it could be good idea. Probably better then php suggested by me.
Maciek Sawicki
+4  A: 

Sorry to be the one to bring this up, but it may be worthwhile doing a programming ability test, otherwise you may be wasting your time and creating frustrations.

I don't say this as a reflection on girlfriends in general, and certainly not yours, but over many years, I've come to the conclusion that there are those people who can program, and those who don't even care to try.

It's very encouraging, therefore, that she asked you to teach her. That's a very good start.

pavium
There are those that want to, and those that don't want to. Nothing else.
Sneakyness
It's not as simple as that, as the published research shows.
pavium
Thanks for the link. Interesting...
HH
The article you linked doesn't say anything about how much the students _want_ to. I thought that it was somewhat interesting, but annoyingly lacked specifics (like what exactly did the practical consist of?) but I guess it was meant to be an in-house presentation.
int3
In my haste to post an answer to the question, I posted a link to an earlier article than I intended. The article I meant was discussed by Jeff Atwood at Coding Horror (http://www.codinghorror.com/blog/archives/000635.html)
pavium
+6  A: 

If she doesn't actually want to be a programmer, but just wants to understand the principles behind programming, why not go for one of the (many) languages that explicitly designed for teaching programming principles in an accurate but interesting way? Alice would be my suggestion: http://www.alice.org/

William Billingsley
Now that's what I call drag-and-drop programming. Teach her something real.
MiseryIndex
The university I graduated from is starting to use this in their intro to programming class which has historically had high drop out rate. Idea was that C++ was to hard for those that have never programmed a single line of code in their life.
Eddie
scheme or lisp ----------
KitsuneYMG
+3  A: 

PHP - basics are easy to learn, it's useful for no professional programmers. I also think crating UI in HTML is much easier then classical GUI. OK, there are RAD IDEs (like Delphi, that I also recommend), but in general crating good GUI using cross platform libs isn't easy for beginners.

I don't recommend start learning with console applications. Me by you shouldn't skip consoles "hallo world" program but then You should jump as fast as possible to more advance UI.

But, as mentioned you should learn her language that you know or better ask some one else to teach here.

Maciek Sawicki
+3  A: 

I would say there are two "languages" that are good to start with.

Python

Python is good to teach some of the basics like variables (as in algebra) and string substitution, and the beginning elements of logic (if statements, loops).

It's easy to start simple in Python, and grow the program/script from there, and print statements are sufficient to learn, as well as the Python shell.

HTML/CSS

HTML is a great way to learn how to 'speak' to a computer (that is, you tell it to bold a block of text, and it knows what you are saying). It's good to learn how style/selectors apply, and changing colors/borders/etc. on a HTML page make it easy to see get feedback of what you are learning.

Jehiah
Assuming the OP really meant "programming" and not "development", I don't think HTML/CSS qualify. You'd have to at least add Javascript to the mix.
Joshua Carmody
For a beginner, learning HTML/CSS will almost be the same as learning MS Word. In fact it will be worse because you are teaching her to do something the hard way (HTML) when an easy way is there (Word Processor).
Senthil
+1  A: 

In my opinion, I think this language would be an easy introduction to bring your girlfriend into the world of computing http://scratch.mit.edu/ also known as "Scratch". FYI, it comes very useful to beginners whom have never done programming ever.

Once she understands the basics, then you can introduce her to other languages...

For your consideration.

Raymond Tay
+9  A: 

Why not something like Logo? At least she will get immediate and beautiful results and get the sense of how you control behavior by writing lines of code.

HH
+1 for Logo. There are very nice implementations out there (Comenius Logo, Imagine)
Marek
A: 

Don't teach her any language. She doesn't want to know how to program, she wants to understand what you do in your job. So show her the tools that you use and the fundamentals of those tools:

Start with elementary logic, boolean algebra, Karnaugh maps etc. Go through the (basic) design of a transistor as the foundation of a logic gate. Show how the decomposition of any large application design maps back onto the math covered earlier. Perhaps walk through some of the main components of a modern computer, and how it ties into the decomposition of those problems (e.g. management of large pieces of data in memory).

Ether
+1  A: 

If you're willing to deal with a language in pre-1.0 state, Small Basic might not be too bad a choice. It has some basic .NET structures with very simple VB-like syntax. It can also do rudimentary graphics and formatting if such things would help.

MSDN DevLabs Small Basic

Jim Dagg
+2  A: 

You should teach her JavaScript, because

  • it is the most widely used on the planet, with myriads of examples at hand on the web
  • it is interpreted, you just need a browser to run it and the browser is already installed on your computer
  • it is often used to manipulate visuals in a web page which is more appealing than studying the output of a program in a console
Eric Bréchemier
Debugging is more difficult though and it doesn't introduce type casting vary well nor the use of classes, interfaces.... That make up most programming languages. A scripting language is poor as a starter language.
PeteT
Actually, that's not a bad idea. My first programming experience came from doing extremely simple pages in HTML and adding some simple javascript.
HH
petebob796 is wrong. Here's why:1) Debugging's no easier or harder than any other language if you've got the right tools. Grab Firebug and you've got a REPL, a step/breakpoint debugger, and a log console right in Firefox. 2) The trappings of Class based OO are hardly the only way to model problem domains or organize a program, nor is there any real argument that they're the best way3) With types, whether you have to explicitly cast or can implictly convert is less significant than whether you understand the rules. Either approach will bite beginners who don't.
Weston C
A: 

Find a project for her to build. It can be a website, or Skynet, doesn't much matter.

Pick the language based on the project. JavaScript/JQuery might be useful for some; C#/Java for others; C/C++ for another group; Python and Perl for whoever's left.

Dean J
+1  A: 

Personally I would start with XHTML + CSS, as it is very simple to get a visual result. Then move into a bit of javascript for some interaction. Possibly after introduce her to a server side language, or whatever you know best. Think javascript is a easy language to learn with. and there are many javascript debugger's. Plus you won't need compliers or any complex software

Olly Hicks
Perhaps I'm nitpicking, but XHTML and CSS are not programming (no program logic or flow control).
Joshua Carmody
haha, completely agree. Didn't really think of that. Nonetheless still think basic knowledge of XHTML and CSS are invluable
Olly Hicks
HTML -> CSS -> PHP -> JavaScript. HTML and CSS are not programming languages but they are good as introduction before real programming. They are good to illustrate that computers execute the instructions of programmers.
bancer