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 teapawt.org/OoneyAbraymen/status/1…
4,270
221,828
16,032
666,362
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
965
🤩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
246
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
окей, я настолько устала от лезущего из всех щелей стереотипа про «русское кино — говно», что здесь будет 📀тред📀 1 лайк — 1 крутой российский (и иногда снгшный) фильм (или сериал)
206
2,218
166
9,615
Since y'all eagerly awaiting hooks anyway, here is a new blog as distraction: "UI as an afterthought" Or: how will React context and hooks change the game of state management? michel.codes/blogs/ui-as-an-… #reactjs #MobX
13
73
11
202
M.Potomin retweeted
neat trick to detect if your browser supports modern features! i learn so much from asking stupid questions 🙇🏻
depends on your CSP config. but if you can't use eval, just do this — same outcome
2
5
37