Work Flow for Solo Developers and Small Teams

48
Work Flow for Solo Developers and Small Teams @emmajanedotnet [email protected]

description

Is your theme folder filled with files like this: page.old.2.bak.php? Does Git make you angry inside? Do you resent that everyone except you regularly visits the magical place referred to as "The Command Line"? Are you afraid of the vagrant who stole your puppet? In this workshop you will get a step-by-step introduction to working efficiently as a Drupal developer in small teams, or as a solo developer. We'll focus on real world examples you can actually use to make your work faster and more efficient. Full workshop available at: http://designtotheme.com/workshops/work-flow-solo-developers-and-small-teams

Transcript of Work Flow for Solo Developers and Small Teams

Page 1: Work Flow for Solo Developers and Small Teams

Work Flow forSolo Developers and Small Teams

@[email protected]

Page 2: Work Flow for Solo Developers and Small Teams

Today

1. Developer’s Environment(The Command Line)

2. Version Control Basics

3.Developer Tools for Larger Teams

Page 3: Work Flow for Solo Developers and Small Teams

A Developer’s Environment

Page 4: Work Flow for Solo Developers and Small Teams

Together, Yet Separate

Page 5: Work Flow for Solo Developers and Small Teams

The command line is used in many free,online resources.

Page 6: Work Flow for Solo Developers and Small Teams

GUIs reveal complexity in different ways.

SourceTree, OSX

SmartGit, cross-platform

Page 7: Work Flow for Solo Developers and Small Teams

$ _

Page 8: Work Flow for Solo Developers and Small Teams

In the Beginning, Was the Command LineA command-line interface (CLI) is a means of interaction with a computer program where the user (or client) issues commands to a program in the form of successive lines of text (command lines).

The command-line interface evolved from a form of dialog once conducted by humans over teleprinter machines, in which human operators remotely exchanged information, usually one line of text at a time.http://en.wikipedia.org/wiki/Command-line_interface

Page 9: Work Flow for Solo Developers and Small Teams

Commands Affect Your Environment

http://en.wikipedia.org/wiki/Logo_(programming_language)

Page 10: Work Flow for Solo Developers and Small Teams

Commands Affect Your Environment

http://www.youtube.com/watch?v=LRhbcDzbGSU

Page 11: Work Flow for Solo Developers and Small Teams

Command Line Interface

http://en.wikipedia.org/wiki/Command_Prompt

Page 12: Work Flow for Solo Developers and Small Teams

define:prompt

a transitive verb meaning To move to action.

? forward 90

> open mailbox

At the command line, you are constantly being asked by the computer, “What action would you like to take next?”

Page 13: Work Flow for Solo Developers and Small Teams

Commands(verb)

● One-word actions:– sing– jump– look

● One-word commands:– help– exit– history

Page 14: Work Flow for Solo Developers and Small Teams

Commands With Parameters(verb noun)

● An action, and a direct object:– take book– read pamphlet– open window

● Commands with parameters:– cd /var/www– man <command_name>– mv file_current_name.jpg file_new_name.jpg

Page 15: Work Flow for Solo Developers and Small Teams

Commands With Modifiers + Parameters(verb adjective noun)

● Refining the request:– go down stairs– take blue pill– open left door

● Adding a flag/switch/modifier:– mkdir -p parent_directory/sub-directory– tar xvf file_to_extract.tar.gz– ls -lh

Page 16: Work Flow for Solo Developers and Small Teams

Ten Commands I Use All the Time

ls list files

cd change the current directory

mv move a file to a new location (and/or rename)

cp copy a file

pwd print working directory (answers: where am I?)

rm remove file

clear refresh the screen

man read the manual page for a specific command

tar work with packages of files

chmod change the “mode” (aka permissions) of a file or directory

Page 17: Work Flow for Solo Developers and Small Teams

“All” The Commands

http://www.commandlinefu.com/commands/browseThis site includes a “rating” function.

