Good dev knows
2.54K subscribers
13 photos
6 videos
136 links
Everything what the good dev shall know. Stories, hard skills, soft skills. Regularly.

Instagram: https://www.instagram.com/gooddevknows/

Questions: @PavloPoliakov
Download Telegram
Which content format in this channel would you prefer?
Anonymous Poll
21%
Many topics in one digest, once a week
79%
One topic = one post, several times a week
πŸŽ₯ Building a military brigade or an engineering team β€” is it that different?

This Monday, sergeant Markus, quite known person from Ukrainian military, has released his talk on the topic of "Desertion".

Well, it's named this way, but what it really is β€” it's a talk on the topic how teams are built and the role of the leader. He starts from the question β€” which reasons might be there, so that soldiers leave their position? And, from his perspective, there is only one main reason β€” bad work of their leader (sergeant in army terms). Bad work, because they were not able to build an effective motivated team β€” their troop. While the rules of building a motivated troop are almost the same, as building a motivated team in your IT company.

Then he goes over the principles of the new formation, which they are building β€” 47 brigade. First and foremost one is the continuous learning. They expect everyone from the brigade to learn and keep learning. And it's the leadership task to make this possible. Leaders shall be a role model for their subordinates.

He firmly says, that they do not want people with the "victim" mindset in their brigade. Good thing that this mindset is not a curse and in good environment one may change that. So they try to create such environment using different tools.

They start to create a Myth around their brigade β€” special chevrons, legend of the mountain Magura, their own rituals like climbing that mountain. All of this will eventually help to build a strong team spirit within the brigade, even if it sounds awkward from the beginning. But the more people do that β€” the less questions others will ask and the more they will believe.

They also integrate simple cognitive behavioral therapy principles into their day-to-day life. For example, they prohibit to call something "a problem", but suggest calling it "a challenge". You are even allowed to correct your leader, if they use this word. Also, at the end of the day each sergeant shall ask their subordinates β€” what did you do today on your way to Magura? In other words β€” what was your achievement today?

This talk gives a perfect perspective that effectiveness of the group depends on the mindset. They try to apply the same principles which we know and execute in the IT environment in our attempts to build lasting organisations.

I'm curious how would this work in army, which is definitely different from IT. But I expect it will work, it definitely will make things better comparing to the setup where these practices are not applied.

The talk is in πŸ‡ΊπŸ‡¦. Have you watched it? What do you think?
πŸ›  Useful tools

The life of a modern developer is often a task of moving JSONs from the place A to place B. Sometimes you do it between your own services, sometimes you need to integrate 3rd party services into your workload.

Let's see what can help you quickly test if integration works without deploying your software. Here are the tools that are helping me.

1️⃣ ngrok

In case you have something locally and want to expose it online. Then you can do the following:

ngrok http 8080 --subdomain=my-awesome-project

and in seconds, your app will be available under https://my-awesome-project.eu.ngrok.io. You can use that endpoint as long as both your app and ngrok process are up.

2️⃣ webhook.site

In case you do not have an actual app, but still want to test what would happen if X sends you that JSON.

Just open the website, and it will give you the unique url. Then do:
curl -X POST https://webhook.site/8f965f86-869f-4c79-aeda-1e96fffd18f4 \
-H 'Content-Type: application/json' \
-d '{"login":"good","password":"dev"}'

And you will see this request in the browser.

3️⃣ Insomnia

I remember the times, when Postman was a thing. Many people continue to use it. To me it's cumbersome. So I switched to Insomnia and use it for basic cases.

⬛️ Do you know the tools alike? Please, share them in the comments.
πŸŽ₯ The Dropout

This week I started to watch a TV series "The Dropout". The one which tells us the story of Elizabeth Holmes and her company Theranos. So far I like it.

What did I know about Theranos before watching this series?
1. They wanted to do a rich health analysis at home using just one drop of the patient's blood.
2. They WANTED, but they never figured out how to do that. So they cheated to get more investments.

In the 2nd episode it was shown HOW they've cheated. The creators of the series have shown the code on the screen. Let's examine it (see attached picture).

So what the code does? They've just commented out any actual calculations and returned a result from the file. That's a high level overview.

🐞 BUT
1. The file extension is .dbk and it seems it's a Sony Ericsson Mobile Phone Backup File
2. The editor β€” VEX. The only thing I found is Vex (A Visual Editor for XML)
3. The code itself. Serial.begin and Serial.println tell us that this is an Arduino code.
4. raise_eception("ERROR") has a typo
5. They load a file using the Windows path

Now let's speculate on their engineering culture β€” I bet they were bad with DORA metrics.

⬛️ Have you watched it?
✍️ Writing skills

