Sitemap

Good practices in Angular

5 min readMar 10, 2018

--

Why now?

Maybe some of you have read my previous article about “Other way of doing community”. In that article I describe how ngLabs works, the community that I founded last April. Well, as I said in that article, we are following agile methodologies, which means that every so often we have something called “retro”. In the retro we collect the proposals and ideas to improve our events. In general, it also means that attendees choose the theme of a large workshop that should happen before the end of our Sprint. At that time, ngLabs members chose a workshop on good practices in angular projects.

Searching the author

I must confess that at first I did not want to prepare it. The main reason is that where I live, in Munich, I’m still alone … I mean, I still do not have a group of people like ngLabs that I can sit next to, to plan this kind of thing and, In my opinion, a document of good practices is something with enough relevance not to do it alone. It does not mean that I do not know the best practices at Angular, I’ve been doing projects with it since beta 17, so I think I know the framework quite well, but I wanted this task to be done by a group of people to make sure that the result is not the personal opinion of a single developer. Since I do not have a community in Munich, I thought that the other ngLabs experts were in a better position than me to carry out this workshop. I was wrong. For various reasons, all the people I know and could do this workshop had free time problems to finish it before the end of the sprint. Things that happen when you work on Open Software projects. Then there was no other option; I had to do the workshop on my own.

Fortunately, when I said in the community that I was going to take care of the workshop, two volunteers showed up to be my reviewers; Rubén Aguilera and Alfredo de la Calle. Both with extensive experience working with Angular. In the end, I wrote in github each of the good practices in a different branch and Ruben and Alfredo reviewed the text and the code to make sure that what was done in that branch was really a good practice. That way, they could invest time to help me and I was sure that the final outcome of the workshop was not just my personal point of view.

A few weeks later, Oleksandr Fedotov, a boy from Ukraine, whom I met at JavaScript meetings in Munich, joined us to add a fourth opinion to the project.

Of course I will not be the developer who will teach these good practices in ngLabs. I’m in Germany and the ngLabs meetings happen in Madrid. Javier Gamarra will be the one who makes the final act.

In the end, instead of having a project done by a person, we have something done by several people, where each of them puts a little effort into it. None of us could finish that workshop, all together, we were successful. It’s the magic of being part of a community.

The worst Angular app you have ever seen

There is not need to be in Madrid to attend at the workshop to learn good practices. Everyone can do it from his/ her home:

The repository has labels called “steps”. The first step is “step-0” and it contains the most disgusting and horrible Angular application you’ve ever seen, even though the application was created with Angular-cli, it complies with all the lint rules and it works. This is the first lesson, development tools are a good help, but nothing can prevent you from coding a really bad application.

Get Adrian Ferreres’s stories in your inbox

Join Medium for free to get updates from this writer.

What you should do if you want to do the workshop is:

1- Checkout the repository in your local

2- In the github website, go to the step-1

3- Read the explanation of the good practices and the changes made

4- Try to apply this good practices at the code of the step-0

5- Compare your result with the solution in the step-1

6- Repeat this process for the steps 2 to 9

What to do if you think that whole workshop is a big nonsense

As I said, one of my main concerns was that the result of this workshop was a set of my personal opinions instead of a list of objective good practices. Rubén, Alfredo and Olek helped me at that point, but that does not mean that everyone has to agree with what we are teaching in the workshop. If any of you have a different opinion on one of the steps, feel free to tell us. Just write a issue in the github repository to explain why you encode differently and the advantages you get from it. All opinions will be considered and all comments will be answered … I can not say when, but I am sure we will.

Conclusions

I like this project, I enjoyed doing it. It is not a rock project and it is not a motivating challenge, but it was the opportunity to prove what it means to be part of a community of developers. I was able to verify that some people, working together, with a little effort, can create something that, otherwise, can not be done. This is the spirit that drove me to create ngLabs and that, I hope, will lead me to find my place in the software community in Munich.

Thank you very much to everyone who has participated in this project and, for the rest of you, I hope you enjoy it.

--

--

Adrian Ferreres
Adrian Ferreres

Written by Adrian Ferreres

#angular, #javascript, #nodejs, #typescript and #polymer developer