Page 18: Work Flow for Solo Developers and Small Teams

Learning the CLI toolsmakes your knowledge portable.● OSX and Linux both use the same flavour of

command line environment (“the shell”).● Not all Web server applications have a graphical

administrative interface, so learning to use the command line allows you to run server applications in your local developer environment.

● Sequences of commands can be captured as scripts, which you can run on any compatible machine without having to point-and-click.

Page 19: Work Flow for Solo Developers and Small Teams

Version Control Basics

Page 20: Work Flow for Solo Developers and Small Teams

Benefits of Version Control

● Backup and restore● Syncronization across multiple systems● Short-term undo to test implications● Long-term undo to reverse bugs● Track changes to see why/how software evolved● Track ownership to give ‘credit’ to change makers● Sandboxing our code to test changes without

affecting others

Page 21: Work Flow for Solo Developers and Small Teams

There is no excusefor not having version control.

The cheapest way to get version control is to use an automated backup system, like Dropbox, for your code.

Page 22: Work Flow for Solo Developers and Small Teams

Terminology

● Repository. The database of changes to your files.● Server. The computer storing the repository.● Client. The computer connecting to the repository.● Working copy. Your local copy, where changes are

made.● Trunk (or “main”). The current, primary source for

unchanged code.● Head. The latest revision in the repository.

Page 23: Work Flow for Solo Developers and Small Teams

Basic Actions

● Add. Put a file into the repo.● Revision. Checks what version a file is on.● Check out. Download files from the main repository.● Check in. Upload changed files to the main repository.● Changelog. A list of changes made to a file since it was

created.● Update/sync. Synchronize your files with the ones from

the main repository.● Revert. Throw away your local changes and reload the

latest version from the repository.

Page 24: Work Flow for Solo Developers and Small Teams

Workflow: The Solo Developer

Create project Add files Do your work

Do more work

Upload files

Page 25: Work Flow for Solo Developers and Small Teams

define:workBasic Check-ins

Milk MilkEggs

MilkEggsJuice

MilkEggsSoup

MilkEggs

r1 r2 r3 r4

Main Trunk

Page 26: Work Flow for Solo Developers and Small Teams

Diffs Show the DifferenceBetween Two Versions of a Project

Milk MilkEggs

MilkEggsJuice

MilkEggsSoup

MilkEggs

r1 r2 r3 r4

Main Trunk

+ Eggs + Juice - Juice+ Soup

Page 27: Work Flow for Solo Developers and Small Teams

define:workTagging

MilkEggsSoup

MilkEggsSoupBread

MilkEggsSoupBreadM&Ms

r4 r7 r9

Main Trunk

James’s FinalGrocery List

Emma’sAdditions

GroceriesPurchased

Page 28: Work Flow for Solo Developers and Small Teams

define:workBranching

MilkEggsSoup

MilkEggsSoupBread

MilkEggsSoupBreadM&Ms

r4 r7

r9

Main Trunk

Candy Store

Page 29: Work Flow for Solo Developers and Small Teams

Workflow: Read-only Projects“Fork Me” on GitHub

Improvedversion of

project

Random Project on the Internet

My Fork

(branch)

Page 30: Work Flow for Solo Developers and Small Teams

Workflow: Partner

1. James starts a grocery list 2. Emma already had a grocery list started. She asks to see James’s list.

3. James remembers a couple more items.

5. The grocery lists are combined and James goes shopping.

4. Emma adds a few things from her list.

Page 31: Work Flow for Solo Developers and Small Teams

Collaborative Actions

● Branch. Create a separate copy of a repository for personal use.● Diff/change/delta. Identifies the differences between two

versions of a file.● Merge/patch. Apply the changes from one version of a file, to

another.● Conflict. When two versions of a file have proposed changes at

the same place.● Resolve. Deciding which version of conflicting changes should

be applied, and which should be discarded.

Page 32: Work Flow for Solo Developers and Small Teams

Merging

