teleren/devto huggingface dataset:
The important of DRY, KISS, and YAGNI in programming.
Tags: javascript
Published: 2022-04-02 01:22:11

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eum6e1zrwtoknd1s0fhs.jpg)

In this article, I'll go over what `DRY`, `KISS`, and `YAGNI` mean, how to utilize them in best practices to build clean code, and why it's vital to know about them.

**Why is important to make clean code ?**

> Writing clean code is important because it allows you to clearly communicate with the next person who works with what you've written. Being able to return to previously written code and understand what it does is key, especially in the software development world, Where we always need to learn from each others. 

There are some principles that programmers have embraced, independent of the language you are working in. 

## Here are the best ones:

> - `DRY`: Don't repeat yourself! It simply means you should try to avoid having duplicated code. Instead, you should reuse your code when possible. Every piece of knowledge must have a single, unambiguous, authoritative representation within a system (Andrew Hunt & David Thomas, "The Pragmatic Programmer").
> - `KISS`: Keep It Simple, Stupid. No further explanation is needed! Try to avoid unnecessary complexity, don't over-engineer your code. A simple, small, and easy-to understand code base is easier to maintain and scale.
> - `YAGNI`: You Aren't Gonna Need It. Don't add anything you don't strictly need. Try to avoid the temptation of adding the most trendy technologies just because you think they may be useful in the future. Add things gradually, when they are really needed
.

## Additional materials
These are all optional, but if you're interested in exploring this topic further, here are some resources to help you. Any exploration here should be done outside program time.


