Dmitrii Kovanikov (@ChShersh) header
Dmitrii Kovanikov (@ChShersh) profile picture

Dysfunctional Programming account #1. Senior SWE. I still write C++ for money. ex-Haskell, ex-OCaml. All opinions are my own.

London, UK
Joined October 2013
Photo by Dmitrii Kovanikov (@ChShersh)Photo by Dmitrii Kovanikov (@ChShersh)Photo by Dmitrii Kovanikov (@ChShersh)Photo by Dmitrii Kovanikov (@ChShersh)Photo by Dmitrii Kovanikov (@ChShersh)Photo by Dmitrii Kovanikov (@ChShersh)Photo by Dmitrii Kovanikov (@ChShersh)Photo by Dmitrii Kovanikov (@ChShersh)Photo by Dmitrii Kovanikov (@ChShersh)Photo by Dmitrii Kovanikov (@ChShersh)
Wanna become a C++ expert? Good news, everyone! Join CodeCrafters and build your own low-latency in-memory DB. And because you endured all my shitposts, you get a generous 40% discount. I reward your loyalty. app.codecrafters.io/join?via… It's time to git gud. #ad
26
37
2
735
322,819
What’s the stupidest thing you had to do at your job? At one of my past jobs I had to log in into a custom system daily and put number 8.0 in a cell for today meaning I worked 8 hours.
102
13
9
834
31,899
Immediately after I attended a talk about CPU architecture and wiring efficient low-latency code by using hardware optimally. Chat, it might be over for me.
Today I attended a Linux kernel presentation by some of the smartest people I know. I never felt more stupid in my life.
9
7
1
359
10,901
Good news: AI can’t do my job yet. Bad news: Neither can I.
66
167
10
2,544
43,173
Today I attended a Linux kernel presentation by some of the smartest people I know. I never felt more stupid in my life.
92
90
11
2,992
98,425
I sent code for review to Opus 5.5. It found 10 improvements. I had to decline all of them. They were completely irrelevant and only making the code worse.
100
33
11
1,459
107,041
Fun fact: 67 is both the smallest and largest prime number divisible by 67
Fun fact: 2 is the only even prime number. IMO, it makes it a bit odd.
5
1
99
4,464
Man: why are essential constants e and π that? God: what Man: the base of a natural logarithm e is an irrational number 2.7182… and π is also an irrational number 3.14159… why? God: first of all, e=2 and π=3
−11062769241414341239970603495681493737981374532130995 and −11061733404916469626152098526056073213151599377977031 Caiolo–Ferroni–Hoster conjecture is false
77
168
24
7,650
402,445
I must come clean, I still think that the difference between us is obvious and the similarity is just a running joke everyone keeps repeating. Like, I clearly know who I am of those two, why is it so difficult for others.
20
85
5,930
Fun fact: 2 is the only even prime number. IMO, it makes it a bit odd.
I wonder if there’s a math theorem saying how rare are prime numbers to approximate the accuracy of this function. Would be huge if something like that was actually proven recently.
7
1
2
187
15,693
There’s actually a very simple solution to cache invalidation that works in every use case
Cache invalidation is one of those things that are either straightforward, or impossible. If you implemented a cache invalidation and thought "huh that was kinda complex, I hope it works" - you're in about to find out stage.
5
1
117
21,638
Which is replacing cache invalidation with cache expiration, immutability, and versioning.
4
75
4,187
I just now realised it explains why I love C++ Since childhood I’m used to reusing every single household item and extending its lifetime. That’s why winning even nanoseconds in C++ brings joy. I’ve been surviving my whole life on micro-optimisations.
This is such a wild mindset. I proactively cancel all services I don’t use and track my spending up to b a penny. I just don’t understand how so many people can simply throw money away.
4
1
86
4,534
I wonder if there’s a math theorem saying how rare are prime numbers to approximate the accuracy of this function. Would be huge if something like that was actually proven recently.
My O(1) Prime number checker
11
31
3
1,453
72,046
To add a bit of nuance to this post (nuance on X, ikr), there's actually a legit use for raw pointers in C++ and here's my perfect ownership and resource management system. 1. No naked new/delete 2. Owners allocate resources only through std::unique_ptr<T> 3. If you need to pass a pointer read-only, you can pass just T* as an argument. 4. You can even store raw pointers if you're confident the owner dies after you. 5. You almost never need std::shared_ptr. It's poor man's GC. Only in super niche cases like "persistent binary trees" You can easily guarantee 4 at compile-time if you only store pointers in the corresponding std::unique_ptr <T> owner (aka RAII). Returning T* from a method and hoping the user doesn't store it or dies before you is a slippery slope.
Using raw pointers in C++
17
1
1
120
9,524
AI can write better code than I can. However, it can’t explain complex topics better than me yet.
38
3
6
227
12,618
Just finished watching this talk. @poteto makes a great point that removing paper cuts is even more important in the age of agents. They can execute blazingly fast. Meaning that mistakes will compound quicker as well.
5
1
1
164
8,172
This is such a wild mindset. I proactively cancel all services I don’t use and track my spending up to b a penny. I just don’t understand how so many people can simply throw money away.
The entire global economy is being held by a single thread of people forgetting to cancel auto-renewing subscriptions and people being too lazy to move their cash to higher yielding money market accounts. If every human ran a prompt for an agent to do it for them, the banking system would collapse and the world would explode.
14
8
2
261
17,763
Using raw pointers in C++
9
6
3
230
15,260