Giter Site home page Giter Site logo

programming-univbasics-intro-to-programming-as-conversation-atlanta-web-010620's Introduction

Introduction to Programming as Conversation

Introduction

Welcome! In this module, we’re going to start learning how to program in Ruby.

It will be a long process and you will have moments of elation, excitement and, sometimes, we're sorry to say frustration. But we promise you, learning to think in the disciplined way that programming teaches will change your life for the better.

Programming as Conversation

Our method for teaching programming starts from a different place than you might expect. If you've ever looked at programming tutorial or book you might be expecting lectures on electricity, how to convert decimal numbers to binary numbers, data types, variables, or something like that. We've designed our curriculum to not do that.

Confused by code being front-loaded

We think there's a different, and better, way. We start by thinking deeply about having conversations.

Conversations are a natural model for thinking about programming

Many of the ideas we’ll share in this module ask you to reflect on "when you learned to talk" or "when you’re talking with a friend." We call this "programming as conversation" and it gets you to think about communicating instead of "memorizing strange programmer words, facts, and symbols." You'll learn those strange words and symbols eventually, of course, but you'll see them as part of the act of communication, something you find natural right now.

Programming is About Communication

Turning Gears in Communication

At its heart, programming is about communicating strategies for solving problems. You:

  • Document these strategies for yourself
  • Communicate these documented strategies to others
  • And then, lastly, ask a computer to run these strategies very fast

A "program" then is actually a strategy for solving a problem that people use to communicate with one another as well as give to a machine.

A recipe for a fancy dish is a good comparison: you document the ingredients and preparation for yourself using a human-language. You can then communicate that plan for food preparation by sharing the recipe with a friend.

Programs are Written in Notation

Notation Systems

Even in recipes, we commonly use special notation like 3g for "3 grams" or ½C. for "½ Imperial Cup." In recipes, we usually use notation to save time so our wrists don't get tired. But with computers, we have to communicate using notation. Human language is often vague and imprecise and computers are terrible about handling unclear directions. To help prevent communication breakdowns, we converse with them using a special notation. The "special notation" is the programming language's rules or "syntax."

DEFINITION Notation: A specialized vocabulary or system of symbols for communication. Examples Musical notation, arithmetic symbols, chemistry symbols, traffic signs, or knitting patterns.

Programming Defined

Let's propose a definition of programming:

DEFINITION Programming: The act of creating programs: documents written in a notation system that can be understood by other humans as well as computers.

Programming Language Defined

DEFINITION Programming Language: A programming language defines the rules of notation ("syntax") that are required for it to ask the computer to do work on your behalf.

When programmers say "I prefer Ruby to JavaScript" they're saying "I like the notation system that Ruby uses for expressing problems and their solutions." It's a lot like why some people like to play one instrument over another. In your heart you might feel like a bassoonist, tuba player, or pianist — but all those instruments play a Middle-C note at the same frequency. Programming languages are similar: while their notation varies, they all ask the chips inside the computer to do the same work at the end of the day.

As such a lot of the "fashion parade" of "what's hot" in the technical scene is just fashion. The really important thing to learn is: "What kind of problems or solutions does this language make easier to express?"

We Converse With Computers

One of the most essential ways of communicating, that we've all practiced thousands of times, is a conversation. "Conversation" comes from the Latin words meaning "by taking turns." In conversation, we "take turns" expressing ourselves.

A unit of "ideas" is an expression. When a listener hears an expression they interpret the words and symbols and sounds in the expression into a meaning. We call the work they're doing there evaluation. The result of evaluation for a human is "understanding." Computers show their understanding by returning the result of that evaluation. That value is called a return value.

Consider this diagram:

Conversational Summary Graphic

In the next lessons, we're going to see how Ruby acts as a "listener" in a conversation. When given an expression, Ruby will evaluate it and, like a good friend, give you a reaction about how it evaluated your expression. In the programming world, we call responses from the programming language a return value.

When expressions are evaluated, they return something

Sometimes our expressions might not make sense to Ruby, just like sometimes our conversations with friends don't quite make sense to them.

Work, you stupid machine is not part of the valid notation of Ruby. Likewise 1 + "Cookie Monster" is also not valid. Here we've broken the rules of the notation system. These are known as syntax errors. Computers require us to honor their limited vocabulary. Syntax errors are prompts from the programming language to help steer our communication to be more precise.

Conclusion

Congratulations! You've finished your first lesson in thinking about programming as a conversation. As you might guess, expressions are important because they're how we "push" ideas to computers and other programmers. We're going to spend the remainder of this module learning to build expressions and understanding how Ruby will evaluate them. Make sure you've integrated the vocabulary words of "expression," "evaluation," and "return value" before moving on.

programming-univbasics-intro-to-programming-as-conversation-atlanta-web-010620's People

Contributors

maxwellbenton avatar elishevaelbaz avatar sgharms avatar

Watchers

 avatar Mohawk Greene avatar Victoria Thevenot avatar Bernard Mordan avatar Otha avatar raza jafri avatar  avatar Joe Cardarelli avatar The Learn Team avatar Sophie DeBenedetto avatar  avatar  avatar Matt avatar Antoin avatar  avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Ahmed avatar Nicole Kroese  avatar Kaeland Chatman avatar Lisa Jiang avatar Vicki Aubin avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.