Welcome to ClojureBridge

Agenda

Introductions

We'll go around the room and ask everyone to introduce themselves and mention what brings them to ClojureBridge.

You are here!

This graphic shows you all the tools you will be using today:

You are here

Why Clojure?

Using git to save your programs

Agenda for Friday

Join us at Prime Digital Academy from 6pm - 8pm

Click here for a map to Prime Digital Academy
Prime Digital Academy
301 4th Ave S Suite 577,
Minneapolis, MN 55415

We'll welcome you at the door so you can sign-in, customize your badge and pickup a lanyard.

Installfest

The goal of the Installfest is to ensure all the software you need for the workshop is installed and ready to go. We do this separately from the workshop because it can sometimes be tricky. Don't worry -- we'll have plenty of volunteers who are ready to help!

See the detailed instructions on the Installfest page.

Dinner

We will provide pizza and soft drinks.

In addition to getting ready for the workshop this is a great chance to meet the other students and volunteers.

Don't forget to bring your badge back on Saturday!!!

Agenda for Saturday

08:30 AM - Breakfast
09:00 AM - Welcome: Introductions, Why Clojure & Using git to save your program
10:00 AM - Track 1 & Track 2 - Workshop Part I
10:30 AM - Break
11:15 AM - Panel Talk: Ask any questions you have for software development professionals
12:00 PM - Group Photo & Lunch
01:00 PM - Workshop Part II
02:30 PM - Break
03:00 PM - Workshop Part III
04:00 PM - Wrap Up and Survey
04:30 PM - Celebration: Informal Gathering at Crooked Pint

Programming and Why Clojure

What is programming?

Programs are a set of instructions for a computer to follow.

Computer programming is about expressing the instructions in a language that can be translated down to the detailed steps that a microprocessor can understand.

Programs that do something interesting enough that we would recognize -- like sending an e-mail, uploading a photo or making a restaurant reservation -- are, themselves, made up of many smaller programs.

Software developers often start with a big goal like "make a restaurant reservation application" and break it up into smaller pieces. In fact this process happens repeatedly until the pieces are tiny and bite-sized.

Because everyone likes to eat let's use preparing an Italian dinner as an analogy. The goal is:

So let's start by breaking that into independent parts: we'll combine all three parts to make the meal.

  1. Fettuccine Alfredo
  2. Salad
  3. Red Wine

We can even break the parts into steps:

  1. Fettuccine Alfredo
    • Cook pasta
    • Make Alfredo sauce
  2. Salad
    • Cut veggies
    • Make homemade vinaigrette
  3. Red Wine

Now each of the steps (except maybe making the sauce :) is short and straightforward.

In computer lingo we would say that each of these steps are "functions": each is designed to accomplish a specific task. A "program" is just a big function that's built on top of lots of other little functions.

What is "functional programming"?

The words "functional programming" mean more than just programming with functions. It means programming with small functions that take some input and provide some output without depending on other knowledge of how "the system" is running.

By contrast "imperative programming" describes functions that are changing things in "the system" that you have to remember. Set the variable X to $19.95 and the variable Y to 3. At first the "change this, then change that..." approach seems easy to understand until you get a lot of details that you have to keep in your head to understand the function.

In "functional programming" the idea is to have short functions where you can see everything that's happening without having to remember what's going on outside the function (i.e. in "the system"). Clojure programmers like to talk about functions taking in data of a certain shape and returning data of a different shape. The data could be numbers or text or collections of things.

Why Clojure??

Clojure is a modern adaptation of of the classic functional programming language LISP (which stands for list processing language) which dates back to 1954!

In LISP everything is a list. The functions you write are lists. The data for your functions are lists. The clever bonus of having everything is a list is that programs and data look the same. That means we can have functions that create or improve other functions because they all look like data!

Many programmers are surprised by LISP because the parentheses are always on the outside:

(italian-dinner main-course side beverage)