[higher education program by Martin Clean Code A Handbook of Agile Software](https://www.pearson.com/us/higher-education/program/Martin-Clean-Code-A-Handbook-of-Agile-Software-Craftsmanship/PGM63937.html)
Round the Corner
Tags: opensource
Published: 2022-04-02 01:10:44

With there only being a few weeks left of this semester the end is in sight. We have one more release before our 3.0 release. It's time to start trying to wrap things up and get some final things landed and smoothed out, as opposed to adding a bunch of new features that will in turn add more bugs. 

During our triage meeting this week I had made the suggestion that we cut some issues from the release tracker. This would help us prioritize what needs to get done for 3.0 and what is just a 'nice to have'. We managed to slim down the number of issues in the release by a substantial amount.

As it turns out, most of the issues I had left over are not really that important for 3.0. My focus for the coming weeks will be to help out where I can. I will be doing more reviews, and asking people if they need help.

### The week that was
Even though it was not a necessity for 3.0, I decided to try and finish slimming down our registry images. I felt like I had spent so much time researching this that it would be a shame to have it all go down the drain and for someone else to have to start from scratch next semester.

After a bit more research in the topic however turned up this [open issue](docker-slim/docker-slim#152) in the `docker-slim` repo. 
![buildxSlim](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z336ipk56clqthus065n.png)

Turns out that `docker-slim` cannot be used as the building engine for `buildx` just quite yet. So this issue will have to be put in the backlog until it can be, because using `buildx` is more important than slimming the images. 

[Another issue](https://github.com/Seneca-CDOT/telescope/issues/3306) that was left over to do now that the registry was up and running was to remove the old Github webhooks that we had in the repository. After confirming the location of them I simply clicked the red button and that was another issue taken care of.

![webhooks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q0dpv2lwossslbyegbuj.png)

Lastly, there was [this issue](https://github.com/Seneca-CDOT/telescope/issues/3340) that stemmed from migrating to use our registry based images. We need to update the `gitpod.yaml` to either `build` or `cache-from` like we now do in our `development.yaml`. I made [this PR](https://github.com/Seneca-CDOT/telescope/pull/3371) to address the issue and it is still a work in progress, but I think I am close to getting gitpod back up and running to help facilitate all this reviewing I plan on doing in the coming weeks.
Week of coming back
Published: 2022-04-02 00:30:06

I have been trying to follow everything again lately. Updating general project info, details here and there, meetings. I am glad to have sheriffs this week do a prioritization I wanted to have happened. 

I have signed up for two main tasks for this week. I am trying to not expect much, I but also want to contribute. I know both of these things slow down others' development, so people depend on me delivering. Which sounds important, but feels draining. Either way, I want these improvements to happen, and I will try my best to do them.

## About us preparation
There is an [issue](https://github.com/Seneca-CDOT/telescope/issues/2962) planned to translate the [About us](https://telescope.cdot.systems/about/) page into different languages. Before we can translate it though, we need a final version of the english languaged About us page. I wanted to have some corrections made, since the description of Telescope as it is right now seems outdated and unclear. We cling to the old concept of a Planet, which is true, but is no longer supported. Might as well not define ourselves with it. I still want the Planet stuff to be there as part of history, but the main part has to be rewritten. I plan have a PR ready tomorrow. I have some ideas put in currently, but my brain is too dumb to mold it into a comprehensive and coherent explanation right now.

## Docusaurus landing page CSS tricks
I had an idea for a long time I wanted to explore. I wanted to play around with CSS animations, but I needed a playground. That playground came to be the new [Docusaurus website that conveniently needs a landing page](https://github.com/Seneca-CDOT/telescope/issues/2987). I want to explore what I can do in terms of CSS animations. I have an outline of an SVG I want to make and the movement of a telescope that would follow a cursor. I don't know how difficult it is to do, but I suppose I will find out. Either way, people need a landing page and if I don't make a great one, I will at least end up making some... one.

Just these two. I look at this all, compare to my previous progress and it makes me sad. And even with these "only two" tasks, I can see how I might struggle to do even that. Hopefully, my state of being able to complete things will continue for a long enough time to make some kind of meaningful progress. There's not that much time left. I want to leave something behind. Not just something, a lot, actually.
SOLID - DIP
Tags: solid, beginners, poo, oop
Published: 2022-04-02 00:26:20

**Princípio da inversão de dependência**

> Módulos de alto nível não devem depender de módulos de baixo nível. Ambos devem depender de abstrações; Abstrações não devem depender de detalhes. Detalhes devem depender de abstrações.

Dependa de uma abstração e não de uma implementação.

**Por exemplo:**

Temos uma classe _**Petshop**_ que recebe no seu construtor um _**PetRepositorioMySQL**_ e possui o método **_CadastrarOuAtualizarPet()_** que verifica se o Pet informado já existe e o atualiza e caso contrário, cria um novo cadastro. 

```c#
    public class Petshop
    {
        private readonly PetRepositorioMySQL _petRepositorioMySQL;
        public Petshop()
        {
            _petRepositorioMySQL = new PetRepositorioMySQL();
        }

        public void CadastrarOuAtualizarPet(string nome)
        {
            var pet = _petRepositorioMySQL.Get(nome);

            if (pet == null)
                _petRepositorioMySQL.Insert(pet);
            else
                _petRepositorioMySQL.Update(pet);
        }
    }
```
O problema é que se um dia nós resolvêssemos usar uma _**PetRepositorioSQLServer**_ no lugar da _**PetRepositorioMySQL**_, mesmo as duas possuindo os mesmos metódos, precisaríamos mudar a nossa classe **_Petshop_**. Nossa classe não deveria ter que saber como se instancia este repositório ou como que ele se comporta internamente. Só precisamos saber o que ele recebe e o que retorna. 
Devido a isso, estamos quebrando o princípio da inversão de dependência.

**Solução:**

Criamos a interface _**IRepositorioGenerico**_ e fazemos com que nossa classe _**PetRepositorioMySQL**_ implementa-a. 

```c#
    public class PetRepositorioMySQL : IRepositorioGenerico
    {
        public Pet Get(string nome)
        {
            throw new NotImplementedException();
        }

        public void Insert(Pet pet)
        {
            throw new NotImplementedException();
        }

        public void Update(Pet pet)
        {
            throw new NotImplementedException();
        }
    }
```
Dentro da classe _**Petshop**_, nós injetamos nossa classe _**PetRepositorioMySQL**_ representada pela sua interface _**IRepositorioGenerico**_. 

```c#
    public class Petshop
    {
        private readonly IRepositorioGenerico _repositorio;
        public Petshop(IRepositorioGenerico repositorio)
        {
            _repositorio = repositorio;
        }

        public void CadastrarOuAtualizarPet(string nome)
        {
            var pet = _repositorio.Get(nome);

            if (pet == null)
                _repositorio.Insert(pet);
            else
                _repositorio.Update(pet);
        }
    }
```

Assim a _**Petshop**_ não é obrigada a instanciar o repositório, pois quem consumir esta classe deve passar as instâncias já criadas no construtor dela. E se caso um dia quisermos mudar o repositório, não precisaremos alterar a classe _**PetShop**_, desde que o novo repositório implemente a mesma interface. Desta forma, invertemos o controle.
Can't Uninstall Android Studio in Windows?
Tags: android, beginners
Published: 2022-04-02 00:26:13

**Simplest workaround when "Add and Remove Programs" in Windows doesn't work - can't find "uninstall.exe" in Android Studio program folder.**

It looks like the later version of Android Studio (Arctic Fox or later version), the "uninstall.exe" is missing from the installation. Thus, you have no way to uninstall the Android Studio in Windows if you install it from the installer.

You get the following error when you try to uninstall it.

![How_to_Uninstall_Android_Studio_01.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1643855344431/ZndPthSma.png)

The easiest workaround is getting the older version of `uninstall.exe` and manually copy it to your Android Studio. Then, run uninstall program again.

## 1. Download Android Studio 4.2.2

The latest version of Android Studio that has `uninstall.exe` is version 4.2.2. So we download it from the [archives page](https://developer.android.com/studio/archive). 
- You first need to click "I agree to the terms", then search for version 4.2.2.
- Choose "Windows (64-bit)" zip version

## 2. Manually Copy uninstall.exe
- Open the zip file. At the root folder, copy `uninstall.exe` to your local Android Studio folder.
- Go to windows control panel - "Add and remove programs". Uninstall Android Studio there.
- The error should be gone now.

## Some Thoughts
Because of this missing `uninstall.exe` issue, I'm thinking maybe I shouldn't need to install from the installer at all, although it is recommended way.  It may be a better idea for me to just download the zip directly and copy the installation files manually. 

To uninstall, I can also simply delete the installed folder and other user files manually if needed.

FYI - I have 4 versions of Android Studio now:
![How_to_Uninstall_Android_Studio_02.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1643856631234/LV5s-562L.png)

Since I keep multiple versions of Android Studio, it may be better this way. What do you  think?

---

*Originally published at [https://vtsen.hashnode.dev](https://vtsen.hashnode.dev/cant-uninstall-android-studio-in-windows)*.
Why I'm Open-Sourcing all my .NET SaaS kits in April 2022 (React, Svelte, Vue3, Vue2)
Tags: dotnet, react, vue, svelte
Published: 2022-04-02 00:25:21

---
title: Why I'm Open-Sourcing all my .NET SaaS kits in April 2022 (React, Svelte, Vue3, Vue2)
published: true
description: Why I will open source all my .NET SaaS kits.
tags: dotnet,react,vue,svelte
cover_image: https://yahooder.sirv.com/netcoresaas/blog/open-sourcing-in-april-2022/cover.png
---

## Reason 1: Remix

Not to jump on the bandwagon, but actually, I am. Writing code has never felt this fun. It feels like when I switched from Bootstrap to Tailwind CSS, another bandwagon I've jumped onto (and I'm so glad I did).

So I will now focus on my Remix SaaS kit ([early access with -50% discount](https://alexandromg.gumroad.com/l/SaasFrontends-Remix/early-access?_gl=1*1baxzub*_ga*MTA3NDA3OTM4Ny4xNjQyMzU1ODQ3*_ga_6LJN6D94N6*MTY0ODQ3NDA2Mi42Ni4xLjE2NDg0NzQ4ODcuMA..)).

## Reason 2: Productized Services

I've always wanted to publish my own productized software development service. So if your team likes one of the open-sourced repositories, I could help set up your SaaS MVP, for a monthly fee.

## NetcoreSaas

The first .NET SaaS boilerplate [I published](https://netcoresaas.com) was a .NET + Vue2 stack. Then I easily migrated it to Vue3, then to React, and then to Svelte *([you can read more about this here](https://dev.to/alexandromtzg/launching-saasfrontends-v10-kg))*.

## SaasFrontends

I wanted to make room for non-c# backend frameworks, so I switched from [netcoresaas.com](https://netcoresaas.com/) to [saasfrontends.com](https://saasfrontends.com). This way I could build Vue/React/Svelte frontends, without being tied to .NET. I built the SaasFrontends site using [the non-MIT licensed tailwindcss.com](https://github.com/tailwindlabs/tailwindcss.com/issues/75) repo, I really hope this doesn't get me in trouble 😟.

## To my existing .NET customers

Hopefully, you will now get community support. And if you're interested in the Remix SaaS kit, [contact me](https://saasfrontends.com/docs/support) for a -100% discount.

## When?

I don't want to commit to a certain day or week, but I promise it will be this month.

---


Let me know what you think!
Updates from the 89th TC39 meeting
Tags: javascript
Published: 2022-04-02 00:19:44

There were several items on the agenda, this post focuses on feature proposals and their progress from the meeting that was held between March 28th-31st, 2022.

__Stage 1:__


* [Type Annotations](https://github.com/tc39/proposal-type-annotations): Enable developers to add type annotations.

* [Function once](https://github.com/tc39/proposal-function-once): Standardize `once` function in the language core.

__Stage 2:__

*  [Decorator metadata](https://github.com/tc39/proposal-decorator-metadata): Decorators can associate metadata with the value that is being decorated. (P.S: The repo shall be updated with content.)

__Stage 3:__

* [RegExp set notation + properties of strings](https://github.com/tc39/proposal-regexp-set-notation): extend the syntax for character classes to add support for set difference/subtraction, set intersection, and nested character classes.

* [Change array by copy](https://github.com/tc39/proposal-change-array-by-copy): Provides additional methods on `Array.prototype` and `TypedArray.prototype` to enable changes on the array by returning a new copy of it with the change.

* [Decorators (sans metadata)](https://github.com/tc39/proposal-decorators): Functions called on classes, class elements, or other JavaScript syntax forms during definition.



<hr/>

<center>[@gnumanth](https://twitter.com/gnumanth)</center>
Amazing Surprise to Bezos
Tags: amazon, union, worker
Published: 2022-04-02 00:16:05


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kv93rxoycm34hjsv63f7.jpg)

While Jeff Bezos and his brothers were flooding in the space, Amazon workers were busy organizing the union on the ground. Upon his return, the mighty workers solidified the union and greeted their boss with overwhelming joy. All brains of Karl Marx were rewarded with drinks paid by Bezos. What a happy ending for both Bezos and workers. #jeffbezos #amazonworkers #peoplepower
So do you expect me to write a blank check?
Tags: agile, noestimates, estimation, business
Published: 2022-09-25 09:55:07

---
title: So do you expect me to write a blank check?
published: true
date: 2022-04-02 00:00:00 UTC
tags: agile,noestimates,estimation,business
canonical_url: https://jhall.io/archive/2022/04/02/so-do-you-expect-me-to-write-a-blank-check/
---

[![Why do we need to estimate this?](https://jhall.io/images/cartoons/2_huc7b35a9fcc15a15e7d4de2547caad8c2_55575_600x0_resize_q85_box_3.png)](https://jhall.io/images/cartoons/2.png)

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Apuntes de React (Parte 1)
Published: 2022-04-01 23:59:01

# Primeros pasos en React

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s2d1uw18eu9gkl0cvx3g.gif)
****Temas puntuales de la sección****

- Nuestra primera aplicación - Hola Mundo
- Exposiciones sobre los componentes
- Creación de componentes (Functional Components)
- Propiedades - Props
- Impresiones en el HTML
- PropTypes
- DefaultProps
- Introducción general a los Hooks
- useState

# ¿Qué son los componentes?

**Componente** es una pequeña pieza de código encapsulada, reutilizable, que puede tener Estado o no.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8rjln6xj8nt1rsysemox.png)

Todos los cuadros son componentes. Un componente es una pequeña pieza de código encapsulada que realiza un trabajo en específico

---

**¿Qué es eso del Estado?**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmzv784d22hkndm5d2jl.png)

Enfoquémonos en ese cuadro verde, ese componente que va a ser un formulario cuando es mostrado o renderizado. La primera vez tiene un estado inicial. Ese estado inicial es cómo se encuentra la información de ese componente. La primera vez, cuando se abre

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljc6gjo28qyooi7gkqz5.png)
 

ese estado, podríamos verlo como que el nombre, apellido, edad no tienen ningún valor. Por consecuencia, el componente despliega esta información en pantalla, pero eventualmente nuestro usuario empieza a escribir, hace modificaciones y ahora tenemos ya nuestro formulario con valores. Cada vez que el usuario tocó una tecla y nosotros cambiamos el HTML por decirlo así, o mostramos la información en pantalla eso cambia el estado.

Entonces, en pocas palabras, quiero que pensemos que el 

**Estado** es cómo se encuentra la información del componente en un punto determinado del tiempo.
Diferenças entre escopos no JavaScript
Published: 2022-04-01 23:46:10

Quando programamos em qualquer linguagem é importante entender conceitos da linguagem.  Neste texto vou trazer de forma breve o conceito de escopos na linguagem Javascript. 

### O que são escopos?

Escopos diz respeito aos limites que permitem que uma variável pode ser acessada dentro do código. Ou seja, quem poderá acessar o seu conteúdo para ler ou alterar. 

No Javascript temos dois escopos: o escopo global e o escopo local. 

Grosso modo, o escopo global é relativo a todo o código, tem a sua acessibilidade a todo o fluxo de código, incluindo quando dentro de alguma função.

 Enquanto o escopo local é aquele declarando dentro de uma função. O limite de sua acessibilidade se restringe ao contexto “{}” da função no qual foi declarado. 

Vejamos um exemplo: 

```jsx
var nome = "Charles"

function obterIdade() {
    var idade = 25
}

console.log(nome) // Charles
console.log(idade) // ReferenceError: idade is not defined
```

A variável *nome* está no escopo global e a variável *idade* está no escopo local da função “*obterIdade*”. 

Quando tentamos exibir o conteúdo delas, *nome* é exibida normalmente, porém, para *idade,* é retornando um erro de referência. Acusa-se que *idade* não foi definida. 

Este erro acontece porque a variável *idade* foi definida no escopo local da função “*obterIdade*”, nesse contexto ela só pode ser acessada dentro do domínio local dessa função. É uma limitação à acessibilidade da variável em ralação ao código.

Vejamos um outro exemplo, em que observamos a acessibilidade de uma variável declarada no escopo local por uma função. 

```jsx
var nome = "Charles"

function obterIdade() {
    var idade = 25
    console.log(nome) // Charles
    console.log(idade) // 25
}

obterIdade()
```

No exemplo acima é chamada a função *“obterIdade”* para que seja exibido o conteúdo das variáveis *nome* e *idade.* Nesse exemplo, a variável *nome* é impresso mesmo que declarada fora do escopo da função em que se encontra. 

Isso acontece, porque ela foi declarada no escopo local, que permite que a variável seja acessada quando no âmbito do escopo global ou local de alguma função. 

Assim, quando dizemos que a variável está declarada no escopo global, significa que sua acessibilidade é para todo o código. E quando referimos ao escopo local, é que ela só acessível no contexto da função que está localizada.  

Compreender o conceito de escopos é importante, pois permite tenhamos conhecimento da capacidade de acesso, mutabilidade e o controle sobre código que estamos escrevendo.

Nota que aqui me restringi apenas a tratar sobre escopos na linguagem Javascript, não me adentrei na explicação de *var*, *let* e *const*. Em outro momento explicarei as diferenças entre essas formas de declarar uma variável, bem como o processo de *hoisting*.
Fun interactivity using react-stars!
Published: 2022-04-01 22:47:59

While working on my Phase-2 Flatiron Project, I stumbled upon this super useful react component called [react-stars](https://github.com/ertanhasani/react-stars).


![react-stars](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4qhky061o49hppmbw8bg.gif)

This is an incredibly straightforward, flexible, and powerful component used for star rating systems. Check out the demo [here](https://codesandbox.io/s/elegant-mountain-w3ngk?file=/src/App.js)!

#### Don't like boring old stars? 
-stars allows you to completely customize the rating characters, using either:

 A `string`;


![different characters](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5cenb5tlzf7ullb9yoj.png)

Or an html element! 


![pixel star image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7v6zowhkn0n4hxau89sk.gif)

Don't be afraid to get creative with it!


![gif image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ik79x6phv6hvpp5q55z5.gif)

But lest you think this can only be used for ratings...

#### Mini Games!
Here's a simple game I put together using react-stars


![select the num](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y7mp0054vvg7lspa1311.gif)

Checkout the [github](https://github.com/ertanhasani/react-stars) page for more information, including a [README](https://github.com/ertanhasani/react-stars#readme) on how to begin using react-stars to take your react project to the new level!