makandra offers an 8 month paid trainee program 🇩🇪 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!
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...
Ruby is the programming language we use on the backend.
After finishing this lesson you should be able to read and write simple Ruby programs.
Gain an understanding of the following concepts:
String
, Integer
, Float
, Boolean
, Array
, Hash
if
, each
, case
, break
...def
, return
, implicit return in methods and blocksraise
and rescue
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.
Basic classes like String
, Error
, Hash
or Object
are part of the Ruby standard library:
Git is our version control system.
git
.git init
)git commit
)git log
)git diff
)git switch --create
or git checkout -b
git switch
or git checkout
git merge
git stash
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.
Rails is our web framework.
ActiveRecord
)
belongs_to
, has_many
, has_many :through
ERB
SQL is the language used to talk to a database.
By default Rails uses global fixtures 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...
Read the Rails Guide on ActiveRecord Validations. 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:
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.
You should have a strong understanding of the following language features/concepts:
if
, for
, switch
, ...this
.Coming from Ruby ...
JavaScript code can access and manipulate the browser's DOM tree. Using JavaScript we can add interactive behavior to our interfaces that would not possible through declarative rules in HTML and CSS alone.
Know how to use the native DOM API to do the following:
Hint
The Haml-tutorial 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 ('=').
Read the following chapters from The Pragmatic Programmer (in our library):
Read the following chapters from Clean Code (in our library):
Also read:
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.
@variable ||= computation
pattern.memoized
over the @variable ||=
syntax?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 ...
Get an overview of all the matchers that are built into RSpec.
Play with some of these matchers in your MovieDB tests.
Which of the following two lines is better? Why?
expect(array).to include(5)
expect(array.include?(5)).to eq(true)
Write a custom matcher ca...
As developers we are dealing with many tasks every week. We need a system to organize ourselves.
After completing this card you should have:
todo.txt
on your desktop or any other tool is fine, too.Learn about our process:
The squares represent the state of the story in Pivotal Tracker.
In particular you should understand:
Story format
--...
tldr
tool using sudo apt install tldr
. You can then get usage examples for every console command, e.g. tldr ssh
to get examples for the ssh
command.Basic commands
-...
will_paginate
gem to add pagination to MovieDB's list of movies. How long does the movies index render now?will_paginate
. Customize the style so it matches the look of your MovieDB.