What I’ve learned in Encora Apprentice: Week 12

Irvin Lara Villalobos
3 min readDec 27, 2021

--

Photo by Fotis Fotopoulos on Unsplash

This second week of the open source phase of the apprenticeship, has continued to be a week full of knowledge, good experiences and above all challenges. Finding projects to contribute has been a challenge for me, but finally I ended up finding another JavaScript project with which I could start contributing. In addition to that I have continued to gain different knowledge. Next I will write about what I have learned during the week.

I learned how collections in Java use generics. This offers great benefits when using any of the classes that implement the List interface, such as ArrayList or LinkedList, since they allow to pass any type of data to the list, as long as they are an object. I was also getting to know some of the tools offered by IntelliJ Idea, thanks to this I learned how to select a specific JDK version for a Java project in IntelliJ Idea.

I learned more about how dependency injection works and the benefits of using this principle. The principle of dependency injection is a set of techniques whose main objective is to decrease the coupling of components in a software. They mainly use interfaces instead of direct references to classes, which makes it easier to replace components with ease. I also learned how the Angular framework implemented dependency injection.

I learned about a tool that facilitates test-driven development called Karma. This tool mounts a web server so that the tests can be executed client-side, from any web browser, the test results will be shown to the user through the terminal, which makes it easier for the programmer to find where the error is. For this to work it is necessary to be running a server with NodeJS, since the clients (the browsers) have to connect to a server first.

I learned how Two-way binding works in Angular, which allows us to modify the value of a property in a bidirectional way, so that when we modify the value of a property in the view the value is also updated in the data model. If we change the value of a property with a text box in the view, that value is changed in the view and also in the component, this is very useful.

I learned what an abstract class is in Java, which is practically identical to a conventional class, abstract classes can have attributes, methods, constructors, etc. The main difference between a conventional class and an abstract class is that an abstract class must have at least one abstract method. Using abstract classes is less common, generally it is chosen to use interfaces, since the classes can only inherit from an abstract class, but implement many interfaces.

Contribution to open source

I searched on GitHub for different open source projects that were mainly made in JavaScript. I found one that caught my attention called deltachat-desktop which is an open source project that aims to be an email-based instant messaging for desktop.

I set up the environment, and explored all the code of the project. The project uses Electron technology, which is used to make desktop applications with web technologies such as HTML, JavaScript and CSS. In this project we chose to use TypeScript instead of pure JavaScript. TypeScript is a superset of JavaScript, which essentially adds static types and class-based objects. Since Electron needs JavaScript to work well, all code written in TypeScript is converted to JavaScript code before running the application.

It’s a big project, which is being complicated to understand in its entirety, since I had never used Electron technology before, but little by little I’m getting a better understanding of how it works. I hope this coming week to be able to solve 2 issues that catch my attention.

This is the link of the project: https://github.com/deltachat/deltachat-desktop

Final thoughts

This week was very productive for me, as I was learning quite a few things thanks to the fact that I was doing research on some topics of Open Source projects. I was also able to experience an interview to work with a client at Encora, and it was very rewarding as I was able to measure the knowledge I had so far and the points I had to improve. I hope next week to continue learning many things, while I continue contributing to the Open Source community.

--

--