Writing skills are one of the most underestimated skills for a software developer. We are often comfortable thinking that we are paid for the software we produce, but this is not the right answer. We are paid for the problems that we solve. And with good writing skills it's easier to solve issues.

I remember once I wrote to my manager a mail, where I asked their approval for the conference visit. What did they answer? Well, they've approved it, but they started their answer with some advice. "Pavel, executive managers have not that much time, so when you want something from them β€” use the pyramid principle. Start from the solution which you suggest and then explain why exactly you think this is what shall be done". Well, this was not the best form of communication, but the advice was good, so I started to use it.

When we write the text, we first need to answer the question, "What is the purpose of this message β€” what do I want to achieve?". Then formulate your text or message in such a way, that for the person who reads it, it's easier to do what you want them to do β€” always try to remove the cognitive load.

⬛️ There are many tricks we can use when we communicate via text. Texts are a great form of communication.
🌟 Phase II

I continue to watch The Dropout and got another post inspiration idea from there. So Theranos needs to launch a project in September, but their product is far from being ready. What do they do? Elisabeth decides to start the project, do blood analysis using the Siemens device, and call it Phase I. Which assumes that the product of Theranos will still be eventually built, but it will be the Phase II.

Phase II is a magical place, which we also often use in software development. You work on the feature or a project and by doing that, you and your team often see areas for improvement. You can add more automation, make a better UX, prepare your project for scaling, etc. All these ideas are good, but this impacts our scope. The scope gets bigger, and that delays the project's launch.

Good dev knows, that it's more important to launch the project and start measuring whether our idea was right or not, than delay the product launch in favor of perfectionism.

Phase II trick allows you to deliver faster. If your team has ideas that are good, but you think that current scope will already help customer or business, suggest them to put these ideas to the epic called "Phase II". This decreases the cognitive load and keeps everyone happy.

⬛️ Our job is to deliver, not "work". There are always more ideas, than resources which our team has. Postpone non critical stuff for later. Later, you will have time to reevaluate these ideas, and, what is also important, you will have more information, that allows you to assess their impact better.
πŸ€– How much do you trust your robots?

Recently, I had to contribute to the project, namely a node module, that belongs to the other team. I did what I wanted, asked my peer to review, and then he merged. I asked, "Can you, please, release it? Or how shall I do this?". His answer was, "You don't need to, it will be released automatically".

The gist is, that their project setup is done in a way, that each merge to the main trunk (main branch in their case) might be released through the CI step.

Ok, this is not new. Everyone releases using CI. But in their case, they use the semantic release tool. This tool analyses commits, understands which release is it going to be (major, minor, patch), updates the CHANGELOG.md based on the commit messages and then does two things β€” releases the module and pushes back changes to the repository.

I need to say that I liked what I saw. Before this point, I was rejecting the idea that CI has the right to write into my repositories. Now I might change my mind.

Yes, CI can break your repo or git history, but so can I or my colleagues. But if CI does release, this may remove another portion of the cognitive load from the developer and also force the team to write clear commit messages in the unified format.

⬛️ Perhaps it's time to let CI write into your projects. Let's run the questionary, maybe most of you are already doing that.
Does your CI pushes into the project's repository? (any project where you contribute)
Anonymous Poll
40%
Yes, it does
60%
No, it does NOT
πŸ€– Proxies that help

Sometimes during the development process we have to work with other applications. And, from first sight, these applications are a black box. We do not know what they do. How do they interact with the world? There are tools to help.

1️⃣ mitmproxy

Once, when I was working on integrating the WebView into the iOS app, I needed to see if the WebView called a specific url. Since everything was happening on the phone, it was not trivial.

Luckily, I remembered that I'd heard about mitmproxy (MITM is man in the middle). mitmproxy is a proxy that you can insert between the thing that makes the request and the thing that it calls.

So in my case, I ran it on my local machine, configured my iPhone to use the internet through this proxy and then I was able to see all the requests that my iPhone made to the external resources. This way I tracked, that my WebView calls what I want it to call βœ….

It's also very handy for reverse engineering. Just install it, run any app, and see which requests it makes. You can explore the API or even find a vulnerability.

2️⃣ proxyman

Another tool, which I discovered only recently, is proxyman. This is a Mac app with a very nice UX, that shows you which calls are done by the software on your machine.

⬛️ Proxies may allow us to observe what does the software do without intruding it. What are your use cases?
βš™οΈ Test Driven Development

Test Driven Development, or TDD. Have you heard of it? Yes, I believe so. Do you practice it? No, I believe. I don't either. Usually I write tests AFTER the code itself. Today I want to talk about the specific angle of TDD β€” using TDD to architect your code.

