samdark blog
Ir al canal en Telegram
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/
Mostrar másEl país no está especificadoTecnologías y Aplicaciones63 619
885
Suscriptores
-124 horas
+17 días
+1430 días
Archivo de publicaciones
885
Coding assistants do not replace pair programming
There’s a lot of fuss about LLM-powered coding assistants such as GitHub Copilot. I’m using these as well but I agree with the following opinion about replacing humans. Not there yet.
https://martinfowler.com/articles/exploring-gen-ai.html#memo-05
885
🎓Computer Science education and interviews
Any computer science education regardless of university should be a big pro when selecting a candidate for the job. It gives a good base that is becoming very useful on Senior+ levels and, also, candidte is more likely to speak the same language as the rest of the team.
Unfortunitely, not every person who graduated listened and understood everything being taught. That’s why questions like “what’s the cost of making system reliable in general” or “how does O(n³) looks in the code” are necessary to ask during inverview.
It is a sad fact that way too many CS graduates can’t answer these.
885
🌓 On tests fragility
A good set of tests gives everyone involved with the project confidence and eases fear for change. It is essential for any project that's going to live for years.
But what's a good set of tests? Of course, coverage matters and, first of all, business logic coverage. Other than that, tests should be readable and, what's important, tests should be reliable.
Keep an eye on the following test reliability obstacles:
⭐️ Test should be executed in a certain order relative to other tests. That's never a good idea except some edge cases. In case of PHPUnit you can use executionOrder set to random.
⭐️ Test doesn't clean up after itself leaving cache files, database records and other state data that might affect subsequent tests.
⭐️ Test relies on network/another API. Use mocks instead. Testing network or external service isn't the responsibility of the current project.
⭐️ Test relies on system time. Use an interface and a frozen clock in your code.
⭐️ Test uses randomness. That includes generating non-fixed fake data that is usually fine but might cause issues from time to time. Prefer fixed data.
Overall, relying on any non-deterministic behavior makes the test unreliable or "flaky".
885
🧠 The cost of mistake
The cost of fixing a mistake might be less than planning in detail so there's certainly no mistake possible.
Do you know the cost of mistake in your project?
885
🧠 Dealing with team opinions
In Yii development and overall there are situations when multiple team members have different opinions on how things should be done and, sometimes, their opinions are very time consuming to argue with.
In these cases, to save time, I ask myself some questions.
❓Would my "correct" way of doing things matter for the project overall? Would it bring us closer to release, would it improve developer experience significantly, would it make maintenance easier for maintainer?
If the answer is "no" then it's better not to spend time on something else.
❓Is "wrong" way of doing it completely wrong? Are there good things about it? Can we merge our approaches taking the best parts from each one?
It is important to try to take something good from what was done by your team even if overall it was wrong. Throwing things out completely hurts morale.
❓Is it possible to get independent feedback of both approaches?
That is even more time-consuming but can be done if it's possible to postpone the decision and work on something else while independent feedback is prepared. The result usually bends decision to one way or another.
⭐️ If nothing helps and "wrong" approach hurts the project, it is worth time spending on prepare very strong arguments for further discussion.
885
Yii 2.2 discussions
Yii is a tough project. Especially Yii3 that takes way too much time and isn't fully released yet which adds to the frustration about it. Of course, that's similar to what was with Yii2 back in the days of Yii 1.1 but a bit different. Yii2 was conceptually similar to Yii1. Despite not being backwards compatible, service locator, MVC and overall framework-ish stuff was similar. Yii3 is different in this regard. The concepts are more fundamentally correct, the ideas are a bit different. That's why we were constantly worried about the adoption of Yii3 among Yii2 users.
And that's, partially, why Yii 2.2 might happen now. So far, it's discussions and some drafts. The rough plan is:
1. Refresh Yii 2.0 pipelines and builds to be sure tests are alright.
2. Up PHP version to 8.1, remove deprecated stuff.
3. Reuse individual Yii3 packages.
Point 3 is what is the most interesting in terms of Yii3 adoption. That would help us to stop maintaining two different code bases in many cases and result in improvement of Yii3 packages.
https://github.com/yiisoft/yii2/discussions/categories/yii-2-2
885
🎨 Visual Studio Code Dark Plus theme for JetBrains IDEs 2.8
It was a long time since I've posted about IDE theme updates here. Today I've revised UI colors significantly so the theme now takes all the latest changes of JetBrains platform into account and looks way more VSCode-like.
It will be available soon via official plugins channel but if you want to try it right now, you can get a file at https://github.com/samdark/intellij-visual-studio-code-dark-plus/releases/tag/2.8
885
💭 37signals left the cloud
That's not he first time I've seen projects migrating from the cloud to bare metal servers.
https://world.hey.com/dhh/we-have-left-the-cloud-251760fb
885
📕 Enterprenerd
Finished Enterprenerd book. It is by Bruno Lowagie, author of iText library that allows generating PDFs in a standards compliant way and is currently used in majority of products generating PDFs. He went from a niche OpenSource library with all its struggles to a big business getting all the issues possible along the way. I see many similarities with the way Yii went though so far.
Besides it was an exciting read that I highly recommend, I've learned a few very interesting things.
⭐️ First, developers and tech people are, generally, all about control. They want things to go as planned, they want to be sure that everything is done properly etc. Therefore, they may build extremely efficient/awesome small business but scaling the business means delegating and losing control. And that's what tech people are totally scared to do. Bruno did that, succeeded as entrepreneur and finally lost control of iText. The product itself seems to be fine though.
⭐️ Second, sometimes restrictive licenses such as AGPL are a good thing for the product itself and the founder. I might release something with such license + commercial one just to try it.
⭐️ Third, finding right people to do business with is essential and, sometimes, it even more important that having a perfect product.
885
Client-side apps and htmx
There's a certain amount of hype about htmx now.
⭐️ The idea is that some websites are not meant to be SPA (simple page apps) but there are some nice things SPAs do such as making content load asynchronously without page reload. To achieve it, the JS library uses content negotiation and backend, depending on what's requested, either answers with full page HTML or just the block of HTML that is meant to be replaced.
📕 The approach isn't new. I've implemented Stay project web like that in 2012 and it worked quite well back then (except that there was a mobile app with offline capabilities and we needed API anyway). Two years later, pjax, created by GitHub founder in 2011, was included into Yii2. Then came Turbolinks from DHH, creator of RoR and Basecamp that eventually superseded by Hotwire used in Hey email service. The same idea lies within livewire that repeated the path in 2019 and other alternatives.
The htmx itself isn't new as well. It was named intercooler.js and first version came up about 2013.
💭 The approach itself works but not for everything. It won't work well if:
1. You need a native mobile app and API for it. You'll have to support both serverside HTML generation and API at the backend + rendering on the mobile app which is more similar to SPA than to serverside rendering.
2. You have a really complex UI. That's the valid case for SPA.
⭐️ If you do something for 10 years, it usually takes a complete shape so I recommend to at least read its docs and think about the approach overall.
885
How to talk to your company about sponsoring an open source project
I think that's the best piece I've read on the topic of getting your favorite OpenSource project funded by your employer.
https://humanwhocodes.com/blog/2021/05/talk-to-your-company-sponsoring-open-source/
885
😋 Non-verbal feedback
This time I did make it to phpday Verona... but not in person... only virtually 😭 Visa issues.
Mixed offline-online conferences are very tricky for speakers. At pure online conferences you have at least chat feedback. At mixed conferences absolute majority of feedback goes offline. From offline feedback the most precious are:
🔸 questions
🔸 non-verbal reactions: if audience is sleepy or lost or excited or...
When speaking offline you can see non-verbal part and you can adjust immediately to fix the issue. When speaking online you don't have it so you have to imagine how audience will react.
885
PHP Telegram blogs list
⭐️ PHP (Eng) — https://t.me/addlist/yNksksLVT6M5NGEy
⭐️ PHP (Rus) — https://t.me/addlist/R7i3akzlB2kwZTMy
If you know more — please post these in comments.
885
"Please stop calling ChatGPT AI. It is artificial, but it's not an intelligence." — from a talk by Enrico Zimuel.
885
PhpStan author: You will only get feedback if you'll release 1.0.0 right away. Noone is testing beta and RC.
885
Hand-drawing
When I need to understand the algorithm or RFC or whatever isn't immediately clear, I draw with pen and paper. The above image is for RFC7239.
What do you do to wrap your head around something like that?
885
HighLoad++ Serbia
Not speaking at this one but can vouch that content and standards are top-notch since I know both organizers and program committee members.
HighLoad++ Serbia, a professional conference for developers of high-load systems, will be hosted in Belgrade on July 4.
- 20+ talks on the most relevant topics in software development: architectures, scalability, databases & storage systems, neural networks, AI, DevOps & maintenance, large project management, and other topics connected with high-load system development
- speakers from the leading IT companies of the world
- the largest IT afterparty you’ve ever been to
https://t.me/HighLoadInternational/167
