samdark blog
646 subscribers
22 photos
38 links
Notes taken by Alexander Makarov, lead of Yii framework and a long term IT engineering manager.

Official Yii updates: https://www.yiiframework.com/

Consulting: https://asapirl.com/
Download Telegram
Extreme Programming — 25 Years Later by Kent Beck @ DevTernity #1

⭐️ General thoughts:

- None of what we do is science. There are just too many variables.
- Best words in engineering: "It turns out".
- Figure out with your team what works.
- There's always going to be a mess.
- TDD is the way to take responsibility of the quality of your work. If you don't use TDD — take responsibility somehow else.
- Change, do not embrace dogmas.
- Frequency of production deploys matters. Feedback loops matter.
Extreme Programming — 25 Years Later by Kent Beck @ DevTernity #2

⭐️ On power and XP:

Many teams were fired because of applying XP.

There's a power structure at workplace: https://medium.com/@kentbeck_7670/dimensions-of-power-15ac9fa0c590. If you try to get power and fail — you'll be fired.

Power should not be abused by more powerful person in pair programming.

> People will forgive you when you're wrong, but they won't forgive you when you're right @ Ian Warfield

⭐️ XP vs scrum

XP lost the marketing war to Scrum
Scrum did well and XP did not — built a business model. Scrum — marketing genius. Picked audience with power while XP picked audience w/o power.
Highload Armenia is tomorrow. Speaking there and will take interesting notes I'm going to share here. #HLArmenia2022
At Highload Armenia conference I was speaking on packaging principles. That was improved version of my talk and was in English. I'll share the video here as soon as it will be ready.

I was asked an interesting question: "How are packaging principles related to business success?".

1. In a short term it doesn't matter. These principles are there to reduce technical debt. And as any tech debt, it doesn't affect the business if its level isn't too bad.
2. In a long term it matters. If tech debt level becomes "too much", business tasks are becoming slower and slower to solve and the debt itself becomes harder to pay. It may kill even business-successful company if not addressed properly and timely.
An interesting consequence but today I was asked about getting started with tech debt. So below is my short version.

🚒 Getting started with tech debt

- It's your job as a developer/lead to care about tech debt, it's not a problem management should take care of.
- Ideally it should be transparent to business. Non-ideally, tech debt could be silently included into estimates.
- Every non-critical tech debt should be created as a ticket. Ideally, doable in a day or two.
- About 30% of a sprint (or any other iteration) should be about tech debt. If it's bad, up to 50% of team capacity should go there.

💡Ideas to find tech debt

1. Churn. See https://rmcreative.ru/blog/post/git-churn (that's my short article in Russian from 2020, use Google translate if needed).
2. Coupling.
3. Whatever breaks too often.
4. Updating dependency versions.
5. Automated tests.
6. Introduce strict types.
7. Add Sentry/Rollbar to the project. Fix errors.
I'm taking lots of notes w/ good old pen and paper. At the end of the day or when there are too much I'm re-reading these. Interesting things go into Obsidian or my TODOs. The rest is destroyed.

Do you have a note taking routine?
⭐️ After "ID battle: UUID vs auto increment" by Valentin Udaltsov @ Highload Armenia, https://highload.am/2022/abstracts/9716, there was an especially good comment from Grigori Petrov.

"Sun radiation flipping bits is more probable than UUID collisions."

Overall, it was a great talk and I'm glad I've helped shaping it with Valentin. I'll post a video/slides as soon as they'll become publicly available.

TLDR: UUIDv7 performance is the same as autoincrement IDs in PostgreSQL. It is sortable and contains timestamp. UUID in general makes it way simpler to implement DDD aggregates.
⭐️ "Building an open-source online Learn-to-Rank engine" by Roman Grebennikov @ Highload Armenia, https://highload.am/2022/abstracts/9688

We've studied together in the university with Roman and he was always into math, analytics and ML. That resulted in many contract works many of which were about ranking and were generic-enough to build a free OpenSource solution out of it.

