M.Potomin (@mpotomin) profile picture

Software developer. Typescript, Javascript, C#, Unity, Game dev, Photography and more 🥑

Berlin, Germany
Joined May 2010
Being a software engineer is: 50% designing 40% debugging 8% documenting 2% coding
41
65
13
539
In longer switch statements, I occasionally do: switch (value) { case 1: { ··· break; } case 2: { ··· break; } } Benefit: each case can declare its own variables, without having to worry about name clashes.
62
137
28
880
groupBy, but for plain objects in TypeScript
Here's a nice helper function function partition<T, U extends string>(arr: ReadonlyArray<T>, sorter: (el: T) => U): { [K in U]: T[] | undefined } { The callback returns a property key; the resulting object has each element in the corresponding property array
5
20
M.Potomin retweeted
Type predicates are just an annotation and aren't actually checked. Meaning you can do some pretty wacky and unsafe things. Is there an technical constraint preventing TS from checking these?
9
1
1
15
At the rate I am now convinced I have been breathing all wrong xitter.gq/OoneyAbraymen/status/1…
4,267
221,621
16,032
665,848
Has anyone tried intermittent fasting?
10
3
11
Yes. I have coffee for breakfast so I only start eating around lunch time and then get dinner and that's it. Also @mpotomin intermittent fasts like a beast.
1
1
Since few months, fasting for 14-16h almost every day, sometimes longer on the weekend. Allows me to melt some body fat and have bigger, more satisfying meals in the evening without counting calories. Still avoiding to eat ~too much~ sweets though - to prevent insulin spikes.
2
Honestly... I thought Ariana Grande was a font.
38
370
39
2,279
M.Potomin retweeted
Software development productivity has little correlation to how fast you can produce code. It's closer related to the total cost of ownership of that code. Some code, you can write in one hour, and then proceed to waste days or months maintaining and troubleshooting.
19
379
32
964
🤩Just published📜 CSS selectors cheatsheet & 🕹game. Feel free to print it out and stick it on the wall 🎑. Thanks, @iamryanyu for making the game. 🙏 👇&🕹: frontend30.com/css-selectors… 📖: medium.com/p/9593bc204e3f 👩🏻‍💻 Codepen codepen.io/nana8/pen/aXQgoj?… #css #cssselectors @CodePen – at Sydney, New South Wales
18
245
28
782
I wish more people would appreciate the power of copy&paste. DRY too often leads to plenty of "reusable helpers". But software grows and what seemed reusable in the beginning ends up with lots of branches inside. Copy&paste until you find the proper abstraction is a good default. – at Ottobrunn, Deutschland
dry code === show the shape of the problem dry code !== hide everything
17
104
7
416
Should I use SSR? What about Rehydration? Where should we implement logic and rendering in our applications? Answers: developers.google.com/web/up…
33
699
52
1,913
M.Potomin retweeted
It's completely FINE to learn "fundamentals" as you go. Everyone that disagrees with me is just gatekeeping. – at Sunnyvale, CA
17
52
4
432
A Reddit clone combining static frontend + serverless backend with MongoDB ✅ asperitas.now.sh/ github.com/d11z/asperitas
20
90
I absolutely love pair programming. Not because I learn what someone else is coding. I can do that from a review. I learn their keyboard shortcuts and extensions. You learn differ ways to troubleshoot and techniques on how they are efficient.
7
82
6
458
You can tell so much about a dev by looking at what kind of music they code to 🕵️
119
401
164
1,570
M.Potomin retweeted
To simulate enums in JS, you can use an object. But I often prefer to use consts. To me, consts read better, are easier to use, and I don't have to use hungarian notation to give the enum object a unique name. Here's an example of both patterns. #javascript
9
21
1
99