Coding Gym Explained
Coding Gym is an international programming lab format open to any language and developed for continuous improvement.
We help others practice programming, software development and communication skills by making coding laboratories open to any programming language where cooperation is valued over competition, doing and sharing are valued over teaching, and where competing solutions come with discussing and understanding tradeoffs.
- Coding Gym in a nutshell
- Why attending Coding Gym?
- Coding Gym Philosophy
- Coding Gym for programming skills
- Coding Gym for soft-skills
Coding Gym in a nutshell
A canonical Coding Gym is organized by one or more Coding Gym trainers, it lasts 2 hours and consists of 3 self-contained challenges.
For each challenge, the attendees pair off and each pair chooses the programming language to solve the challenge. The trainer reads the problem and shows a few examples. Then people start working on the same challenge at the same time. During this phase, each pair codes and tests directly into the web browser, thanks to a Competitive Programming platform (like HackerRank) which hosts the exercises. In the meantime, the trainer peeks at what pairs are doing and gives hints if someone gets stuck.
When the time for a challenge is over, the trainer opens a retrospective and asks some people to explain their solutions. The target of the discussion is to understand tradeoffs, pros and cons of each. In this phase, the trainer may ask people additional questions and may change constraints of the problem. This way people have to discuss about the impact of these new requirements. More details on this phase are discussed in this section. Moreover, the trainer may show alternative solutions.
This process is repeated 3 times.
Coding Gym is generally organized monthly.
Attending Coding Gym is "lightweight" because only a web browser is needed and computers are provided by the host.
Why attending Coding Gym?
Coding Gym is a recurring laboratory developed for people to:
- improve problem analysis and solving skills
- improve fluency with the standard library and the idioms of known programming languages
- practice understanding and balancing programming compromises
- learn new algorithms, data structures and coding patterns
- practice unknown programming languages and paradigms
In addition, Coding Gym has been designed with additional benefits, since people meet and work together:
- working with others, instead of competing
- discussing with others, focusing on a specific challenge
- building relationships
Last but not least, Coding Gym may help people prepare for programming interviews. Indeed, many challenges are taken from real "tech giants" programming interviews.
Since 2016, regular attendees have reported that "Coding Gym makes a pleasant environment to":
- improve problem analysis and algorithm design skills
- learn new concepts, algorithms, data structures and coding patterns
- practice known languages and experiment new languages
- improve collaboration and communication skills
- prepare for coding interviews
Coding Gym Philosophy
Coding Gym Philosophy is based on the following concepts:
Freedom: Language and Paradigm Independence
Coding Gym is not tied to any paradigm nor programming language since Coding Gym exploits everything to achieve its targets and it is not limited by anything. For this reason, Coding Gym is free.
Any problem has value: Finding alternative solutions and patterns means improving and learning
For each problem, Coding Gym encourages to look for, study and experiment with alternative solutions, patterns and variations on the problem. This way, the brain is pushed to break the mold, growing up and learning new concepts, techniques and patterns. New solutions come with tradeoffs, pros and cons that must be identified and understood. After all, a key aspect of software development concerns balancing the best tradeoffs for a particular domain. Coding Gym establishes its training philosophy not only in facing and solving problems but also developing and comparing alternative solutions. Coding Gym problems are self-contained and they are naturally open to variations and change of requirements.
In addition, Any problem has value is a principle that Coding Gym exploits to maximize the value of easy challenges. For example, calculating the sum of the elements of an array is a trivial task. We just loop over the elements and sum them to an accumulator. Actually we can learn a pattern from this exercise. What if instead of sum we want product of the elements? The structure of the solution is the same but the operation (multiplication). Is there a pattern behind the scenes? It is called reduce (or fold). Some of us learnt something new. How to code such a pattern with our pet languages? Something more to learn. Is there any price coming from such a pattern? If we use this pattern into production, does our colleagues know how to change and debug this code? We started from a trivial task and we are actually going very far with interesting questions...
Only you can help yourself: The trainer can just show your vulnerability, sometimes
Coding Gym is not a course but it is arranged by one or more trainers. A trainer does not hold nor dispense any truth, rather she is just someone who will show "vulnerability" of attendees and will incite them to investigate concepts and techniques to improve. For example, a trainer might show an alternative approach to solve a problem or might propose a variation on the problem to quiz people on the possible impact.
Collaboration over competition: Pair Programming as a professional mean to improve soft-skills
Coding Gym is not a contest. Using pair programming, Coding Gym creates an environment conducive to active learning and collaboration, helps to lower gymmers frustration with too challenging problems. Pair programming encourages gymmers to interact with peers and share information, thereby creating a more communal and supportive environment. The collaboration inherent in pair programming exposes and reinforces gymmers to the collaboration, teamwork, and communication skills required in industry.
Collaboration and sharing are key principles of Coding Gym: people are encouraged to share their ideas and solutions during the retrospective. Sharing is communication and Coding Gym creates an friendly environment to train communication skills. Coding Gym usually hosts at most 25/30 people, making easier even for introvert people to put themself on the line.
3S: Solve, Study, Solve
Coding Gym is carefully organized by one or more trainers who have previously worked on the challenges. "Working on a challenge" at Coding Gym means that solving is just the first step of an infinite cycle, called 3S or Solve, Study, Solve. Once a working solution for a challenge is found, the challenge itself is investigated further to find new and competing solutions, patterns and problem variations (called perturbations). For each new solution 3S wants to identify pros, cons and tradeoffs it carries along.
3S aims towards learning and sharing with others. For this reason, 3S encourages to search all possible sources to get more knowledge, including literature and other people solutions.
3S cycle never really stops: since Coding Gym is a distributed laboratory, any challenge will be set at more than one gym. This creates natural iterations on each Coding Gym problem. When new value for a problem comes out then the common knowledge base on such a challenge is integrated and updated by trainers by applying 3S principle.
Coding Gym for programming skills
At Coding Gym people improve their programming skills and attitudes thanks to the combination of:
- facing with coding challenges carefully selected so that people have to think to solve them,
- taking part in the retrospective, a valuable and moderated discussion on the problem and the solutions found, where people can understand pros, cons and tradeoffs of each.
The complexity of each challenge is generally balanced with the scope of the retrospective that follows. This means that, for instance, if a problem is very easy, then more likely many solutions exist. Such solutions can be discussed and understood during the retrospective. On the other hand, if a challenge is hard, it will come with a non-trivial solution and the retrospective will focus on clarifying how to come up with such a solution.
At Coding Gym, challenges are carefully selected by moderators so that attendees have to think to solve them. Generally one challenge of three is such that people have to rack on their brains to find a solution, however the knowledge of advanced topics is not required.
Other challenges are such that no restraints are put to people's imagination, creativity and fantasy. This means that people are challenged with a quite simple coding problem which encourages to experiment with different ideas, styles, patterns and constructs.
Coding Gym is open to people who don't know how to code just because they can pair off with someone who has some experience.
Some topics/concepts occur in Coding Gym challenges, however many people apply them without knowing their names:
- arrays and sequences
- search problems
- stacks and queues
- dictionaries, hash tables
- binary search
- reduce, zip and a few other functional patterns
Special Coding Gym sessions may be dedicated to special and/or more advanced topics.
Solving a problem is not the end, instead, it's the beginning of several opportunities . This is totally different from classical Competitive Programming that, instead, encourages to code solutions as fast as possible.
Whenever a solution kicks in, the next step is to understand where such solution excels and where it does not.
Solutions hide tradeoffs and may be dependent on the problem constraints. For example, if the problem states that the input is at most 100, the solution is not required to work on 1000. This is a shortcut.
Balancing shortcuts and generalizations is probably the key of software development. So, understanding tradeoffs is a skill to master in software development.
To find and understand compromises, one has to ask good questions and has to play with the requirements (constraints) of the problem.
This part is totally free and driven by experience. There is not a universal checklist to follow. For this reason Coding Gym is prepared by a moderator who is used to solve problems and to think about the answers of many questions in advance. Moreover, the moderator facilitates an open discussion with all the attendees for each problem and anyone is encouraged to join the conversation.
Typical questions are:
- what if constraints change (e.g. the input grows a lot)?
- what if the input gets particular properties (e.g. it is sorted)?
- can you find (and combine) patterns to solve this problem (e.g. fold/reduce)?
- what if the data types change (e.g. big integers)?
- what if some constants of the problem turn into variables?
The moderator may ask some of the questions above to make the retrospective more constructive.
The very first question of the list is about changing constraints. Typical changes consist of:
- making the input very big and very tiny
- removing for loops / use only standard library functions/constructs
- not allocating extra space
- imposing time and space complexity
- changing paradigm (e.g. functional)
- solving the problem in terms of another thing (e.g. design a queue by using two stacks)
- disabling some operations (e.g. integer division)
Coding Gym for soft-skills
Very likely, when you read Coding Gym you only think about coding. That's just the first half of Coding Gym. Coding Gym has been developed as a friendly space for people to improve their soft-skills too (from Wikipedia: Soft skills are a combination of people skills, social skills, communication skills, character traits, attitudes, career attribute, social intelligence and emotional intelligence quotients among others that enable people to navigate their environment, work well with others, perform well, and achieve their goals with complementing hard skills).
First of all, Coding Gym creates an environment for collaboration and active learning with pair programming. People have to work with others so they have to practice effective communication. The trainer could give tips and suggest to do communication exercises during the technical challenge.
Second, since the Coding Gym Retrospective is open, people can freely decide to publicly show and explain solutions. The trainer can do support and give feedback, when needed or explicitly asked by people.
Coding Gym has been developed by Marco Arena while experiencing, for a few years, the benefits of regularly practicing with self-contained Competitive Programming challenges. Marco's focus was, mostly, on experimenting different solutions and variations. Each new solution drove him comparing the solution with the others in terms of tradeoffs, pros and cons, and he noticed that such additional exercise was very often as important as solving the problem itself.
The story begins in 2014 when Marco was introduced to HackerRank by a friend who was, at that time, quitting his job and looking for new opportunities. This guy and Marco started sharing solutions and, sometimes, they worked together to solve more difficult challenges. Discussing compromises, pros and cons of the solutions was mandatory to value their conversations and to prepare this guy to a real programming interview. That's roughly how the Coding Gym Retrospective was devised.
After some time, Marco's friend landed the job he loved and he stopped practicing Competitive Programming regularly. Marco did not. He gradually got more and more committed and he quickly ended up solving a couple of exercises per day. Sometimes, a self-contained problem just took up a free period in his busy day. Some additional value was given by the retrospective. Marco did on its own what his friend and he used to together: understanding compromises, exploring different paradigms, techniques and languages, experimenting with other solution strategies and changing constraints. Marco was not tied to any particular approach or technique. Clearly, Marco knew some effective ways to achieve targets, but this did not imply that new ways couldn't be discovered.
Marco realized he was really benefiting from this approach and freedome, and, in some extent, his professional alter ego was positively influenced as well.
After practicing for about 2 years, at the very beginning of 2016, Marco developed Coding Gym to share this experience with the Community and to let other people know about this way of training.
The very first Coding Gym was organized in Bologna on Feb 16, 2016, hosted at XPUG Bologna. One month later, Marco was introduced to the no-profit association ConoscereLinux in Modena which welcomed this idea and made a computer room available to Coding Gym each month.
Marco has been organizing a monthly Coding Gym in Modena since February 2016.