... because many popular computer languages put the function name first (instead of at the beginning of the list of arguments)

italian_dinner(main_course, side, beverage);

In designing Clojure, Rich Hickey combined the good parts of LISP and combined it with the powerful Java Virtual Machine. As a result Clojure is an opinionated LISP that...

And it turns out the Clojure community is wonderful * Tends to be full of explorers: people that are curious, eager to learn and happy to help each other * Even though typically big companies are hesitant to adopt new technologies Clojure is beginning to see more commercial use. * Values diversity (e.g. conference opportunity grants, ClojureBridge)

Open Source: why the Community is important

Clojure is open source software... what does that mean?

Open source software is...

Typical examples are Linux (runs in every Android phone), the Firefox web browser, and the Libre Office suite of tools.

Why makes open source software great?

  1. Volunteers work on projects that they are passionate about
  2. You can adapt and change it to make it work for you
  3. The investment in learning an open source program often pays off because (good ones) often last a long time
  4. Because the code is open anyone can inspect it for security weaknesses or privacy vulnerabilities.
  5. Everyone can get involved simply by being a user, reporting bugs, working on documentation and, yes, contributing code.

Why is diversity in technology (especially open source software) important? * Women are 50% of users, but only 15% contributors * For any software to be successful it has to take the needs of users into account * In order to make better software we need YOU!

A journey begins...

Today you will publish a program on the Internet!

After today you can continue your learning...

Software is everywhere!

speaker note: reveal the secret now

Git

What is version control?

One way to think about version control is in the context of some software tool you currently use. Every few months you get a new 'version' of the tool you are using. The code that was written to create the software tool is the same original files, but in this new version some of the files may have been changed to add a new feature or fix a bug (broken code). Git is one of the tools that developers use to be able to facilitate multiple versions of the same code.

Some other analogies:

Why use version control/git?

Why git?

The git documentation covers this topic very well here if you want to more in depth to why git.

Github vs git

git

git is a command line tool (in your terminal), that allows us to get all the benefits described above. You can do all you need locally (on your computer) without connecting to the internet. See the Why git? section for more detail, but it's local capabilities are one of it's main advantages.

Github

Github is a web application built on top of git. It adds some additional functionality and some nice UIs (user interfaces) to make things easier to read. The main benefit is it easily helps us collaborate with other developers. We can put our code up on Github and others can collaborate on the project, use our code as an example, or give us feedback on what we are writing.

You may hear people say "remote repository" this is what Github is. A place not on our computer where we can store our code.

There are other similar services. Github is just one that is popular and we will be using during the workshop.

Git basics - Commands and theory

We are going to learn five basic command that will get you started with git in your terminal. You will see references to these throughout the curriculum, but feel free to come back to these notes if you need a reminder.

Commits

Commits are sets of changes to the code that we can move through to see the history of all the files. They capture what the code looked like at the time of the commit.

Workflow Diagram

We will reference this diagram in the descriptions below.

git workflow diagram

git init

This command turns the folder your code is in into a local git repository.

$: cd project-folder
$: git init

git status

This command prints out the current state of your local repository. It will show you the files git is tracking or not, what changes have been made, and what changes are staged for commit. This is a command developers run frequently and inbetween different stages.

$: git status

git add

When you are happy with a change (or changes) you need to move them to the staging area. Files in the staging are in green when you run the git status command. All staged changes will be included in your next commit.

git commit -m

Like mentioned earlier, a commit a snapshot of the code at that time. This command takes the staged changes and makes that snapshot. The command also takes a message that describes the changes being committed.

$: git commit -m "useful message describing the change"

create a remote and link to remote repository

Instructions for how to do this can be found here. Github will give us some additional commands to link the local with the remote repository. For now copy and paste these to set up tracking.

git push

Now the changes are in the local repository, it is time to put them on the remote repository to share the code you wrote (with a friend!). This command will do that!

$: git push

More Resources