MilkEggsSoup

MilkEggsSoupBread

MilkEggsSoupM&Ms

Main Trunk (James’s List)

+ Bread

MilkEggsSoup

+ M&Ms

+ M&Ms

MilkEggsSoupBreadM&Ms

Page 33: Work Flow for Solo Developers and Small Teams

Resolving Conflicts

MilkEggsSoup

MilkEggsBread

MilkEggsSoupM&Ms

Main Trunk (James’s List)

+ Bread- Soup

MilkEggsSoup

+ M&Ms

+ M&Ms

MilkEggsBreadM&Ms+ Bread

Page 34: Work Flow for Solo Developers and Small Teams

Sample Project

http://betterexplained.com/articles/a-visual-guide-to-version-control/

Page 35: Work Flow for Solo Developers and Small Teams

Workflow: Centralizedno local commits

checkout

commit

Page 36: Work Flow for Solo Developers and Small Teams

Workflow:Decentralized with a shared mainline

clone (or) pull

push

commit

commit

Page 37: Work Flow for Solo Developers and Small Teams

Developer Tools for Larger Teams

Page 38: Work Flow for Solo Developers and Small Teams

Complicated problems are complicated.

● Bigger code base = more contributors -> formalized code review process

● Bigger projects = more stakeholders -> project management

● Bigger projects = more infrastructure -> devops

Page 39: Work Flow for Solo Developers and Small Teams

Formal Code Review Process

● Code should never be released into the wild without having a second set of eyes on it.

● It’s very easy to overengineer your workflow process.

● Make sure you do what’s right, not what’s easy, for your team.

Page 40: Work Flow for Solo Developers and Small Teams

Workflow:Decentralized with human gatekeeper

clone

request merge

commit

commit

reject changes

merge changespull (fo

r updates)

Page 41: Work Flow for Solo Developers and Small Teams

Workflow:Decentralized with automated gatekeeper

clone

merge request

commit

commit

reject failed patches

push

pull (for updates)

requ

est r

evie

w

Page 42: Work Flow for Solo Developers and Small Teams

Project Management

● software– Trac, Basecamp, JIRA, (etc, etc)

● philosophies– Waterfall, Agile (XP, Scrum, Kanban)

Page 43: Work Flow for Solo Developers and Small Teams

* Driven Development

● Test-driven development (TDD)Write an (initially failing) automated test case that defines a desired improvement or new function, then produces the minimum amount of code to pass that test, and finally refactors the new code to acceptable standards.

● Behaviour-driven development (BDD)Behaviour-driven development specifies that tests of any unit of software should be specified in terms of the desired behaviour of the unit.

Page 44: Work Flow for Solo Developers and Small Teams

DevOps

Developers + Operations (System Administrators)

● Culture● Automation● Measurement● Sharing

Page 45: Work Flow for Solo Developers and Small Teams

DevOps Tools

● Deployment automation– fai, kickstart, preseed, cobbler

● Configuration management– puppet, chef, cfengine, bcfg2

● Build automation– jenkins, hudson, maven, ant, cruisecontrol

Page 46: Work Flow for Solo Developers and Small Teams

Start Today, Refine Later Today.

● Don’t try to change everything at once.● Look for easy things to change and implement

little bits at a time.● Sometimes you need to have short term

inefficiencies (learning a new tool) to gain long term productivity.

● Don’t let the enemy of progress be perfection.

Page 47: Work Flow for Solo Developers and Small Teams

Let’s Keep In Touch

[email protected]● @emmajanedotnet

Page 48: Work Flow for Solo Developers and Small Teams

Credits

● Type face:– Neutra Text by House Industries.

● Icons:– “Gartoon” icon theme pack for GNOME from

http://art.gnome.org/themes/icon– http://openclipart.org/user-detail/yyycatch

● Diagram ideas:– http://betterexplained.com/articles/a-visual-guide-to-version-control/

– http://wiki.bazaar.canonical.com/Workflows