Marek Szkudelski
szkudelski.dev
Marek Szkudelski
@szkudelski.dev
Frontend Software Engineer @ Allegro 🍊

blog.szkudelski.dev 🇵🇱

#it #programming #softwareEngineering #frontend
For example, consider a function saveUser that returns a boolean indicating success. Its description might be: “It saves a user to the database and returns the status.” Everything after "and" shouldn't belong in the function.

Want more Clean Code tips? ➡️ Follow me! 🔔
November 29, 2024 at 12:31 PM
Separating responsibilities simplifies your code, and simplicity always wins. This makes your code easier to read, test, and maintain. 🧩

Ask yourself: can you describe what your function does in one sentence, without using “and also”? If not, it’s time to simplify. Less is more in clean code. 💡
November 29, 2024 at 12:31 PM
Error handling is a separate responsibility, and a function should do exactly one thing.

That’s why it’s worth moving try/catch blocks into separate functions.

❇️ The "main path" of your code stays clean, focusing on the function's goal.
❇️ Error handling is clear, separate from business logic. 🛠️
November 29, 2024 at 12:31 PM
Why? Because a returned false or an error code can easily be overlooked. All it takes is someone forgetting to check the return value – and even the best developers make that mistake. 🆘

An exception, on the other hand, cannot be ignored – it will stop the program and clearly indicate the problem. ⚠️
November 29, 2024 at 12:31 PM
For example, add aliases for git add, commit and push. It'll speed up your work already.

If you'd like to start with my config, you can fork my repo and change only aliases.txt file and setup zsh.

Or you can start configuring by yourself :)
November 29, 2024 at 8:30 AM
You can use only someone else's (for example my ;) ) configuration and add your own aliases.

You could also start from a few most common command you use on daily basis. Adapt them and then think about adding more.
November 29, 2024 at 8:30 AM
Totally agreed! I prefer using eslint/prettier with pre-commit hook to ensure that code on remote repo is consistent.
November 28, 2024 at 11:36 AM
50 shades of gray :) Sometimes there is sun, but I work then.
When my kids will grow up a little bit I plan to go somewhere warm every fall/winter.
November 28, 2024 at 9:14 AM
yeah, in spring or summer :) Or in deep winter when it's snowing ;)
November 28, 2024 at 9:06 AM
Come to Poland and try to find sun in November :)
November 28, 2024 at 7:48 AM
Nice :) I wish I have such discipline to do so. But I use commit amend a lot to avoid commits like "fix typo". Sometimes I use cherry pick to split Pull Request into smaller ones.
November 28, 2024 at 7:46 AM
Ok, I'll check that. Thanks for help!
November 27, 2024 at 10:02 AM
I don't but I've been thinking about it lately. I plan to add time-blocks to my calendar just for myself to focus on current task. I believe it could be useful in time I have multiple project/tasks to tackle with.
November 27, 2024 at 9:57 AM
I tried to use your app, but I've got "Profile not found". Is it because my custom handle?
November 27, 2024 at 9:53 AM
I've heard Raycast is great, but unfortunately I can't install that software on my work laptop :/ But I use some custom basic snippets in my IDE. For example, for creating component.
November 27, 2024 at 9:22 AM

The repository includes a step-by-step guide to help you configure and create your own aliases effortlessly. Start saving time and streamline your workflow—you’ll thank yourself! 😊
November 27, 2024 at 8:01 AM
What about portability?

I sync all my aliases between personal and work devices using a remote repository: github.com/mszkudelski/...

This ensures I can apply updates across devices with a single terminal command.
GitHub - mszkudelski/aliases: Aliases for oh-my-zsh config. Mostly git commands.
Aliases for oh-my-zsh config. Mostly git commands. - mszkudelski/aliases
github.com
November 27, 2024 at 8:01 AM