TDD concept is simple:
1. You write your test BEFORE you write any code
2. Then you run the test β€” it shall fail πŸ›‘
3. Now you write your code/feature
4. You did it right, run your test again β€” it passes βœ…
5. Optimise your code

I continue (and finishing!) to read the "Modern Software Engineering" book, and the author has uncovered another perspective of TDD to me. The purpose of this concept lies not in the assumption, that this way you are sure that your code is tested. Even bigger advantage hides, that if you do your development this way β€” you force yourself to write the code which is testable. And if you write code that is testable, there is a high chance, that it will be easy to maintain and extend this code. Why? Because if your code is testable, it's highly likely that you use inversion of control, loose coupling, modularity and other traits which we like to see in the good code.

Profit.

⬛️ I remember once I've rediscovered UML and thought that it's great, you do not need to code to design applications. You can just draw diagrams and, this way, run thought experiments for all the ideas in my head. Now it may be even different β€” do not write an app, write tests and design your app this way. I'm going to try it out soon.
πŸ›  Text manipulation tools

How often during your day-to-day work do you work not with the programming language, but with plain text? I do it quite often. There are some tools that help me.

1️⃣ delim.co

This is my favorite. Imagine you have a list of 1000 uuids and you need to query your PostgreSQL database about them. What would you do? With the help of delim.co you can convert your list from:

f50e781f-233d-461e-948b-db7fae9147f6
ba86bc1b-1b17-4915-bcfa-890be8cb2f40
bf6885cc-76f6-4f68-8ab0-7956b4ec1d34

to

'f50e781f-233d-461e-948b-db7fae9147f6',
'ba86bc1b-1b17-4915-bcfa-890be8cb2f40',
'bf6885cc-76f6-4f68-8ab0-7956b4ec1d34',

it helps me a lot! And that tool can do even more.

2️⃣ atob and btoa

Another use case. You need to look up your database password from the kubernetes secret. Oh, crap, it's base64 there. Let's google base64 decode. NO! Wrong answer ❌. We can use JavaScript functions atob and btoa and do not post our secrets online. Just open the web console and run:

atob("WW91IGFyZSBhd2Vzb21lIQ==")

(yes, you are)

⬛️ Which text manipulation tools do you use? Please, share, I'm curious.
🀝 Helping the team to agree

We often discuss something with the team. It can be a discussion about the technology, trying to align on how to fix an issue, a process adjustment, or even an open one. One where it seems that nobody knows what is being discussed and how shall it be ended. I bet you often observed something like this and thought "I wish I can stop it and we can move on". Good news: you can. Let's see how.

Often, when such discussions are taking place, this happens because the scope of the initial topic grows and nobody has noticed this. For example, you tried to figure out if you could shift a "Stand up" from 09:30 to 10:00, and in five minutes you realise, that the team discusses if you need to have a retrospective this week.

Be the one who notices it πŸ‘€. Noticing is the key. As soon as you notice that the scope got bigger, quickly reflect on what is being discussed right now and split it into the different topics.

For example:
1. Can we shift a stand up?
2. Which Agile rituals shall we practice?
3. Do we need a retrospective this week?

Interrupt your group and share your observation, that you are now trying to solve three topics instead of one. Suggest to align on answering the first one and taking another action on the others (for example, schedule a separate meeting). VoilΓ , you got your answer, and your group is grounded.

⬛️ By dividing the uncontrolled discussion flow into the different questions, we help a group to agree. Because it's much easier to agree on a simple topic, than to agree on something as a whole.
πŸ‘‹, honorable people,

At the end of this week, on the 5th of March, I have a birthday πŸŽ‚

This year I want to get the best present everβ€” the one that brings πŸ‡ΊπŸ‡¦ victory closer. But that's not it, I have something to give away as well.

First things first. My close friend Yulia and her team are running a project that delivers cars to the UAF and not only. They are in "business" since 2014 and have direct contacts with people on the ground, ones who actually protects our freedom. They have already delivered 350+ cars, and you have already helped them as well.

Why the cars are needed? Vehicles on the war are expendables, they are always in need and allow people to do their main job. Right now, they have a list of requests for more than 50 cars. I want us to help them as much as we can, so I will gather donations for them until the 5th of March and then transfer everything to Yulia. Every cent helps us to stop this war and prosper.

I hope I convinced you to donate, so here are the requisites. Donate, and read what I offer in return.

Here are the requisites:
IBAN: DE69100110012620227756, Pavlo Poliakov; BIC: NTSBDEB1XXX
PayPal: https://www.paypal.com/paypalme/PavloPoliakov or me@pavelpolyakov.com
Mono: https://send.monobank.ua/jar/63kXNYa6Nv

