DEV Community

Fernando Martín Ortiz
Fernando Martín Ortiz

Posted on

This week I learned #1

On these posts, I will list what I learned, or discovered, or reflected about during the last week. I believe that, by doing this, I will learn much better and keep learnings at a good pace. Also, as a byproduct, probably some readers will also learn something from these, or maybe they think I’m wrong and would like to comment something, so we can debate.

In any case, welcome every one.

Life/Work balance:

  • Working from home is amazing, and it’s much more amazing when you can share time with your partner and child. Seeing my baby grow, and being able to spend more time with him is much better than any benefit I could get.

Python:

  • Virtual environments are a mess. It’s much better to use Docker. There is an extension on Visual Studio Code called “Dev Containers”. It’s developed by Microsoft, and lets you run a terminal on a Docker Container, with the content of your VS Code project.

Elixir:

  • GenServer is the default way of handling state in Elixir. A GenServer stands for “Generic Server”, and it’s a process which run an contains a piece of state. You can send messages to that GenServer process by using its process ID (or pid), and mutate that state in a very “functional” way.
  • A module you own should use GenServer to be usable as a GenServer. Think of it as an interface being implemented.
  • If you include your GenServer as an application children, then the module you send to it is started as a process right away when the app starts.

Web Development:

  • Microsoft Azure has a service called Azure Container Apps, in which every app is containerized using Docker. All the apps (you can think of them as microservices) communicate using a Virtual Network (v-net).
  • Microsoft Azure has a language (DSL) called Bicep, which is similar to AWS CloudFoundation, to maintain infrastructure using IaC.
  • DAPR (Distributed Apps Runtime) is an initiative that was started by Microsoft, and nowadays maintained by the Cloud Native Foundation. Using DAPR, you can use the services defined on the standard to communicate with other microservices, handle state (using Redis, for example), add Telemetry, use Pub/Sub mechanisms, and other things. The specs defined in DAPR are like “abstract classes”. There is always an actual “component” which implements the spec. For example, you use the DAPR state management service, but under the hood, you’re using Redis to keep track of key/value pairs for that state.

Artificial Intelligence:

IoT:

  • I’m preparing myself to work on internet of things projects using Nerves.
  • Nerves is a tool written in Elixir for creating IoT applications.
  • You can actually run Nerves project without having an actual device (like a Raspberry pi)! This is called “Host Mode”.

Top comments (0)