https://www.metarank.ai/
⭐️ "How to choose a queue properly" by Mons Anderson @ Highload Armenia, https://highload.am/2022/abstracts/9659

Classification of queue-like engines

1. Cloud
- AWS SQS / SNS
- AWS EventBridge
- Google Cloud Tasks
- CloudAMQP
2. Database-based
- PgQueue
- Tarantool
- Redis
3. Message Brokers
- RabbitMQ
- Kafka
- ActiveMQ
- Tarantool Queue
- Beanstalk
- NATS
- NSQ
4. Sockets on Steroids
- NATS
- ZeroMQ

Some quotes

- Queues are the glue.
- RabbitMQ is designed to scale vertically.
- Tarantool is a platform, not a solution.
- When choosing a queue, choose architecture.

There was way more info but that's what is left in my notes.
2022 🎄🔥 😭 #1

The year was tougher than 2021 which was personally labeled as "we're alive and that's enough" https://rmcreative.ru/blog/post/2021. It's way harder to label 2022 without swear words but it changed lots of aspects of my world and almost broke me. But, same as 2021, there were positive things as well and that's what I want to focus on with some exceptions. This time with some personal comments.

😭😊 Personal life

- Left home in February along with my family. Visited 2 countries, and about 8 cities. Made tons of very stupid things. It wasn't easy. I've got mental issues and returned home to try to calm down and get back to normal state. Results were mixed but overall it helped. I've posted thoughts to twitter back then. What I've learned:
- People minds are fragile.
- When very large part of your mental map becomes incorrect in a single day you can not adapt to new reality fast. Such adaptation will likely cause mental issue.
- Sometimes people cannot help themselves. Seeking professional help is normal. Directing people you care about to get professional help is what you should do when your friends or loved ones are in trouble.
- Psychologists are people as well. They may break.
- Haven't lost a single friend regardless of the country. We have supported each other no matter how bad personal issues were. That's what friends are for, right?
- Moved to Armenia in September. My family stayed in Russia for 2022. It wasn't easy. My expectations were very low because of my previous attempt. Friends in Armenia made it way better than expected. Thank you!
- Celebrated 18 years together with my wife. She's the love of my life, the best person I know, the one who inspires me, and a very good mother.
- Kids are getting older. Way smarter. Way more handsome. We're teaching them to be kind, emphatic and creative. They choose their own hobbies and activities and, sometimes, these are very surprising in a good way.

👷‍♂️Commercial projects

- Crypto Exchange. Still NDA but I can say I've learned very cool stuff from the excellent team and challenges there. Achieved a lot as well.
- Our mini HR-agency works. I've checked hundreds of CVs and did hundreds of interviews. I think now I can properly scan CVs to find hidden gems.
- Created ASAPIRL LLC https://asapirl.com. It is still very young. We are small, there aren't many clients yet, and we are doing everything ourselves. But I see a good future for it.
- 5 years ago I've co-created two excellent coffee-places called BrightCoffee https://brightcoffee.ru. My brother is currently maintaining that very high standard that was set back then. Not sure what the future will bring to Russian coffee industry and economics overall but that was a great experience anyway.

🗣Conferences, meetups and online

There were a few events I was involved in.

Preparing PHP Russia conference was especially hard. Program committee, speakers, participants were depressed and busy doom-scrolling news. In the middle of the year I was nearly unable to participate as well. A bit later I've got better and realised that PHP community needs something good to focus on to get out of this endless loop. The program was re-built three times, many speakers were participating via online and I wasn't able to attend the conference. First, because I was our of the country. Second, because of a very severe flu. But in the end it went well. I'm still unsure if there will be more PHP Russia conferences but I'm glad we did four quality conferences.

Other than that I've participated in a few online talks about PHP, talked about code review at TechLead Conf, talked about package metrics and principle at Highload Yerevan and more.
2022 🎄🔥 😭 #2

🎸Hobbies

In Yerevan I borrowed a guitar from a friend and continued practicing. Learned nothing new because lack of time but, at least, managed to remember what was learned before. Hope I'll have time for it in the next year.

