samdark blog ☕️ (Alexander Makarov)
СтатистикаNotes taken by Alexander Makarov, lead of Yii framework, CTO of Twindo.ai and a long term IT engineering manager. - Official Yii updates: www.yiiframework.com - Consulting: asapirl.com
- Последний пост
- 14 авг.
- Последнее чтение
- 18:45
- Постов за неделю
- 4
- Всего постов
- 48
- Тип
- открытый
- Язык
- английский
- Категория
- Технологии (по похожим)
- В каталоге с
- 12 авг.
- 1/24сутки в ленте
- 561
- 1/48двое суток
- 642
- 1/72трое суток
- 693
Оценка по просмотрам недавних постов: пост набирает почти всё за первые сутки.
Посты
📄 PER-CS v3.1 PHP's coding style is just about to get its new version. 3.1 fixes a few clarity and wording issues but also there are some interesting changes. You can check these yourself, there's a changelog. I'll, instead provide a few numbered code snippets to discuss. 🔸1 — clone with parenthesis $b = clone($a); $b = clone($a, [ 'foo' => 'bar', ]); 🔸2 — switch-case-match switch (true) { case ( $a === 10 && $b === 20 ): doSomething(); break; } 🔸3 — spaces around pipe operator $result = $input |> trim(...) |> strtoupper(...); 🔸4 — chaining $result = '<foo>' |> strtoupper(...) |> htmlspecialchars(...); 🔸5 — empty closures $noOpFunction = function () {}; // SHOULD be preferred where possible: $noOpFunction = fn() => null; 🔸6 — anonymous classes $example = new #[Attribute] class { // ... }; 🔸7 — enums and scoping (private) <?php enum Size { case Small; case Medium; case Large; private const Huge = self::Large; } 🔸8 - arrays return [ 'foo', 'bar', ]; someFunction([ 'foo', 'bar', ]); #php #psr12 #percs
🥩 Meat-routing and trust erosion It is very tempting to copy-paste LLM answers or research as is. It usually looks great. You validate it once, twice, three times... You make a few corrections but otherwise it's good. Then you start trusting and stop validating. Essentially, you are a meat router now. Your colleagues will eventually notice, and ask themselves a few questions: 1. Can I trust this person any more than the LLM? 2. Has this person even read that response, or just forwarded it? 3. Can't I just use the LLM myself? 4. Why should I read that wall of text when I just need a yes or no? That is, essentially, worse than "vibe-coding" — because there's no immediate feedback like "it doesn't work." A bad LLM answer can sit in a doc or a Slack thread for weeks, quietly trusted, before anyone notices. The fix: 1. Consider answer a draft. Never forward it right away. 2. Compress it. If you can't reduce it to 1-2 sentences, you have not processed it. 3. Claim it. Take responsibility for the answer. 4. Verify the claim. Check what matters. #llm #ai
видео или голосовое, без подписи
💡Wavy Lamp is awesome Finished printing and assembly of wavy lamp and I love the result. It is pretty both day and evening. I've printed "big" variant. Costed me around 13$ including the bulb and the cord. The base is black PETG. The main part is Elegoo PLA Silk Bronze. #3d
New yiiframework.com is live The Yii website has a fresh new look! We’ve redesigned it for clearer navigation, better readability, improved mobile support, and consistent dark mode—all while keeping the familiar Yii spirit. Take a look and let us know what you think! https://www.yiiframework.com/ #yii
💡Self-learning agents All modern agents currently read AGENTS.md as the initial point of custom instructions. Claude sometimes ignores it, but usually doesn't. For almost a year, I've had the following in my AGENTS.md: # Lessons learned When automated checks don't pass, when I correct execution, ask to do things in a specific way, or instruct in any way meaningful to make a process from it, write it down in as less words as possible into `docs/lessons.md`. Refer to it when planning execution. So far I have 50 lessons written down, and it really helps agents make fewer mistakes. Some examples that were added: 1. Treat full-suite OOM as a product bug; isolate the test and fix the leaking/reentrant path instead of accepting a memory-limit workaround. 2. Apply UI translation label changes to every locale that owns the key. 3. Prefer built-in framework handlers over custom logging handlers. 4. Include units in timeout/duration constant names. 5. Remove unproven defensive UI fixes when backend handles the real failure. 6. Fix invalid frontend payloads at the source; do not normalize them server-side. 7. Audit final diffs against the target branch; exclude unrelated hunks. #ai #llm #agents #lessons
🧰 Iteration time matters — even more with LLMs Not for every task, but for many of them: non-deterministic outputs, too many possible outcomes, or you just don't know what "correct" looks like yet. For these, the normal path is: build something, try it, refine or throw it away, repeat. Often 50-100 times. This is where iteration speed becomes the bottleneck. A twenty-minute build step kills this loop before it starts. That's why languages like PHP — instant feedback, no compile step — are genuinely valuable here. Once the behavior stabilizes, then you tighten the code: static analysis, architecture, tests that lock in what you now know is correct. Example: daily progress reports for Twindo. The input is huge highly varying JSON, the output is non-deterministic. The rules aren't fully enumerable. So we feed it real inputs, judge the output, tweak the prompt or algorithm, add test cases — 50 to 100 rounds before it holds up across enough inputs. Try that with a Rust rebuild taking minutes and the loop just stalls — compile time exceeds iteration time. This isn't "Rust is bad." Rust is great — performance, memory safety, heavy data processing, and especially good as PHP extensions. Fast exploration needs a fast loop. Choose your tools for the bottleneck you actually have. #php #rust
🔒Check for permissions, not roles It's common for projects to start with very simple access control — a handful of roles like admin, regular user, editor. But as the project grows, things get complicated fast: special conditions pile up, multiple role checks get scattered around, and you end up with tangled conditionals buried in the code. This is a common mistake when using RBAC/ACL: checking for roles directly instead of checking for permissions. Always check permissions, not roles. Whatever permissions a role grants should live inside the role-based access control hierarchy, not in the code itself. This keeps the code explicit and keeps tricky logic contained in a single place — making it far easier to review, whether the reviewer is a human or an AI/LLM. #rbac #acl #permissions #code
kubuntu just works While PopOS w/ GNOME was overall quite good experience compared to my older attempts to try Linux, there were a number of irritating things. I've finally switched to Kubuntu 26.04. 🔽 Issues were: - Global hotkeys on Wayland didn't work well. - Screenshot tool with annotations on Wayland. - One of displays not getting out of sleep sometimes. - Extremely slow getting out of sleep. - Scaling issues on 4K and 200%. 🔼 With kubuntu it feels like it just works: 1. X11 hotkeys handling is perfect despite being on Wayland. 2. nVidia drivers are not a hassle. 3. Built-in Spectacle screenshot tool is perfect and has annotations. 4. Requires way less tinkering and is very customizable with UI. 5. Perfect scaling and text rendering. Even fractional scaling. 6. No issues w/ sleep/wakeup. 7. Good KDE software: Dolphin, Gwenview, Okular. 8. Very good settings UI. #linux #popos #kde #gnome
🤔Quick, AI-built libraries = Utopia? With the rise of AI there are many posts about people creating their own libraries instead of using third party ones. That is partially true. But only partially. Reality is harsh. Creating a library or a framework was, of course, a lot about coding. But it was also about getting feedback, improving the library, putting a lot of thought into it, and refining it over years. For example, a testing framework. You can get your own quickly, but to make it really useful, stable, and error-free... it takes years to polish. Even though writing the code itself is no longer the hard part, none of that other work has gone away. So foundational libraries are just as important as before — not less. For some straightforward things, like sending SMS directly through established gateway APIs, it's very true that creating your own library is no longer a problem. The obstacle was code, not design, and now the obstacle is gone. #ai
видео или голосовое, без подписи
До конца сбора на Пыхник осталось 4️⃣ дня! Для тех, кто вдруг пропустил: мы готовим целую неделю для PHP-разработчиков — три вечера онлайн и большой офлайн-день 11 сентября в Art Village под Москвой. В программе 11 секций программы про AI, архитектуру и асинхронный PHP от лидеров экосистемы PHP. Пыхник’26 будет полноценным гибридным мероприятием. Онлайн-участники смогут смотреть прямые трансляции, задавать вопросы и участвовать в обсуждении, а после мероприятия получат доступ к записям. Поэтому необязательно ехать в Москву, чтобы стать полноценным участником. Для проведения Пыхника’26 нам нужно заранее оплатить площадку. Именно поэтому мы запустили краудфандинг с чётким дедлайном. До конца сбора осталось четыре дня. Чтобы он считался успешным, необходимо собрать не менее 50% от указанной суммы. Если порог не будет достигнут, краудфандинг завершится неуспешно, а нам придётся искать другие варианты проведения мероприятия. Сейчас важен любой формат участия. И офлайн-, и онлайн-билеты приближают нас к цели. Также можно заказать футболку или просто поддержать проект на любую сумму. Если вы собирались приехать или посмотреть Пыхник’26 онлайн, но откладывали решение, сейчас самое время присоединиться. Именно ближайшие четыре дня определят, сможем ли мы провести мероприятие в задуманном формате. https://planeta.ru/campaigns/pyhnik26 Если планы изменятся, билет можно вернуть. Все сроки и условия возврата подробно указаны на странице краудфандинга.
🎁 samdark/sitemap 3.1.0 My sitemap generator package was updated once more. This release adds support for image sitemaps and completes the feature list that was planned long time ago. The package is used in many of my projects. Unlike other sitemap packages, this one is memory efficient and fast. If you don't read all your entries to memory at once to get URLs, memory usage stays very low so you can generate huge sitemaps fast on the same server. https://github.com/samdark/sitemap #php #sitemap
видео или голосовое, без подписи
Программа Пыхника’26 У нас сразу три отличные новости! 🔥 Мы расширили программу: вместо запланированных восьми секций на Пыхнике’26 будет одиннадцать. Все доклады из шорт-листа оказались слишком крутыми, и мы решили никого не вычёркивать. Цена билета та же. 🥳 Онлайн-доклады пройдут в прямом эфире с 7 по 9 сентября. Пыхник’26 теперь не однодневное мероприятие, а целая PHP-неделя, которая завершится большой офлайн-встречей 11 сентября в Art Village. 🤩 Первый онлайн-доклад Дмитрия Dantes будет открытым! Посмотреть его смогут все желающие. 7 сентября 📹 • Компилируемый PHP: перспективы и возможности — Дмитрий Dantes 8 сентября 📹 • AI-first архитектура PHP-приложений — Дмитрий Кириллов • Возвращаем gRPC в PHP — Вадим Занфир 9 сентября 📹 • Testo: тестирование со вкусом хинкали — Алексей Гагарин 11 сентября 🏠 • Request-Reply без ожидания и блокировок — Валентин Удальцов • От скучной генерации к инженерии с ИИ — Данил Щуцкий • Ломаем PHP-системы, чтобы они не падали — Маргарита Моногарова • PHP в бинарнике на примере YiiPress — Александр Макаров • Архитектура интеграций в PHP: как пережить чужие API — Олег Мифле • AI-трансформация в PHP-команде: куда переехал bottleneck — Денис Кукуреко • Флипчарт-сессия «Архитектурный экстремизм» Программа готова — дальше дело за вами: https://planeta.ru/campaigns/pyhnik26 Билет теперь можно оплатить от компании — присылайте на conf@phpyh.ru тип, количество, реквизиты.
PHP в бинарнике на примере YiiPress Вы знали, что PHP-приложение можно упаковать в маленький самодостаточный бинарник, который не будет требовать установленного PHP, Composer и Docker на машине пользователя? Александр Макаров — CTO Twindo.ai, руководитель команды фреймворка Yii, организатор PHP Russia, член ПК HighLoad++ и других конференций Онтико, представитель Yii в PHP-FIG. Работал в Skyeng, Wrike и Stay.com, успев проверить в бою несколько поколений различных технологий. На примере YiiPress Александр разберёт PHAR, static-php-cli, micro SAPI, distroless-образ, собственный сервер предпросмотра и нативные расширения на C/Rust. Отдельный фокус наведёт на границы подхода: что стоит выносить в расширения, почему бизнес-логика должна оставаться в PHP, почему FFI и Go — решения компромиссные, и какие идеи применимы в обычных веб-приложениях и микросервисах. 🌿 Присоединиться к Пыхнику
State of PHP Survey 2026 This year's PHP survey launched. Not that long form and interesting questions. Would be good to see results. https://surveys.jetbrains.com/s3/b-state-of-php-2026 #php
Успей подать доклад! Сегодня вечером собираемся с программным комитетом: предварительно обсудим заявки и начнём собирать программу! Но время ещё есть — до конца недели можно закинуть свою идею выступления. Даже если тема пока не идеально сформулирована, подавай как есть. Сильную идею можно докрутить вместе. ➡️ https://forms.gle/3J91mXojmPSK6EA8A 🚀 — уже подал ✍️ — подам на неделе 🤔 — жду программу, чтобы решить, покупать ли билет
Запустили краудфандинг!!! 11 сентября в Art Village под Москвой собираем небольшую PHP-конференцию на 120 участников: один поток, 8 докладов и много живого общения. Средства на мероприятие собираем через краудфандинг. Можно взять офлайн-билет, доступ к записям, футболку «Вы вымрете, а я останусь» или просто поддержать проект любой суммой. https://planeta.ru/campaigns/pyhnik26
видео или голосовое, без подписи