Understanding state management is definitely like the final boss of the frontend framework game. It is sometimes to hard to wrap your head around, but it need not be.

In Flutter world, I blame BloC to be have made the thing very convoluted for beginners to understand. Image
Step 1 of understanding state should be to separate state from UI.

Many over-powered state management frameworks have mechanisms of _constructing UI from state_, which is useful for seasoned devs, but hinders beginners from learning what happens under the hood
Frameworks like Vue or Flutter which have internal mechanism of state inside their components/widgets (i.e. the UI primitives), also has a downside. People start off thinking state as a part of UI primitives, which it isn't at all.
Best if your UI primitives have no mechanism of carrying state, that way, beginners learn to manage the UI tree and the state separately from each other.
Most tutorials consider beginners too naive to be told about state management to in the beginning, and beat around the bush, thus leading them into storing state inside UI tree.

And then people write blogs and wax eloquent about learning to "life state up".
Today I see the whole herd of junior Android developers running into Jetpack Compose (which is just Flutter rewritten in Kotlin), and entangling themselves into callback hells for the same reason.

The older folks then tell them "ah you need to learn to life the state up".
None of this would happen if people are simple taught to deal with state and UI tree separate from each other.

Do not guard beginners from the perils of state management by not teaching them about it early on.

Heck, send them to stately.ai/viz before teaching UI.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Arnav Gupta 😷 💉🟢 💉🟢

Arnav Gupta 😷 💉🟢 💉🟢 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @championswimmer

Jan 26
If you product is primarily a mobile app, and you care about giving mobile users a great experience - read on

I have been working/consulting on a bunch of mobile apps, some with over 100M users, and I want to talk about lifecycle management, from a product PoV.

A thread 🧵👇
Let us start with an important fact - most of your power users will be having 12-15 commonly used apps on their phone.

If your users are heavy mobile users, they will have some form of social media addiction - TikTok, Instagra, Snap or Twitter.
The current state of mobile internet users is that they spend a TON of time on their screens, but they switch apps very fast (EXCEPT for the doomscrolling apps).

Attention spans have grown increasingly smaller.

This is from 5 years ago btw

venturebeat.com/2016/07/11/you…
Read 31 tweets
Jan 25
I put Rs. 1 lac into @bharatpeindia #TwelvePercentClub and then shared this information on Twitter.

Earned more via referral cashbacks than I have from interest from the principal till date 😅😅 Image
By the way, if you want to invest into #TwelvePercentClub, you can use this link

twelveclub.onelink.me/2Cmd?pid=af_ap…

Note that this is P2P lending, and thus isn't 100% risk free. But it has been 6 months for me now, no defaults yet, everyday it increases by Rs. 33
I do like the liquidity though - the app allows me to withdraw entire amount (principal + interest) at any time. I have tried doing it with Rs. 1k first and have seen it works before putting Rs. 1L here.
Read 6 tweets
Jan 25
Wordle 0 4/6

⬜⬜🟨🟨⬜
⬜🟩⬜🟨⬜
🟩🟩⬜⬜🟩
🟩🟩🟩🟩🟩

Guess I'm gonna play all the wordles now!
Wordle 1 6/6

⬜⬜🟨⬜🟩
🟨🟩⬜⬜⬜
⬜🟩⬜🟨🟩
⬜🟩🟨⬜🟩
🟩🟩⬜⬜⬜
🟩🟩🟩🟩🟩
Wordle 2 6/6

⬜⬜⬜⬜⬜
⬜⬜🟨⬜⬜
🟩🟩⬜⬜⬜
🟩🟩⬜🟨⬜
🟩🟩⬜⬜🟩
🟩🟩🟩🟩🟩
Read 5 tweets
Jan 24
There used to be an internet once full of blogs, informative websites, and was true to the premise of internet being a place to search and get to know about anything.

A small cafe owner writing about recipes they experimented with or a woodworker reviewing varnishes..
Today capitalism has killed that internet. Every venture funded company has a marketing department, and the marketing department has 2 departments, one that puts up ads on Google (called performance marketing) and another that writes blog posts (called organic).
Side note: It is extremely ironic that the meaning of the word "organic" is people coming to your website without you paying to do so (i.e. by showing them ads), but today's organic marketing involves paying as much as Google ads to a whole army of "content writers". How organic.
Read 7 tweets
Jan 18
Something common to be found in large Android codebases is dimens.xml file with contents that look like this

This is a major 🚩🚩🚩🚩

It originates from overzealous developers not wanting to *hardcode pixel/dp in layout XMLs*, but it very counterproductive. Image
We need not be grammar-nazi like in our approach and go for a hard-rule on never to write android:layout_height=12dp kind of code, because from a readability perspective, there is no advantage of turning fig.1 into fig.2

@dimen/_24dp has to be 24dp right? What is the point? ImageImage
In fact, now we have opened ourselves to a whole different level of subterfuge in the code in the future.

What if, some day, (by mistake, not deliberately), someone changes these values. Perfectly possible under time-constraint, doing last-minute UI fixes. Image
Read 6 tweets
Jan 13
200 LeetCode questions in 3rd year of college.
FAANG/BigTech job in placements
2 yrs in India, then move to US (sponsored by that BigTech)
7-8 yrs of laid back 5hrs/day work, with 30-40 leaves a year and slowly climb to L5

That's how majority folks turn millionaires by 30
Doesn't sound sexy or cool. Sounds counterintuitive, that if it is that straightforward, then why aren't more people doing it ?

Well if my estimates are correct, every year at least 10000 (probably 20000) Indian techies are doing exactly that.
Don't mistake this as advice to follow this path. (Hell I didn't, myself).
Don't mistake this as an indication of this being "easy" either

Getting into those jobs is not 'easy'. The path is well known and well trodden, but takes time and effort.
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(