68 cards
Pinned

000 Start here! [0d]

makandra Archive offers an 8 month paid trainee program Archive 🇩🇪 for junior developers that are looking to start a professional career in web development.

This curriculum contains goals, resources and code exercises for our trainees. If you haven't joined us yet, it offers you a glimpse of what you will learn!

Organizing your code

Push all your work to a GitLab repository, at least once per day. You can create unlimited repositories in personal your namespace, e.g. your.name/moviedb.

When an ex...

105 Ruby basics [2d]

Ruby is the programming language we use on the backend.

Goals

After finishing this lesson you should be able to read and write simple Ruby programs.

Gain an understanding of the following concepts:

  • Working with basic datatypes: String, Integer, Float, Boolean, Array, Hash
  • Control flow: if, each, case, break...
  • Functions: def, return, implicit return in methods and blocks
  • Errors, raise and rescue
  • Classes and inheritance
  • The difference between class methods and instance methods (`def self.meth...

110 Where to find API documentation [0.5d]

There is no single place to look up documentation for our stack.

This card includes some hints where you can find API documentation. You probably want to drag a few of those links to your bookmarks toolbar. This will help in the upcoming exercises.

Ruby

Basic classes like String, Error, Hash or Object are part of the Ruby standard library:

120 Git basics [1d]

Git Archive is our version control system.

Goals

  • Understand why we use git.
  • Learn how to work with your local repository:
    • Create a local repository (git init)
    • Commit changes (git commit)
    • See the history (git log)
    • See changes (git diff)
    • Work with branches (git checkout, git checkout -b, git merge)
    • Work with the stash git stash
  • Learn how to work with a server:
    • git clone
    • git push
    • git fetch
    • git pull
  • Learn to use the tool tig
  • Configure your git c...

125 Gems, bundler, rbenv [1d]

makandra is responsible for maintaining about 75 Ruby projects. These projects use a large number of different versions for Ruby, Rails and many gems. To be able to switch between projects easily, we must control every dependency our applications has.

Goals

  • Understand what a gem is
  • Learn how to install a gem
  • Be able to look into gem code
    • locally
    • on GitHub
  • Learn about Bundler
    • Why is it necessary:
      • Managing versions and dependencies
      • Defining a consistent project environment
    • What is the difference bet...

130 Ruby on Rails basics [4d]

Rails is our web framework.

Goals

  • Be able to write a simple Rails application.
  • Understand how Rails talks to the database (ActiveRecord)
    • What is a model?
    • How are records retrieved and saved?
    • Validations
    • Migrations
    • belongs_to, has_many, has_many :through
  • Gain an understanding of the structure of a basic Rails app
    • Routes
    • Controllers
      • Generate a controller using Rails scaffolding
      • Write your own controller
    • Views
      • using ERB
    • Models
    • Helpers
  • Learn how to do CRUD ("Crea...

135 SQL basics [2.5d]

SQL is the language used to talk to a database.

Goals

  • Understand what SQL does
  • Understand what "MySQL" and "PostgreSQL" are
  • Understand how we connect to a database:
    • The database runs on a database server, usually on another machine. For local development, the server is your PC.
    • To speak to the server, you need a local client for MySQL or PostgreSQL installed on your system.
    • To connect to a server, the client needs the server's hostname, a username and a password.
    • You Rails app includes a gem that serves as a da...

140 Testing basics [4d]

Goals

  • Understand why we test:
    • Low defect rate without a QA department.
    • Customer acceptance testing can concentrate on new features and things a robot cannot do (e.g. how does a feature look and feel).
    • Frequent deploy gets changes to users faster.
    • We sleep better, because we know stuff still works.
    • Make sure no one removes a feature by accident.
    • Ability to change one part of an application without needing to understand the entire system.
  • Why do we use different types of tests?
    • What are the pros and cons ...

141 Creating test data with factories [1d]

Goals

  • Learn to create test data effectively using factories.
  • Decouple tests by having each test start with an empty database and create only the records needed for the test.

Learn

Factories, not fixtures

By default Rails uses global fixtures Archive for its tests. This is a giant world of example data that grows with every test.

In our experience the use of fixtures can make a test suite hard to work with. In any non-trivial test suite th...

142 Validations [1d]

Basic validations

Read the Rails Guide on ActiveRecord Validations Archive . You should have an overview which kinds of validations are built into Rails.

Also read Testing ActiveRecord validations with RSpec.

Make the following changes to your MovieDB:

  • Make sure your MovieDB models have validations for all required fields.
  • Make sure you have specs for all your validations ...

145 CSS basics [3d]

Goals

  • Understand at least the following CSS concepts:
    • Classes
    • Selecting elements for styling
    • Basic styling (color, typography, spacing)
    • The box model
    • Inline elements vs. block elements
    • Ways to layout elements
  • Learn how to use your browser's "inspect" feature and how you can see which CSS styles are applied to an element
  • Learn what a "reset stylesheet" is.
  • Learn what "CSS precompilers" are. Examples are "Sass" and "Less" (we use "Sass").
  • Learn some basic Sass syntax:
    • Variables
    • Nesting
    • Parti...

150 JavaScript basics [2d]

JavaScript is a scripting language supported by all browsers. Browsers don't speak Ruby, so if we want to implement client-side logic that runs in the browser, we need to express ourselves in JavaScript.

Goals

You should have a strong understanding of the following language features/concepts:

  • Writing and reading variables
  • Defining and calling functions
  • Control flow: if, for, switch, ...
  • Functions and function pointers
  • Iterating over lists
  • Throwing and catching errors
  • The arcane rules around this.

Coming from Ruby ...

152 Working with the DOM [1.5d]

JavaScript code can access and manipulate the browser's DOM tree Archive . Using JavaScript we can add interactive behavior to our interfaces that would not possible through declarative rules in HTML and CSS alone.

Goals

Know how to use the native DOM API to do the following:

  • Selecting all elements matching a given CSS selector
  • Selecting all descendants of a given element matching a given CSS selector
  • Registering event listeners
  • Changing an element's C...

154 Haml [0.5d]

Goal

Exercises

  • Convert MovieDB from ERB to Haml

Hint

The Haml-tutorial Archive doesn't show how to execute ruby-code that isn't rendered to HTML. To do this start a line with a dash ('-') instead of the equals-sign ('=').

155 Software design basics [2d]

Reading

Read the following chapters from The Pragmatic Programmer (in our library):

  • Software Entropy
  • The Evils of Duplication
  • Orthogonality
  • Decoupling and the Law of Demeter
  • Evil Wizards

Read the following chapters from Clean Code (in our library):

  • Chapter 1: Clean Code
  • Chapter 2: Meaningful Names
  • Chapter 3: Functions
  • Chapter 4: Comments
  • Chapter 5: Formatting
  • Chapter 8: Boundaries
  • Chapter 10: Classes
  • Chapter 12: Emergence
  • Chapter 17: Smells and Heuristics

Also read:

  • [Keep It DRY, Shy, and T...

165 ActiveRecord scopes [4d]

In this card we will learn to write code that scales with a large number of database records. We will do this by pushing work out of Ruby and into the database.

Goals

  • Understand what scopes ("relations") are and how they differ from arrays.
  • Understand how a purely object-oriented approach of processing data doesn't scale for a large number of database records.
  • Get into a habit of off-loading list-related calculations (filtering, mapping) to the database. Only fetch an ActiveRecord objects from the database when you actually pla...

170 Memoization [0.4d]

Goals

  • Understand what Memoization is and when it can be useful.
  • Understand the @variable ||= computation pattern.
  • Learn how to use the memoized gem.
  • What are the advantages of a gem like memoized over the @variable ||= syntax?
  • Why can it be dangerous to memoize class methods?
    Why is it often fine to memoize instance methods?

Resources

172 Debugging [1d]

When your code does not behave as expected, you can use a debugger statement ("breakpoint") at any point in your code. This statement will open a REPL ("console") that you can use to inspect the current state of the program and move the control flow ahead manually.

Use debugging tools to find the exact line in the code where your expectation does not match the actual behavior. Since we use open source for everything, we can always find that line. When you ask a colleague for help, they will be able to help you better when you have a...

This website uses short-lived cookies to improve usability.
Accept or learn more