1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

chore: maintenance

This commit is contained in:
Divlo
2021-12-04 15:52:51 +01:00
parent e5f4615f7f
commit 729e540d04
69 changed files with 10182 additions and 18460 deletions

View File

@ -1,5 +1,5 @@
---
title: 'Clean Code 🧼'
title: '🧼 Clean Code'
description: 'What is "Clean Code", what are "Design Patterns", and why is it so important today ? Tips and tricks to make your code more readable and maintainable in the long term.'
isPublished: false
publishedOn: '2021-11-06T22:06:33.818Z'
@ -17,9 +17,9 @@ Even if you know what it is about, this blog post will probably still be useful
A clean code is a code that is **easy** to **read** and easy to **understand**.
But I promise it is not a code that is easy to write, in fact it is really **hard** to **write Clean Code**.
But I promise it is not a code that is easy to write, in fact it is really **hard to write Clean Code**.
We could ask ourselves, what is **easy** to **read** and **easy** to **understand** ?
We could ask ourselves, what is **easy** to **read** and easy to **understand** ?
It depends of many factors, and is somewhat relative to each one of us. The **perfect** Clean code **doesn't exist**, but we can try to be **as perfect as possible**.
@ -171,7 +171,7 @@ We have to keep it as simple as possible, not to implement features that are not
import fs from 'node:fs'
import path from 'node:path'
const createFile = async (name: string) => {
const createFile = async (name: string, isTemporary: boolean = false) => {
if (isTemporary) {
return await fs.promises.writeFile(path.join('temporary', name), '')
}
@ -187,7 +187,7 @@ const createFile = async (name: string) => {
import fs from 'node:fs'
import path from 'node:path'
const createFile = async (name: string, isTemporary: boolean = false) => {
const createFile = async (name: string) => {
await fs.promises.writeFile(name, '')
}
@ -244,7 +244,7 @@ Here we are creating a new variable `isSubscriptionActive` that allows us to avo
## Conclusion
We can't write the perfect clean code understandable by everyone but we can **write code that is as perfect as possible to ease maintaibility** of the code by others developers (and for yourself).
We can't write the perfect clean code understandable by everyone but we can **write code that is as perfect as possible to ease maintaibility** for yourself and others developers.
## Sources

View File

@ -1,8 +1,8 @@
---
title: 'Hello, world! 👋'
title: '👋 Hello, world!'
description: 'First post of the blog, introduction and explanation of how this blog is made.'
isPublished: true
publishedOn: '2021-11-06T22:06:33.818Z'
publishedOn: '2021-10-06T22:06:33.818Z'
---
Hello, world! 👋
@ -15,7 +15,7 @@ The idea is that I will share my knowledge with you (readers), and hopefully hel
Keep in mind that I will not translate the posts in French, all the posts will be written in English, as I'm not a native English speaker, I will probably make mistakes, feel free to open pull requests on [GitHub](https://github.com/Divlo/Divlo) to correct them. 😊
I don't plan to publish new posts regularly, but I will do so when I have something new to share.
I plan to publish new posts when I have something new to share. There's no schedule, so stay tuned!
To stay informed of new blog post and to ask questions, feel free to follow me on Twitter: [@Divlo_FR](https://twitter.com/Divlo_FR).
@ -25,9 +25,9 @@ The blog posts subjects will be often related to the problems I encountered in t
Most of the time, when I am learning something new, I **learn it because I actually need it for a project**, I don't learn [React.js](https://reactjs.org) because it is trending, and everyone talks about it.
I learn it, because it solved a "real life" problem I had encountered. For example, [React.js](https://reactjs.org) allows to easily update the DOM (Document Object Model) in the browser, so we can add interactivity to our web pages, not only that, it allows to reuse multiple HTML (JSX) elements with components.
I learn something new, because it solved a "real life" problem I had encountered. For example, [React.js](https://reactjs.org) allows to easily update the DOM (Document Object Model) in the browser, so we can add interactivity to our web pages, not only that, it allows to reuse multiple HTML (JSX) elements with components.
[React.js](https://reactjs.org) is only a example, but hopefully you understood my point: I often don't like too much theoretical thing, and enjoy much more practical things.
[React.js](https://reactjs.org) is only an example, but hopefully you understood my point: I often don't like too much theoretical thing, and enjoy much more practical things.
## How this blog is made
@ -66,6 +66,6 @@ That not mean that theses features will never be implemented, but to avoid the n
## Conclusion
I hope you will enjoy my blog, and I hope you will find it useful.
I hope you will enjoy my blog, and will find it useful.
See you in the next posts! 😊

View File

@ -0,0 +1,44 @@
---
title: '❌ Mistakes I made as a junior developer'
description: 'Here are mistakes I made when I started, to prevent you from making the same mistakes.'
isPublished: false
publishedOn: '2021-12-06T22:06:33.818Z'
---
Hello! 👋
I will explain some of my mistakes I made as a junior developer, so you can avoid doing them.
## 1. Skipped learning how to do automated tests
Probably one of the most common error junior developers do.
When you begin in programming, you learn a programming language, so you learn variables, conditions, loops, functions, etc.
With these concepts, you might start a new project, thinking that you will be able to do everything.
But as the project grows, you will end up using functions at multiple places in code, so if you change the behavior of a function, it will affect the whole project.
And because the code grows, you might do some refactoring, but because we are humans, we make mistakes, you could accidentally break the whole project even with a tiny change you thought was safe to do.
If you would have automated tests, you would have a way to know if you made a mistake even before deploying to production.
Depending on the programming language you are using, and what is the project you are working on, writing tests will be different.
Be aware that there are 3 main testing strategy:
- [Unit testing](https://en.wikipedia.org/wiki/Unit_testing)
- [Integration testing](https://en.wikipedia.org/wiki/Integration_testing)
- [End-to-end testing](https://en.wikipedia.org/wiki/End-to-end_testing)
After you learnt the basic of programming, learn how to write automated tests, it will save you a lot of time and debugging.
## 2. Thinking too big, with too much abstraction
Abstraction is great, but it can be harder to understand what is going on if actally don't need this abstraction.
Find the right balance, between abstraction and implementation, start simple, and then gradually improve and add more features.
When you start a new project, you should focus on the core of the project, not on the details, to release as soon as possible, a working usable version of your project also called a [**Minimum Viable Product** (MVP)](https://en.wikipedia.org/wiki/Minimum_viable_product).
## 3. Focusing on the thing that don't add value to a project