In return, I promise to organize a stream and present you with my learnings from the book Modern Software Engineering. In just like 30 minutes, you will learn universal rules, which will help your software prosper. How cool is that? As a sneak peak, just have a look at one of the slides that I have prepared 🐘. I bet you don't question why I'm a Principal SE right now.

Let's make this fundraiser big. I pledge 200€ and will report on our progress here.

Thank you and Glory to Ukraine! πŸ’™πŸ’›
Good day,

Here are the first stats about the fundraising. Together we've collected.

632.16€ and 1860β‚΄ + 200€ from me.
Average donation in EUR is 50€. Biggest donation in UAH is 1000β‚΄.

Not bad, but we can do even better. Every cent counts, please, spam me with microdonations.

Let's talk a little about the cars themselves. On average, the whole process of the vehicle delivery to Ukraine costs 6000$. These costs include car purchase, fuel, export declarations, train tickets for the people who drive the cars, etc.

As you see, what we have is already around 1/5 of the car. But we can do more. Please, continue your donations 🀝.

Here are the requisites:
IBAN: DE69100110012620227756, Pavlo Poliakov; BIC: NTSBDEB1XXX
PayPal: https://www.paypal.com/paypalme/PavloPoliakov or me@pavelpolyakov.com
Mono: https://send.monobank.ua/jar/63kXNYa6Nv

Below I will attach a video report for the last year, where you can see all variety of cars, which were delivered. That's really impressive.

Thank you and Glory to Ukraine! πŸ’™πŸ’›
Good day, everyone,

Thanks for the active participation in the fundraising. Your donations mean a lot to me πŸ€— But not only to me, we are doing the right thing.

Here I report about the results:
PayPal: 876.15€, 19 people
n26: 50€, 1 person
Mono: 3210 UAH, 9 people

+ 200€ from me

Money were already transferred to the destination organisation.

Have a good day β˜€οΈ
Media is too big
VIEW IN TELEGRAM
πŸ“š Modern Software Engineering

I promised to deliver you an exclusive content in March and here you are. Review of the book "Modern Software Engineering" β€” everything what you need to know to develop confidently. I decided to publish a video instead of the live session, so more people can watch it with their own pace.

Please, share what do you think of it in the comments.
πŸ‘‹ Good day,

Just published a long read called "How to be a great feature lead", where I summed up my experience of being such for many many times.

There is no clear definition in the community what does it mean to be a "feature lead", but we all do that at some point. Being a feature lead is a safe stepping stone in your career development path, but not only, you will play such role almost on any grade. This is why it's important to know how to play it right β€” making it beneficial both for you and the business.

This article, unlike many other ones, tells you about the role from the "soft skills" perspective. They are not related to the project or to the technology which you are using, these skills and attitude will help you throughout your whole tech life.

The article is really long, but it's another benefit β€” it covers the process end-to-end. After you read it, you will be able to use these tools right away, no matter where are you now from the feature lead process perspective.

Hope to get your feedback either here or on Medium.
This article is also available on dev.to.
❄️ Unique ids

We need ids to store the records and later refer to them. Numeric ids are good, but usually you do not want to expose them to the end customer because they can be enumerated. There are alternatives. Let's explore them.

* uuid. This is a standard, right? It's a default that everyone uses to generate a unique id. You can use this id and assume that no other machine or person in this universe will generate the same one. Example: 858e93a4-ff8d-11ed-be56-0242ac120002.

* nanoid. Small js (and not only) library, which generates short ids. Short ids and a small size are the benefits of this library over the "default" uuid/v4 that it generates shorter (you can even choose the length) ids and the size of the library is smaller. Example: zWSK7f4at3iI7TdMP-mYz.

* ulid. This one was new for me. It generates unique ids that are sortable in time. So when you have two of them, you can learn which was generated earlier. Basically, the timestamp is encoded there. Example: 01H1RF7HDAH1MY7E05S6MFC8QS.

⬛️ Do you know any other interesting approaches? Please, share.
πŸ§ͺ ChatGPT hallucinations

Today I got tricked by ChatGPT. I asked it to help me write a custom AWS policy, and it quite confidently told me that I shall use
{"s3:RequestTag/validationProvider": "TEST"}
and everything will be great. So I did it this way, AWS accepted my code, but nothing was great, and the thing I wanted to work β€” did not.

After some time of googling and checking the AWS IAM UI I found out that there is no RequestTag for S3, but there is RequestObjectTag. I made that change, and it started to work as I wanted it to πŸš€

Still, I can say ChatGPT saved me some time, but we shall not forget that we cannot trust it blindly. Honestly speaking, it wasn't a complete hallucination because there is such a thing as RequestTag at AWS; it just has a different context, not the S3 one.

Happy ChatGPT to everyone!