DEV Community

Cover image for 42 Piscine - Overcoming Challenges
Lara
Lara

Posted on • Edited on

42 Piscine - Overcoming Challenges

This post is a continuation of my personal experiences during the 42 Piscine. I will describe rush evaluations and the topic of dealing with failure and learning to grow from it. Do you want to know more about the 42 School and their piscine program? I recommend first reading my previous post.

How Rush Evaluations Work

Let's continue from where my last post ended, which concluded with the completion of the first Rush project. Over the course of the 4 weeks, there were three Rushes (team projects) we could sign up for. Rushes took place during the weekends. The Rush projects were evaluated by the coding standard tool Norminette, and additionally tested and evaluated by Grizzlies (42 Students). The in-person evaluations with Grizzlies were held on Tuesdays. On the first Tuesday, we had our first evaluation and sat down a Grizzly to review our projects. The evaluation was based on the following factors:

  • Code runs correctly
  • Various tests
  • Norminette
  • The team member who explained the code the worst

Yes, really, I’m not joking. The purpose behind this type of evaluation is that encourage accountability, teamwork, and communication. These are all important aspects of both learning and professional coding environments that we will be faced with. 42 wants to ensure that we focus on these skills.

Our evaluation lasted an hour. As mentioned, the program was tested for correctness and functionality. Then each team member had to individually explain the codebase and what we had done. Each of us explained the code with our own logic, and it was fascinating for me to observe (we could have simply copied or adapted what the others said). But no, we all had the same code in front of us, yet each of us interpreted and explained the algorithm in our own unique way. This highlighted something I’ve noticed about software development: there are often, or even always, multiple valid ways to approach building a program, and everyone seems to have their own method of problem-solving. This brings a lot of creativity into coding and allows you to see the code from different perspectives. That's something I really enjoy about coding. Lastly, our code was checked by Norminette, the coding standard tool. It was validated! YAY, we passed the Rush project. This was a great accomplishment we achieved as a team.

From Tuesday until Thursday, my focus for the week was learning how to deal with pointers and string manipulations. I had to prepare for the second exam on Friday, and my expectations were somewhat higher since I had passed the first one.

After Ups can come Downs - the Beauty of Failing

42 designed the piscine in a way that can make some tasks and exams feel nearly impossible to pass. There's a beautiful thought behind this design: 42 encourages failures and setbacks and wants to see how individuals handle them. The school emphasizes the importance of resilience, problem-solving, and adaptability, all of which are crucial in a professional coding environment. I faced failure during and after the second exam—more specifically, the first task. During my second exam I spent two hours on the first task and couldn't identify the issue, which turned out to be a problem with allocating too many bytes. Ironically, my first exam had been a success. Maybe, this is also why this one hurt even more. A saying that resonates with my experience of failing at a somewhat "simple" error is:

Quote

This was exactly what happened to me. 😭

Growth that comes from Failure

Here’s what I am learning from this experience:

  • Attention to Detail: It’s crucial to carefully review all parts of your code, not just the complex sections. Sometimes, what seems obvious for our eyes can be misleading, and the computer may interpret things differently.
  • The Value of Testing: Test your code thoroughly and understand the traces and error files. I didn’t test my code as good as I could have.
  • Peer-to-Peer Learning: The value of peer-to-peer learning cannot be overstated. If you’re stuck on an error, take a break or get a fresh eyes from a peer. This can help identify mistakes you might have missed. Disclaimer: Obviously not possible during exam ^^.
  • Incremental Development: Incremental development involves building and testing code in small steps. This approach helps catch and fix errors early. For instance, I could have built a script that uses a while loop to iterate over each character, including the newline, which could have avoided the need for manually allocating the string size.
  • Learning and Growth: Each failure is an opportunity to grow your problem-solving skills and improve coding practises.

Let's Talk a bit About the Code

Disclaimer, as we are not allowed to share internal information like exam tasks I adjusted the exam task below. The task: Write a program to displays a string followed by a newline. Allowed function are write.

write(1, "42 Berlin\n", 10);

A write function is also called a system function. It makes a call to the system to write something on the standard output or also known as terminal. A write function consist out of three components:

  • The file descriptor, 1 for stdout (standard output).
  • The memory address or my case a hardcoded string "42 Berlin\n". Can't recommend this approach.
  • The length of the string including white spaces and the \n (new line) at the end.

As the string is hardcoded, I had to define the string size (length of the string). If the length is wrongly hardcoded the computer adds garbage data at the end of the string. In my case, the program output one byte more than the actual length of the string, causing my binary output file to differ from the examshell's. ERROR.

C is teaching you extremely well that ignoring explicit memory access allocation can lead to unpredictable results and unsafe memory access. A safer and more professional option solving this task as mentioned above would have been with a while loop. Declaring a variable that holds the string and looping through the string until it reaches the NULL terminator.

Failure is part of the journey of learning and growing, and while it definitely hurts, it also provides important lessons. I am currently learning to grow from these lessons and accept failure. As I am finalising my last lines, I am reminded that writing helps me in a way to process those experiences and understand what I can learn from them.

Join me on this coding journey as I continue to learn.

👾 Original post on my own blog

Top comments (0)