Hello!
In early summer, many large companies conduct internships for undergraduate students and graduates of technical specialties. I was fortunate enough to join the ranks of such young specialists in SKB Kontur. Our acquaintance with the world of software development began with an event codenamed “Crash Course” - a four-day intensive away school. There was a lot of interesting, exciting and informative, but I would like to tell about one of our special entertainment in more detail. So today we have Code Retreat!
Code Retreat - what is it ?!
First of all, about the Code Retreat format. This is a developer meeting consisting of several programming sessions that satisfy simple rules:
- session duration 45 minutes;
- all programming is done in pairs and only in pairs;
- each session pairs randomly shuffled;
- at the end of each session, all written code is ruthlessly deleted;
- each session solves the same problem, but with various additional restrictions. Actually, in these restrictions all the salt!
At first glance, the event may seem mildly strange, with unusual, uncomfortable and unrealistic rules. But it is necessary to participate in it and the opinion is changing dramatically!
Eyes of the witness. How it was.
At the crash course I learned about Code Retreat for the first time and, as it turned out, not only me. It all began with a harmless first iteration, where we were offered to implement the game "
Life ." We sat down in pairs, the timer was started and ...
')
Iteration 1
Limitations:
- The time limit is 45 minutes.
- It is necessary to get comfortable with the task, to program something.
It must be said that the majority had a solution ready after the allotted period of time and it worked. Then there was a 10-minute coffee break with cookies, juggling (?!) and complete removal of the written code! In addition, change pairs.
Iteration 2
Limitations:
- 45 minutes.
- Using TDD:
- There is only one simple test in each test.
- Each new test should be:
- Early red
- As simple as possible
- As simple as possible
- For the keyboard, each for 5 minutes.
At the end of the standard operation with the removal of written code and eating cookies =) And, of course, changing pairs!
Iteration 3 (already interesting)
Limitations:
- 45 minutes.
- Restrictions on the size of methods - no more than 3 (!) Lines.
- For the keyboard, each for 5 minutes.
- The playing field is infinite.
This iteration has become much more fun! But ahead loomed the final, fourth iteration! And at first, you guessed it, removing the code and changing pairs!
Iteration 4 (very interesting)
Limitations:
- 45 minutes.
- For the keyboard, each for 5 minutes.
- At choice:
- Do not use mouse
- 3 min planning timeframe (The entire session consists of three-minute cycles. At the beginning of each cycle, the partners agree that they want to catch this cycle. If after 3 minutes after the start, the goal is not reached, then all code written for this cycle is deleted and the cycle need to start over)
- At choice:
- No cycles.
- No conditional statements.
- No variables.
Honestly, the final iteration of the majority lasted much longer than 45 minutes, since everyone wanted to get a working program. And no one wanted to give up for a long time =)
Impressions
Two words: this is something! It is difficult to convey all the emotions of what happened in several paragraphs. The situation was heated up by the fact that we did not know what the limitations would be next time and on the first iteration they didn’t even know what would happen at the end. I liked everything! The feedback shared by the interns is only positive. I strongly recommend that anyone who has the opportunity arrange something like this.
Comprehension
What is the benefit of Code Retreat? In fact, here you can list all its advantages for a long time, but it is worth mentioning the main ones.
- First, it is an exchange of experience. With each new iteration, you gain new ideas, learn from the experience of a new partner, and also transfer your knowledge to other people.
- Secondly, this is an expansion of consciousness (well, I don’t know how to call it differently, maybe “pumping thinking”?). If you solve the problem in the same way, it is sometimes difficult to come up with another or several other solutions. Extreme restrictions simply force to do it and go beyond the usual.
- Thirdly, the sea of ​​positive and communication. You acquire the experience of jointly solving a given task together with a practically unknown (it’s only at first) person.
Total
Crash course is over, I described only one of the many attractions, but the
internship in Kontur is in full swing! Good luck to all!
Thanks for attention! =) And be sure to try, you can unsubscribe about your impressions in the comments.
Code authors below
Denxc and
SleipnirPart of the code of the game "Life" from the last iteration. class Game { private HashSet<Point> aliveCells; private IEnumerable<Point> movingVectors = new List<Point>() { new Point(-1, -1), new Point(-1, 0), new Point(-1, 1), new Point(0, -1), new Point(0, 1), new Point(1, -1), new Point(1, 0), new Point(1, 1) }; public Game(IEnumerable<Point> initCells) { aliveCells = new HashSet<Point>(initCells); } public Game MakeStep() { return new Game(aliveCells.SelectMany(Neighbours).Where(ShouldAlive)); } public void Show() { Console.Clear(); aliveCells.Where(c => cX >= 0 && cY >= 0 && cX < Console.WindowWidth && cY < Console.WindowHeight) .Select(PrintPoint).ToArray(); } public bool PrintPoint(Point cell) { Console.SetCursorPosition(cell.X, cell.Y); Console.Write('*'); return true; } public IEnumerable<Point> Neighbours(Point cell) { return movingVectors.Select(c => new Point(cX + cell.X, cY + cell.Y)); } public bool ShouldAlive(Point cell) { var aliveNeighboursCount = Neighbours(cell).Count(aliveCells.Contains); return aliveNeighboursCount == 3 || aliveNeighboursCount == 2 && aliveCells.Contains(cell); } }
Download the source code, the executable file and see the result
here .