I've continued with TRX trainings and later with mixed gym and TRX in Yerevan. Trainings are the must for people working in IT. They help venting the stress and have a good enough sleep. And, of course, they keep the body in a good enough shape after days of sitting.

💝Yii

There were 81 updates of Yii packages https://www.yiiframework.com/news?year=2022. Mostly Yii3 but we did not forget Yii 1.1 and Yii 2.0 with extra releases made.

There were less updates at OpenCollective https://opencollective.com/yiisoft/updates but actually many things were done. 65% of Yii3 packages are now stable https://www.yiiframework.com/yii3-progress. We are working hard on getting more packages ready. Currently these are validator, data, and db.

🎁 Projects

There weren't many side projects I was able to work on. I did a few updates for a Visual Studio Code Dark Plus theme for JetBrains IDE https://github.com/samdark/intellij-visual-studio-code-dark-plus and need to adapt it to new UI. Another thing is PER Coding Style https://github.com/php-fig/per-coding-style. A successor to PSR-12. Version 1.0.0 that was tagged equals PSR-12 and current master version is about adopting to PHP 8 features and resolving previous inconsistencies.

📝 Posts

There were some posts made in the original Russian blog:

- О генерации CHANGELOG из коммитов https://rmcreative.ru/blog/post/o-generatsii-changelog-iz-kommitov
- GRASP https://rmcreative.ru/blog/post/printsipy-grasp
- composer для продакшна https://rmcreative.ru/blog/post/composer-dlja-prodakshchna
- Форсируем LF для всего проекта https://rmcreative.ru/blog/post/forsiruem-lf-dlja-vsego-proekta
- Галеры против продукта https://rmcreative.ru/blog/post/galery-protiv-produkta

By the end of the year I've decided to try Telegram and write posts in English: https://t.me/samdark_blog

📚Books

This year it was a good mix of tech stuff, science fiction and more.

- Designing Data-Intensive Applications @ Martin Kleppmann
- The Choice: A True Story of Hope @ Edith Eger
- Transhumanism Inc. @ Victor Pelevin
- FUTU.RE @ Dmitry Glukhovsky
- Outpost @ Dmitry Glukhovsky
- Le Passager @ Jean-Christophe Grangé
- The Art of War @ Sun Tzu
- The End of Eternity @ Isaac Asimov
- Nightfall @ Isaac Asimov
- Foundation @ Isaac Asimov
- Galactic Empire @ Isaac Asimov
- Antifragile: Things That Gain From Disorder @ Nassim Nicholas Taleb

✈️ Travel

Travels this year were way less touristic:

- UAE: Dubai, Sharja
- Turkey: Antalya, Alanya, Mersin, Istanbul
- Armenia
- Georgia

🙏 My wishes for 2023

1. No wars. People do talks instead. There shouldn't be anything to justify war. Ever.
2. Reunite with my family.
3. All Yii3 packages released.

How was your 2022?
Generated with https://github-contributions.vercel.app/.

Consistency is more productive than crunches.
💬✏️ Chats, threads and fixing agreements in writing

Do Slack-like threads help structuring info?

To some extent — yes. They help when there are 100+ people discussing things simultaneously and not everyone is interested in every discussion.

But there's an important thing to consider. Slack or any chat messages are not a replacement for task tickets or documentation. They are discussions.

If, after discussion, the summary isn't written into an issue or documentation article, multiple issues arise:

1. It's hard to find it again if the chat is busy.
2. It's easy to read it wrong or confuse discussions with the final decision.

Do summaries. They save time:

1. No search is needed.
2. No need to read the whole thread.
3. It is not likely that it's read wrong.

And do summaries right away. Postponing this task is likely forgetting about it.

Ideally, it is the job of the project manager but sometimes it is necessary to mention her/him in the thread to ensure the task is created.

You may additionally link to the discussion, which would help if there are questions about why such a decision was made.

Do you have a habit of summing-up discussions?
☕️ A simple guide to specialty coffee

The world of specialty coffee is like the world of premium wine. It is hard to notice all the differences in taste, to guess the origin, etc. But the good news is it is relatively easy to tell if the place is about good coffee or not to have a great experience.

