Marek Szkudelski's Avatar

Marek Szkudelski

@szkudelski.dev.bsky.social

Frontend Software Engineer @ Allegro 🍊 blog.szkudelski.dev πŸ‡΅πŸ‡± #it #programming #softwareEngineering #frontend

188 Followers  |  241 Following  |  34 Posts  |  Joined: 20.11.2024  |  2.0533

Latest posts by szkudelski.dev on Bluesky

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

26.11.2024 12:42 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

React v19 is finally out with some interesting new hooks.

05.12.2024 19:54 β€” πŸ‘ 0    πŸ” 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

25.11.2024 18:39 β€” πŸ‘ 1    πŸ” 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

29.11.2024 22:17 β€” πŸ‘ 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! πŸ””

29.11.2024 12:31 β€” πŸ‘ 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. πŸ’‘

29.11.2024 12:31 β€” πŸ‘ 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. πŸ› οΈ

29.11.2024 12:31 β€” πŸ‘ 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. ⚠️

29.11.2024 12:31 β€” πŸ‘ 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

29.11.2024 12:31 β€” πŸ‘ 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 :)

29.11.2024 08:30 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

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.

29.11.2024 08:30 β€” πŸ‘ 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

27.11.2024 08:01 β€” πŸ‘ 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.

27.11.2024 20:55 β€” πŸ‘ 4    πŸ” 1    πŸ’¬ 3    πŸ“Œ 0

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

28.11.2024 11:36 β€” πŸ‘ 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.

28.11.2024 09:14 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

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

28.11.2024 09:06 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

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

28.11.2024 07:48 β€” πŸ‘ 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.

28.11.2024 07:46 β€” πŸ‘ 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...

27.11.2024 16:37 β€” πŸ‘ 40    πŸ” 12    πŸ’¬ 3    πŸ“Œ 2

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

27.11.2024 10:02 β€” πŸ‘ 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.

27.11.2024 09:57 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

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

27.11.2024 09:53 β€” πŸ‘ 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.

27.11.2024 09:22 β€” πŸ‘ 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! 😊

27.11.2024 08:01 β€” πŸ‘ 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.

27.11.2024 08:01 β€” πŸ‘ 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.

27.11.2024 08:01 β€” πŸ‘ 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.

27.11.2024 08:01 β€” πŸ‘ 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

27.11.2024 08:01 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 3    πŸ“Œ 0

So you use rebase and commit amend a lot?

26.11.2024 19:49 β€” πŸ‘ 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.

26.11.2024 16:25 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@szkudelski.dev is following 20 prominent accounts