Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Learn to Program

created by Jongleur

(idea) by Jongleur (3.3 d) (print)   ?   5 C!s I like it! Sat Mar 09 2002 at 7:37:43

I have always felt that computers have a reputation of being more difficult than they really are, and that professional computer scientists, in particular, are guilty of making the act of writing code into a black art. It seems like we are intentionally obfuscating what we do in a subliminal effort to sound intelligent, coupled with the well-founded fear that we will be met with "well if you're so smart, why won't my printer print?" if we make it sound too comprehensible.

When I was in college, I was known among a certain group of people as the person to go to if you had a computer question, not because I was all-knowledgable, but because they could depend on me to try to use the right metaphors for them. This love of metaphors, coupled with an overblown sense of hubris, drove me to start this guide.

Now I'm going to let you in on a big secret that could be bad for my job security: programming is easy! Yes, someone has to say it since currently there are far too many people out there making computers look like they are something otherworldly or excessively complicated. I am here to say to you, here and now, that coding isn't hard.

If you would like to learn to program for reasons of advancing your job, you've come to the wrong place. I admit to being a software engineer as my day job, but I can't stress enough that a bad coder who enjoys their job is much much more useful than a good coder who hates their job. You can fix bad habits but you can't fix hate. I'll try to teach you some things that might be applicable to getting a job, but, if you really want a job, you should follow all of the lessons, and then you should attach yourself to a free software project and help them out. The kind of coding I'll be showing you here is more of an immediate one. It should help you do things like program little useful utilities, but it won't be very useful for anything more large scale. And eveything you might get hired to do would be large scale. Trust me on this - professional software development involves a staggering amount of code. It's almost an information management problem instead of an algorithm problem. The only way to get good at developing large systems is through a combination of experience and education.

There are a few prerequisites to this:

You should be comfortable around computers
By this I mean that you are unafraid. Many people get skittish around computers and, in an effort to avoid spending time learning something they feel is too hard, end up afraid to move the mouse or touch the keyboard in an unfamiliar situation. If you are one of these people, then the below is not for you. Instead you should read about overcoming your fear of computers.
You should have some sort of basic idea about how a computer works.
You should know what a file is, what a directory (or folder) is, and be comfortable with creating and deleting both directories and files. Knowing the difference between your hard drive and your RAM would be excellent, too.
Most important of all, you should be curious.
Carl Sagan said something about a sense of wonder being imperative for all scientists. Well, there is a reason that the act of studying computers is Computer Science. If you are interested, you'll go far.
With these conditions met, the learning should come easily. Note that all of these lessons constitute a constantly evolving work in progress. If anyone has helpful hints or a question about something that I didn't explain clearly, please either node a better explanation and/or /msg me about it.

The language which I will be teaching you is a procedural language/object-oriented language called Python. The principles you learn using Python will apply to almost any other language, but you should be aware that Python is one of those languages that some love and others hate. I have used it to teach others, however, and I think it is a good first language, but if others should feel free to (and indeed, I would encourage them to) replicate all of my examples and explanations in the language of their choice.1

The very first thing you should do upon deciding to do the lessons below is to go to http://www.python.org and download and install the most recent version of Python for your operating system. Then come back and we can start going through them in the order below.

Lessons:

  1. Producing Output
  2. Math
  3. Variable and Function Calls
  4. Types and Objects
  5. If/Then
  6. Loops
  7. Defining your Own Functions
  8. Libraries and Modules
  9. Philosophies of Coding
  10. Conclusion and Further Reading

If you actually learn using this, please /msg me with questions or suggestions. I'm planning on becoming a professor of Computer Science, so it'd be good for me to start getting better at teaching and explaining right now. This is, of course, (c) 2002 by me.


  1. Although you should ensure that you are explaining how to program, not how to program in X language.

printable version
chaos

Learn to Program: Producing Output Learn to Program: Philosophies of Coding Learn to Program: Math Learn to Program: Types and Objects
Learn to Program: Variables and Function Calls Learn to Program: Libraries and Modules Learn to Program: Conclusion and Further Reading C Programming in 12 Easy Lessons
Learn to Program: Defining your Own Functions Learn to Program: If/Then Learn to Program: Loops A cool short C program
Learn C, you hippies The Laws of Coding naive perceptions about software development Why C sucks
Teach Yourself Scheme Useful Number Theory functions in C The hidden danger of school lunch programs Once, everyone was a computer novice
I'm not a geek, and I wish I were Learning to program How to Become a Hacker Coding a Transhuman AI
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help


cooled by shaogo

Cool Staff Picks
Look at this mess the Death Borg made!
Syphilis
Lord of the Flies
Writing a Novel is Hard
A day in the life of Everything, Kansas
The Three Laws of Thermodynamics
Weird headless death cult of writer apostles
Rock Thériault
gas discharge surge protector
Sam and Dave
Goldfish
The Holocaust
Hizbullah
Things not to say in Thai
New Writeups
Wuukiee
Highly ornamental cultivars of brambles still have as many thorns as their wild counterparts(idea)
TheDeadGuy
Editor Log: May 2008(log)
everyday j.Lo
pray do not molest them(thing)
ammie
Bands Who Take Their Names from Eighteenth-century English Poetry and Prose(idea)
shaogo
Under My Thumb(review)
ammie
Rock On(person)
The Custodian
The Dresden Files(thing)
Ouzo
PETA becomes you, a proposed future(fiction)
Ereneta
Stone Soup, Part Two(fiction)
jjen
Sorrier than I ever thought I would be(personal)
locke baron
Moskva class antisubmarine cruiser(thing)
Wuukiee
May 15, 2008(idea)
locke baron
Kuznetsov class aircraft carrier(thing)
Adaptive Child
Annie's garden salsa(recipe)
Simulacron3
Zig-Zag(thing)
This affordable entertainment brought to you by The Everything Development Company