Codemotion is currently networking with its community using on-line tools, in line with the present need for social distancing. It’s a good chance to fine-tune old and new communication instruments and procedures to better serve the audience.
A series of newly-minted meetups have taken place during this period inside the #Aperitech framework. “My worst error as a programmer” was the first in this series, exploring the whole coding error lifecycle. The #Aperitech format includes three elements: Q&A with guests, multiple-choice questions with the audience, and a few document reviews.
Juna Salviati, Alessio Biancalana, Davide Di Pumpo, and Davide Cerbo are hosted by Giulio Santoli, Cloud Architect at Poste Italiane, with a very long history at both IBM and Microsoft.
What is a coding error?
The first rule of any discussion is to agree on the subject of the talk. All attendees were asked to give their own definition of ‘coding error’.
“The error is the driving engine of experience“, states Juna Salviati, an Italian full-stack developer with a passion for communities. She refers to ‘Going Postal’, a novel by Terry Pratchett in which the idea of “going mental” is explored within the framework of the post office of a fictional land. According to Juna, this mental state provides “the ‘a-ha!’ moment when looking for counter-measures”.
“The most dangerous error is the logical error“, explains Davide Di Pumpo; “you can make this mistake for many different reasons, from your biases to wrong specifications”. These are big risks to manage, as we’ll see later on.
“Errors are a reminder to always stay focused”, underlines Davide Cerbo, a Senior Software Engineer at Alfresco.
A rule by any other name
Alessio Biancalana breaks the first rule and looks at the answers from the audience. “Programming means never having to say I’m sorry”, suggests an answer from Arnaldo Morena, a Codemotion ‘frequent flyer’. This modified quote from the movie ‘Love Story’ (1970) sweetly depicts the essence of coding in an idealistic world.
After talking about the suggestions offered, the audience finally gave top marks to “The second time is a mistake, the first time is a learning opportunity” – a great truth hidden in the quote’s flippant tone. The quote that took second place is much more fun; as Oscar Wilde would have it, “Experience is the name people give to mistakes”.
Returning to the serious answers: “Programming errors are not only a beginner’s problem”, summarises Alessio Biancalana, a Front-end Software Craftsman at Hootsuite; “they can occur in any phase of your career, in different ways”.
Techniques for better development exist. “We use the Filewise approach”, Alessio reports. “We sometimes have a five-person meeting to ask everybody what worked and what didn’t. Sometimes the remedies are very hard!”.
From the process to the framework
The second question fishes in the procedural pond. What is the cause of the error? The process, the language, the tools, the framework, something else?
Giulio Santoli points to two main issues: working in emergency conditions, and testing improperly. An expert‘s explanation deserves some time to be digested.
“You can never write good code, nor test it properly if you don’t understand the problem in depth”, states Davide Di Pumpo. A designer who moved to coding due to disappointment in the work of classical developers, he knows what he’s talking about. Tools and frameworks divide the risk, of course, but “to write good code you have to fly high”, expounds Juna Salviati, “but up there the sky is clear, and you see nobody that can help you!”
“Understanding all the specifications is always a communication problem“, is Di Pumpo’s response. “You have to understand and accept the given task before starting to code; you have to be convinced that task is well thought through, otherwise you’ll never write good code”.
Mistakes often take root deep inside us, so we don’t like to acknowledge them. Computer geeks fear the related consequences and worry about how to anticipate such errors: a tech nerd’s version of imposter syndrome!
Your best code is the one you never wrote
The second part of the question is addressed by Davide Cerbo. “Modern languages help reduce mistakes in your code. Most notably, they reduce the written code, because the least wrong code is the one you never wrote”. Moreover, it’s very difficult to cut code once it has been written.
The interpreted-compiled dilemma is easily solved when you work in large teams. You can be undisciplined with Java, for example, but JavaScript does not allow you to misbehave, so you have to be very disciplined”.
Alessio Biancalana adds something that is very important to your coding strategy. “You have to take the best possible care both when you start the project and in the consolidation time”, he says, underlining that it’s not a cost problem. “These are indeed the best moments to allow newbies to give their best to the project” he adds: management assumes a lot of responsibility if they don’t take this step correctly.
“With great power comes great responsibility”, adds Giulio Santoli with a smile, quoting the famous maxim from the superhero works of Stan Lee.
Davide Cerbo has international experience and brings this to the conversation. “Emergency is a matter of interpretation” and the meaning varies by geographical location: “you start in an emergency when you develop in Italy, but you have the same sense if you are late when you work abroad”. Raise your hand if you have never felt like this!
Alessio Biancalana also speaks from experience. “The Type Systems set of rules has not been made to prevent mistakes”, he says, laughing. “These rules occasionally meet this goal, but it’s not their primary goal“, partly because this is essentially impossible. “You can make formal mistakes even with Askel, the most conscious programming language for anything to do with runtime options.”
A DevOps scrum
A Waterfall vs. Scrum/Agile match must arise as part of this kind of conversation, and here comes Giulio Santoli to lead the clash!
“The number of mistakes stays the same, more or less”, asserts Alessio Biancalana. “Errors are smaller and span narrower code sections in scrum-based development”.
Professional skills will help enormously – being a full-stack developer or using DevOps techniques challenges you to think on multiple competing planes at the same time.
“The role of communities is really important in opening your mind, in parallel planes especially”, affirms Juna Salviati, who is deeply involved in communities such as the GDG and Women&Tech branches in Rome.
Biancalana, an Apache Foundation Committer, brings his extensive experience to the table once more: “Common sense, as opposed to integralism, is always the key, also in software developing.” Methodologies and ceremonies need to be adapted carefully to every team, otherwise, failure is just around the corner.
The Ring of Gyges
Writing code, a developer builds something that wasn’t there before. The code often contains mistakes, and this load is always on the developer‘s shoulders.
“We are always ashamed of the code we write because there is always a hidden mistake in it”: Alessio Biancalana suggests a new version of imposter syndrome (“Are you really able to do this?”). Sometimes developers would like to wear Gyges’ ring, a treasure that – according to Plato – gave its wearer full (stack) invisibility, allowing misbehavior and safety in making errors. Plato spoke to all humans – including developers!