Brewing tools

- If there is only an automatic machine, likely the venue does not care about coffee much.
- If there are V60, Chemex, Aeropress, Syphon, a solid grinder, etc. then the first test is passed.

Beans

- Single origin is great for the taste.
- A mix could be good but if there's robusta in the mix, that's no good.
- Beans in the espresso-machine bunker should not be roasted to nearly black.
- Beans for V60, Chemex, Aeropress, and Syphon should be lightly roasted i.e. very light brown. Also, they should be single-origin. There's no sense in brewing a mix these ways.
- For a Cezve, a Turkish-style coffee pot, heavily-roasted beans are alright.
- The roasting date is best to be around 2 weeks old. The too-fresh roast may be not as great as it could be. Too old-roasted beans likely lost in taste a lot.

Milk

You may look at how it's handled. Especially when flat white is ordered. If the result is all-bubbly then it's no good. If there's a latte art (pictures made with milk) then it's likely good.

Sugar

It's good only in two cases. First, when Turkish-style coffee is made and it's added before brewing. Second, to make bad coffee a bit better.

How to choose single-origin coffee for V60, Chemex, Aeropress, and Syphon

1. Try different kinds of coffee. Origins, processing methods, and roasters.
2. Try it when it's hot, warm, or cold.
3. Note the taste components: acidity, flavor, body (oily, grainy, watery), sweetness, bitterness, aroma, and finish (aftertaste).
4. Make notes about what you like/dislike.
5. Ask the barista for help finding what you like or try something completely new.
6. If you've tried only "classic" coffee, you won't like acidity at first. It is a good idea to leave it for later.

Enjoy ☕️.
Stumbled upon https://php-di.org/doc/attributes.html#inject and had a flashback from late 2000 when I've developed with J2EE and Spring. That was 2007 — 2008 and all the code was filled with annotations pointing about what dependency to inject where. Using attributes in PHP for the same purpose, as used in PHP-DI, ties your code to specific container implementation and violates the whole idea of dependency inversion principle that your classes should not specify what is injected.

The problem in Java world was big enough so in 2009, a set of injection annotations was defined and standardized as JSR-330 https://jcp.org/en/jsr/detail?id=330. That allowed container interoperability but did not solve the problem of violating dependency inversion.

PHP seems to fall into the same trap, only 13 years later.
This is the old reading from 2012-2016 but still qute enjoyable. Highly recommended.

An illustrated collection of (sometimes violent) fables
concerning the Art and Philosophy of software development,
written in the spirit of Zen kōans

http://www.thecodelesscode.com/contents

p.s. this is one of my favorite ones: http://www.thecodelesscode.com/case/117
I work on Windows, Mac and Linux switching between them constantly. It is very convenient when you have similar keyboard layout, locale switching, hotkeys and shell.

⭐️ Keyboard layout

Custom keyboard layout by Ilya Birman works on Windows, Linux and MacOS in a similar way.

English: https://ilyabirman.net/typography-layout/

Russian: https://ilyabirman.ru/typography-layout/

⭐️ Caps lock to switch keyboard layout

📌 Linux

Works by default.

📌 Windows

1. Download https://haali.net/winutils/lswitch.exe by Mike Matsnev
2. Open regedit.msc
3. Go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
4. Add "String value". Name is "lswitch". Value is c:\path_to\lswitch.exe" 20
5. Reboot

📌 MacOS

1. System Preferences → Language & Region → Keyboard Preferences
2. "Use the Caps Lock Key to Switch ..."

⭐️ Shell

📌 A good shell

- On Linux — bash.
- On MacOS — zsh.
- On Windows — bash is installed with git: https://git-scm.com/download/win

📌 Starship

https://starship.rs/
📕How PHP Environment Variables Actually work @ 2019-03-26 by Matt Allan

A great overview on how PHP environment variables work. The blog went down so I've recovered it via https://archive.org/web/

https://gist.github.com/samdark/01279afbce4871bd02b556bbb7ca4790