Advertisement · 728 × 90

Posts by Marek Szkudelski

Last month I've rewritten some tests in one component. Here is result:

before:
290 tests in cypress (time 06:01)
177 tests in jest (time 23.762s)
= 6:25
after:
154 tests in cypress (time 03:47)
249 tests in jest (time 32.685 s)
= 4:20

#it #programming #softwareEngineering #software #javascript

1 year ago 1 1 1 0

React v19 is finally out with some interesting new hooks.

1 year ago 1 0 0 0
Preview
Do repeat yourself! What is responsibility in code? Did you know that in October this year, DRY principle will celebrate its 25th anniversary? It was proposed by Andrew Hunt and David Thomas in The Pragmatic Programmer book in 1999. 25th birthday is qu...

Balancing Don't Repeat Yourself (DRY) and Single Responsibility Principle (SRP) can be tricky.

Should you merge similar code for DRY or keep it separate for SRP?

Discover insights from my Allegro experience in this blog post:

#it #programming #code #softwareEngineering

1 year ago 2 1 1 0
Post image

Ho Ho Ho 🎅🛷🎄

Domain Driven Design for Frontend Devs - Advent Calendar

Starting 1st Dec,
Each day,
Around 10am CET

a portion of distilled knowledge on practicing #DDDesign

Let your frontend teammates know
Spread the word - thank you 😘

#DDD #aDDDvent

1 year ago 32 12 0 1

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! 🔔

1 year ago 0 0 0 0

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. 💡

1 year ago 0 0 1 0

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. 🛠️

1 year ago 0 0 1 0

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. ⚠️

1 year ago 0 0 1 0

A function that does something shouldn’t return anything. No true or false, no error codes. If something goes wrong – throw an exception.

#CleanCode #Programming #SoftwareEngineering #Code

1 year ago 1 0 1 0

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 :)

1 year ago 0 0 0 0
Advertisement

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.

1 year ago 0 0 1 0

Terminal aliases have been a cornerstone of my productivity for years, especially for tasks like Git or npm commands.

Let me share some insights and tips! 🧵

For example, instead of typing:
git commit -m, I use gc.
git checkout -b becomes gcb.

(link for config instruction below)
#programming #it

1 year ago 2 1 3 0

The flavor of code syntax you personally prefer to use doesn't matter. What matters is having a single, consistent approach across all devs working on a project.

1 year ago 4 1 3 0

Totally agreed! I prefer using eslint/prettier with pre-commit hook to ensure that code on remote repo is consistent.

1 year ago 1 0 0 0

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.

1 year ago 1 0 1 0

yeah, in spring or summer :) Or in deep winter when it's snowing ;)

1 year ago 1 0 1 0

Come to Poland and try to find sun in November :)

1 year ago 1 0 1 0

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.

1 year ago 0 0 1 0
Preview
What is Frontend Architecture? - Tomasz Ducin - blog While working on applications (let it be React, Angular, Vue, pick your favorite one), we make architectural decisions all the time. It's extremely important to be aware of them, i.e. have architectur...

✍️ What is Frontend Architecture?

ducin.dev/what-is-fron...

1 year ago 40 12 3 2
Advertisement

Ok, I'll check that. Thanks for help!

1 year ago 1 0 1 0

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.

1 year ago 0 0 1 0

I tried to use your app, but I've got "Profile not found". Is it because my custom handle?

1 year ago 1 0 1 0

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.

1 year ago 0 0 0 0


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! 😊

1 year ago 0 0 0 0
Preview
GitHub - mszkudelski/aliases: Aliases for oh-my-zsh config. Mostly git commands. Aliases for oh-my-zsh config. Mostly git commands. - mszkudelski/aliases

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.

1 year ago 0 0 1 0

I also use combinations like:

gch master (switch to master branch)
gpl (pull the latest changes)
gch - (return to the previous branch)
gr - (rebase changes)

Together, these make keeping branches up to date seamless.

1 year ago 0 0 1 0

And here’s my favorite:

guc, which executes:

git add .; git commit --no-edit --amend; git push --force-with-lease

This command updates the latest commit with new changes and force-pushes it—ensuring I’ve synced (pulled) everything beforehand.

1 year ago 0 0 1 0
Advertisement

Terminal aliases have been a cornerstone of my productivity for years, especially for tasks like Git or npm commands.

Let me share some insights and tips! 🧵

For example, instead of typing:
git commit -m, I use gc.
git checkout -b becomes gcb.

(link for config instruction below)
#programming #it

1 year ago 2 1 3 0

So you use rebase and commit amend a lot?

1 year ago 0 0 2 0

Yep, some tests were duplicated and I removed them during this refactor. Or they just tested some not important aspect of feature which additionally was already tested by jest.

This refactor was about test optimization in general but also reviewing if every test is necessary.

1 year ago 1 0 0 0