<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: lxy-yz</title>
    <description>The latest articles on DEV Community by lxy-yz (@lxyyz).</description>
    <link>https://dev.to/lxyyz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F768933%2F681095e6-724c-4095-bdcf-03efd00d24ab.jpg</url>
      <title>DEV Community: lxy-yz</title>
      <link>https://dev.to/lxyyz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lxyyz"/>
    <language>en</language>
    <item>
      <title>A regret maximization framework</title>
      <dc:creator>lxy-yz</dc:creator>
      <pubDate>Sun, 17 Sep 2023 18:26:58 +0000</pubDate>
      <link>https://dev.to/lxyyz/a-regret-maximization-framework-5h3h</link>
      <guid>https://dev.to/lxyyz/a-regret-maximization-framework-5h3h</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.liallen.me/a-regret-maximization-framework"&gt;https://blog.liallen.me/a-regret-maximization-framework&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>careerdevelopment</category>
    </item>
    <item>
      <title>React state management in 3 lines</title>
      <dc:creator>lxy-yz</dc:creator>
      <pubDate>Sun, 17 Sep 2023 12:42:36 +0000</pubDate>
      <link>https://dev.to/lxyyz/react-state-management-in-3-lines-13fa</link>
      <guid>https://dev.to/lxyyz/react-state-management-in-3-lines-13fa</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;npm install unstated-next immer use-immer&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;create a &lt;code&gt;store.ts&lt;/code&gt; file with 3 lines of code (👇)&lt;/li&gt;
&lt;li&gt;🎉🎉🎉
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// store.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createContainer&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;unstated-next&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useImmer&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;use-immer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;createContainer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;useImmer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Have you ever experienced analysis paralysis in the world of React while trying to understand what &lt;a href="https://en.wikipedia.org/wiki/The_Paradox_of_Choice"&gt;The Paradox of Choices&lt;/a&gt; means? The fact that React is so unopinionated that it offloads the burden of having strong opinions onto you, the developer, who is responsible for building something more than a "Hello World" demo.&lt;/p&gt;




&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;Have you ever experienced analysis paralysis in the world of React while trying to understand what &lt;a href="https://en.wikipedia.org/wiki/The_Paradox_of_Choice"&gt;The Paradox of Choices&lt;/a&gt; means? The fact that React is so unopinionated that it offloads the burden of having strong opinions onto you, the developer, who is responsible for building something more than a "Hello World" demo.&lt;/p&gt;

&lt;p&gt;Every day, a new state management solution emerges, such as Redux, Mobx, React.Context, Jotai, Zustand, you name it. Each has its distinct features, which is why there are numerous online tutorials about them. However, the question remains: which one should we choose if we want to simply Get Stuff Done instead of getting stuck in an endless comparison rabbit holes?&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspiration
&lt;/h2&gt;

&lt;p&gt;If we can suspend our judgement temporarily and let go of the pride of winning the popularity contest for a moment, we may find something quite pragmatic from our peer frameworks. And of course, we will. There will always be inspirations to draw from others, similar to how they learn from React.&lt;/p&gt;

&lt;p&gt;In Vue 3, there is a new Composition API paired with Immer.js that literally turns Vue into React. See how Evan weaves his magic in just a few lines of code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;update&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useImmer&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Learn Vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Use Vue with Immer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://twitter.com/youyuxi/status/1493146218142208001"&gt;https://twitter.com/youyuxi/status/1493146218142208001&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Although it looks simple and clean, it doesn't provide much of a selling point to me because Vue and Immer.js have many similarities in terms of state mutations, especially &lt;em&gt;from a developer point of view&lt;/em&gt;. They both allow us to update state in a way that's similar to how we &lt;strong&gt;mutate&lt;/strong&gt; JavaScript objects, without working against the JavaScript language.&lt;/p&gt;

&lt;p&gt;But how about React? Could it be possible to bring the same idea to React and make React more Vue-ish?&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;Turns out, it's not that difficult to achieve (you only need 2 libaries &lt;a href="https://github.com/jamiebuilds/unstated-next"&gt;https://github.com/jamiebuilds/unstated-next&lt;/a&gt; +  &lt;a href="https://github.com/immerjs/immer"&gt;https://github.com/immerjs/immer&lt;/a&gt;). It has the same benefit of using React.Context, unlike hooks, state can be shared across components. What is more is that it enhances React.Context with Immer so that you can update state just like you’re mutating object in JavaScript.  &lt;/p&gt;

&lt;p&gt;Additionally, it enhances React.Context with Immer, allowing you to update state just like you would mutate an object in JavaScript. Think of it as replacing React's &lt;code&gt;setState&lt;/code&gt; with Immer's &lt;code&gt;update&lt;/code&gt; function, while everything else remains the same.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./store&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="c1"&gt;// useContainer is a React hook from https://github.com/jamiebuilds/unstated-next &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;update&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useConatiner&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Learn React&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Use React with Immer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://twitter.com/radicalblind/status/1699581033996562800"&gt;https://twitter.com/radicalblind/status/1699581033996562800&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Embrace simplicity by not fighting against the language. Boost productivity by avoiding decision-making. Easy peasy.&lt;/p&gt;

&lt;p&gt;Thanks for reading. Until next time 👋&lt;/p&gt;

</description>
      <category>react</category>
    </item>
    <item>
      <title>How to be regretful from a 5 YOE</title>
      <dc:creator>lxy-yz</dc:creator>
      <pubDate>Sun, 17 Sep 2023 12:40:41 +0000</pubDate>
      <link>https://dev.to/lxyyz/how-to-be-regretful-from-a-5-yoe-31dd</link>
      <guid>https://dev.to/lxyyz/how-to-be-regretful-from-a-5-yoe-31dd</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;My &lt;strong&gt;regret maximization&lt;/strong&gt; recipe&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Specializing prematurely by going with the flow&lt;/li&gt;
&lt;li&gt;Cracking LeetCode to let the market decide what’s best for you&lt;/li&gt;
&lt;li&gt;Learning Vim to impress others&lt;/li&gt;
&lt;li&gt;Avoiding examining your beliefs&lt;/li&gt;
&lt;li&gt;“It can’t be my fault.”&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Following the footsteps of the legendary investor Munger who delivered a speech about &lt;a href="https://jamesclear.com/great-speeches/how-to-guarantee-a-life-of-misery-by-charlie-munger"&gt;how to guarantee a life of misery&lt;/a&gt;, I’ve stumbled across the formula for a career of regrets. I had my skin in the game, i.e. 5 years of continuous mistakes backed by ignorance and folly, to assure me its effectiveness. If you’re looking for a recipe to minimize regret, stop reading here and consider forwarding a resume to Jeff Bezos instead.&lt;/p&gt;

&lt;p&gt;Let’s debrief how my regret maximization framework works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Going with the flow
&lt;/h2&gt;

&lt;p&gt;One of the biggest mistakes I made early in my career is specializing too soon. In hindsight, albeit a painful realization, it all makes sense by going with the flow. I won't delve into the broader debate between specialists and generalists here, but a &lt;a href="https://twitter.com/patio11/status/936628610474983424"&gt;tweet&lt;/a&gt; by @Patio11 encapsulates it well: 'People underestimate how effective a generalist can be at things which are done by specialists. People underestimate how deep specialties can run.'.&lt;/p&gt;

&lt;p&gt;I had zero experience about web development until I was introduced to React and Node.js in my first internship. Since then, I've specialized in frontend web development, regardless of what my job title might suggest.&lt;/p&gt;

&lt;p&gt;However, the challenge arises during those meetings where you're frequently asked to introduce yourself to different groups. What do you mention beyond your name? Often, it's nothing more exciting than 'I'm X, and I work as a Y at Z.' Yet, this 'Y' designation becomes an integral part of our identity, translating into our credentials at work, and it's often remembered faster than our names.&lt;/p&gt;

&lt;p&gt;If we don't define our own priorities, someone else will do it for us. &lt;strong&gt;Our environment plays a significant role in shaping our behavior and values&lt;/strong&gt;, ****even if the cues are subtle. An example of this is job credentials being omnipresent, from internal employee portals and messaging platforms to our external LinkedIn profiles. Our personal preferences matter little, as long as they convey to our managers, teammates, and HR what they can expect from us.&lt;/p&gt;

&lt;p&gt;The more specialized you become in a particular domain, the more tasks within that domain are assigned to you, propelling your growth toward becoming an expert. This creates a self-reinforcing cycle that benefits overall productivity, making it irrational for your employer not to do it. The flywheel perpetuates unless you consciously put it on hold.  It’s easy to put the hat on, but much harder to remove it.&lt;/p&gt;

&lt;p&gt;I eventually came to the realization that not hating what I'm doing isn't the same as being passionate about it. The cost of this realization was several years invested in the wrong direction. This late awakening can be attributed to a lack of self-accountability in determining what truly matters to me, leading to a default 'going with the flow' mentality and causing lots of anxiety and pains.&lt;/p&gt;

&lt;h2&gt;
  
  
  Money, not your heart
&lt;/h2&gt;

&lt;p&gt;No doubt money is important. But software engineers are paid quite generously in the US and many other places. Once you cross certain income threshold, you reach a point of diminishing returns where other psychological factors kick in and become substantial to your drive.&lt;/p&gt;

&lt;p&gt;I had a weird relationship with LeetCode - an online technical interview preparation platform. When it comes to cracking a coding interview, I doubt if there’s anything more effective than practicing LeetCode. But it’s a rather contentious take.&lt;/p&gt;

&lt;p&gt;Many people simply can’t accept the fact that a brilliant hacker could fail a Google interview because of not knowing how to reverse a binary tree. I’m one of those people because it reminds me of the old days of memorizing textbooks to pass exams in China. It’s a misfortune when we’re trapped in a rigid system like this, all under the guise of identifying talents (by rejecting real talent).&lt;/p&gt;

&lt;p&gt;Despite my contempt about the LeetCode style technical interviews, I still used the platform to prepare my interviews before. I can’t find better reason other than peer pressure and survivorship bias prevalent on the internet. Many share success stories of hopping between jobs to secure higher salaries, creating pressure to follow suit.&lt;/p&gt;

&lt;p&gt;However, every time I tackled these coding questions, an inner voice questioned, "What on earth are you doing with your life, wasting it on these mechanical problems?" I found no excitement in solving them. Even when I received job offers, I didn't feel proud. It's a peculiar feeling that not everyone can relate to. It raises a fundamental question: What's the purpose of pursuing something that neither your current nor future self enjoys?&lt;/p&gt;

&lt;p&gt;To be fair, LeetCode does deliver on its promise as an interview preparation platform. However, the value you derive from it depends on how well it aligns with your personal values. For those whose values don't align with the current interview system's emphasis on algorithmic challenges, I suggest not sacrificing your peace of mind if money isn't your top priority. Instead, let your heart guide your actions, not the market. &lt;/p&gt;

&lt;p&gt;You'll find much greater happiness by staying congruent with your values.&lt;/p&gt;

&lt;h2&gt;
  
  
  Impressing others, not yourself
&lt;/h2&gt;

&lt;p&gt;As we step out of school and into the professional world, we often find ourselves standing on a blank slate with limited knowledge about the chosen field, yet surrounded by lofty expectations. We don’t always recognize the insecure novice within us, but we do see the need to outshine our peers. After all, who wants to be viewed as an imposter?&lt;/p&gt;

&lt;p&gt;This was the backdrop of my early career, and I felt compelled to take action. I decided to emulate what I believed many great programmers would do - I embarked on the journey of learning Vim (apologies to Emacs enthusiasts), a text editor beloved and crafted by hackers. I was convinced that this was the path to greatness.&lt;/p&gt;

&lt;p&gt;The learning curve is a bit deep but that’s to be expected for taking “the road less traveled”. The allure of dancing on the keyboard shortcuts was addictive, and I poured countless hours into refining my vimrc file, much like a musician fine-tunes their instrument. Besides, &lt;strong&gt;the motivation isn’t grounded on personal growth, but rather a desire to impress others.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It was a humbling realization that the connection I had drawn between great programmers and the tools they used was completely flawed. I did not emerge as a Vim guru or a superior programmer. The delusion of superiority driven by personal preferences is, to put it mildly, counterproductive. Falling into the vanity trap of constant comparison distracted me from the actual work needed to improve my craft - skills can only earned through the sweat equity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don’t examine your beliefs
&lt;/h2&gt;

&lt;p&gt;Companies often establish guiding tenets like "Own it," "Do the right thing," or "Have Backbone; Disagree and Commit" to aid decision-making. These principles ring true because they can be interpreted in various ways. &lt;/p&gt;

&lt;p&gt;However, it's crucial to realize that corporate values don't necessarily align with your personal values. Merging them into a single mix can create problems.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do we genuinely want to take ownership of numerous tasks that no one else cares about, not even ourselves?&lt;/li&gt;
&lt;li&gt;Are we certain that penny-pinching on things that boost our productivity is the right course of action?&lt;/li&gt;
&lt;li&gt;Should we automatically oppose a colleague's opinion without first understanding the basis of their arguments?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I recall a friend who worked for a major tech company. He joined as a recent graduate, facing the common dilemma of navigating a new job. However, the company had a tenet that encouraged every employee to embrace ownership, aligning perfectly with his personal values. Consequently, he accepted every work request that came his way.&lt;/p&gt;

&lt;p&gt;The result? He became the designated owner of the team's on-call ticket queue, a repository of operational tasks that experienced colleagues shied away from. Despite this, he perceived tackling these tickets as a sign of productivity and excellence in his role. Additionally, he received positive feedback from peers for his ownership.&lt;/p&gt;

&lt;p&gt;However, his performance review told a different story. This disconnect between positive peer feedback and managerial evaluation prompted him to question what had gone wrong. How could he be held accountable for job performance that had deteriorated? He had always been lauded as a responsible student and friend before.&lt;/p&gt;

&lt;p&gt;Dealing with workplace issues is challenging, but even more so is accepting that a belief, once beneficial, may become outdated. Understand that every belief is context-dependent and warrants careful examination before becoming a part of your identity. Beware of fruitless debates like determining the best programming language, framework, or IDE. When we attach our identity to tools, we risk losing sight of the actual problems we're addressing.&lt;/p&gt;

&lt;h2&gt;
  
  
  A victimhood mindset
&lt;/h2&gt;

&lt;p&gt;This is the most powerful force that can counter all of above. By putting on this armor, no challenge or setbacks could ever approach us. Under its influence we’ll be rewarded with no self doubt, no responsibility, no rationality and so on.&lt;/p&gt;

&lt;p&gt;I couldn’t be more familiar with this, here are some examples I draw from personal  experience:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automated build failed? Flaky pipeline.&lt;/li&gt;
&lt;li&gt;Bug reports piling up? Go talk to the QA.&lt;/li&gt;
&lt;li&gt;Missing a deadline? Software is inestimable.&lt;/li&gt;
&lt;li&gt;Career ceiling? Favoritism.&lt;/li&gt;
&lt;li&gt;Disagreement with management/PM? They got no technical background.&lt;/li&gt;
&lt;li&gt;And the list goes on…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The common theme is clear - It’s always someone else’s fault. And the situation never improves; only getting worse. The resentment accumulates, the morale plummets, and eventually, the only viable choice seems to be leaving the place.&lt;/p&gt;

&lt;p&gt;But why leave? Because it’s the f*** toxic working environment’s fault.&lt;/p&gt;

&lt;p&gt;We will embark on a new journey, after a short honeymoon period, the same vicious circle repeats itself. I don’t know where exactly you’ll end, but in my case, it culminated a career collapse that marks the pinnacle of my regrets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: steering clear of regrets
&lt;/h2&gt;

&lt;p&gt;To summarize the key points I've shared:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Going with the flow results in a career scripted by external forces.&lt;/li&gt;
&lt;li&gt;Prioritizing money over your passion leads to inner conflict.&lt;/li&gt;
&lt;li&gt;Focusing solely on impressing others leads to a depletion of motivation.&lt;/li&gt;
&lt;li&gt;Neglecting to examine your beliefs risks squandering your efforts.&lt;/li&gt;
&lt;li&gt;Embracing a victimhood mindset can make you feel invincible, but it's a perilous illusion.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’ve testified above rules under different circumstances with reproducible regrettable outcomes. Maximum regret is achieved when all of them combined in synergy.&lt;/p&gt;

&lt;p&gt;However, I genuinely hope that no one has to go through this because it's an unpleasant experience. In parting, let me leave you with another quote from Mr. Munger:&lt;/p&gt;

&lt;p&gt;“All I want to know is where I'm going to die so I'll never go there.“&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>career</category>
      <category>programming</category>
    </item>
    <item>
      <title>Reverse engineering a GPT Bot</title>
      <dc:creator>lxy-yz</dc:creator>
      <pubDate>Sun, 09 Apr 2023 05:41:13 +0000</pubDate>
      <link>https://dev.to/lxyyz/reverse-engineering-a-gpt-bot-5f22</link>
      <guid>https://dev.to/lxyyz/reverse-engineering-a-gpt-bot-5f22</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.liallen.me/reverse-engineer-a-gpt-chatbot"&gt;https://blog.liallen.me/reverse-engineer-a-gpt-chatbot&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Talk to ChatGPT in BDD</title>
      <dc:creator>lxy-yz</dc:creator>
      <pubDate>Tue, 21 Feb 2023 06:16:03 +0000</pubDate>
      <link>https://dev.to/lxyyz/talk-to-chatgpt-in-bdd-4a7d</link>
      <guid>https://dev.to/lxyyz/talk-to-chatgpt-in-bdd-4a7d</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.liallen.me/talk-to-chatgpt-in-bdd" rel="noopener noreferrer"&gt;https://blog.liallen.me/talk-to-chatgpt-in-bdd&lt;/a&gt;&lt;/p&gt;

</description>
      <category>chatgpt</category>
      <category>ai</category>
    </item>
    <item>
      <title>What’s your favorite reading list in 2022</title>
      <dc:creator>lxy-yz</dc:creator>
      <pubDate>Sat, 07 Jan 2023 22:18:09 +0000</pubDate>
      <link>https://dev.to/lxyyz/whats-your-favorite-reading-in-2022-32mh</link>
      <guid>https://dev.to/lxyyz/whats-your-favorite-reading-in-2022-32mh</guid>
      <description>&lt;p&gt;Inspired by YouTuber Ali Abdaal’s &lt;a href="https://twitter.com/AliAbdaal/status/1607711663645417473"&gt;tweet&lt;/a&gt;, which is an &lt;strong&gt;awesome&lt;/strong&gt; reading list to me, I compiled a list of articles that I personally get inspired the &lt;strong&gt;most&lt;/strong&gt; in 2022 &lt;a href="https://blog.liallen.me/2022-articles"&gt;https://blog.liallen.me/2022-articles&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Curious to see what’s yours 🧐? Excited to learn from them!&lt;/p&gt;

</description>
      <category>reading</category>
      <category>learninpublic</category>
    </item>
    <item>
      <title>React Vite Starter kit for app or component library</title>
      <dc:creator>lxy-yz</dc:creator>
      <pubDate>Tue, 13 Dec 2022 14:58:44 +0000</pubDate>
      <link>https://dev.to/lxyyz/react-vite-starter-kit-for-app-or-component-library-5bo9</link>
      <guid>https://dev.to/lxyyz/react-vite-starter-kit-for-app-or-component-library-5bo9</guid>
      <description>&lt;p&gt;I created some light weight starter kits for building app/libs with React + Vite. Hope it helps. &lt;a href="https://blog.liallen.me/vite-3-react" rel="noopener noreferrer"&gt;https://blog.liallen.me/vite-3-react&lt;/a&gt;&lt;/p&gt;

</description>
      <category>marketing</category>
      <category>socialmedia</category>
    </item>
    <item>
      <title>File system based routing with webpack</title>
      <dc:creator>lxy-yz</dc:creator>
      <pubDate>Tue, 06 Dec 2022 05:51:20 +0000</pubDate>
      <link>https://dev.to/lxyyz/file-system-based-routing-with-webpack-3k01</link>
      <guid>https://dev.to/lxyyz/file-system-based-routing-with-webpack-3k01</guid>
      <description>&lt;p&gt;Ever missed nextjs style file system based routing in webpack?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://blog.liallen.me/file-system-based-routing-with-webpack"&gt;https://blog.liallen.me/file-system-based-routing-with-webpack&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/lxy-yz/webpack-fs-routes-plugin"&gt;https://github.com/lxy-yz/webpack-fs-routes-plugin&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Heroku👋 Fly.io</title>
      <dc:creator>lxy-yz</dc:creator>
      <pubDate>Tue, 06 Dec 2022 05:49:21 +0000</pubDate>
      <link>https://dev.to/lxyyz/heroku-flyio-3n9h</link>
      <guid>https://dev.to/lxyyz/heroku-flyio-3n9h</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.liallen.me/bye-heroku-hey-flyio"&gt;https://blog.liallen.me/bye-heroku-hey-flyio&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Debugging Life Problems</title>
      <dc:creator>lxy-yz</dc:creator>
      <pubDate>Thu, 09 Jun 2022 03:25:40 +0000</pubDate>
      <link>https://dev.to/lxyyz/debugging-life-problems-10m0</link>
      <guid>https://dev.to/lxyyz/debugging-life-problems-10m0</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;It is a painful thing&lt;br&gt;
To look at your own trouble and know&lt;br&gt;
That you yourself and no one else has made it &lt;br&gt;
-- Sophocles, Ajax&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nhs0Nyve--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hopw5w4sb812119jrr9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nhs0Nyve--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hopw5w4sb812119jrr9.png" alt="Image description" width="480" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Debugging, despite being one of the most valuable engineering skills to have for programmers, is a hard science to master. But what’s the matter with life?&lt;/p&gt;

&lt;p&gt;We know that life is just like mountain climbing, filled with all sorts of ups and downs. There are moments or periods of time we are suffering badly that we want to know the reason desperately. The process of figuring out the why of those life struggles is similar to how programs are debugged. To debug effectively, we need to stabilize the error first, or in other word, make it reproducible. Many bug reports mandate reproduction examples. Anthony Fu had a great &lt;a href="https://antfu.me/posts/why-reproductions-are-required"&gt;article&lt;/a&gt; explaining the why. Equally in life, if the same mental problem consistently drains our motivation, it might be a good time to dive a bit deeper than simply tolerate it.&lt;/p&gt;

&lt;p&gt;However, we know that the root cause of a bug may not be on the surface, it could lurk somewhere deep. If we only look at what goes wrong at the moment, which is what people tend to do, we might only catch the surface. If we attempt to fix what’s on the surface, say having a workaround with some hard coded values, it may get the test suites to pass, but it’s a false positive. Instead, we need to understand what brings us to the situation. In program, we get the help from reading stack trace. In life, a series of events or choices we’ve made in the past may give us more clue. To leverage stack trace for debugging, we need some degree of “&lt;a href="https://en.wikipedia.org/wiki/Logging_(software)"&gt;logging&lt;/a&gt;”. This is usually done by searching our memories. The problem with counting on memories is that they &lt;a href="https://www.psychologytoday.com/us/blog/hidden-motives/201203/unreliable-memory"&gt;aren’t as reliable&lt;/a&gt; as we would wish. This is where journaling comes into the scene. It may require a bit extra effort, but it gives a more undistorted view of what had happened before.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8n0DbqQ2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vrta8luaf6h1uhu5vtrp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8n0DbqQ2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vrta8luaf6h1uhu5vtrp.png" alt="Image description" width="880" height="442"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When debugging computer programs, those “Caused by” lines worth more attention. The lowest caused by may often be the root cause, besides they hide deeply that you need a lot of &lt;strong&gt;patience&lt;/strong&gt; to uncover them. Similarly, &lt;a href="https://en.wikipedia.org/wiki/Five_whys"&gt;five whys&lt;/a&gt; is a good technique for root causing real world issues, including the struggles we’re dealing with. Patience is the key, don’t panic.&lt;/p&gt;

&lt;p&gt;After carefully analyzing the available evidences, we form our assumption. Making the right assumption is critical. For example, &lt;a href="https://sive.rs/my-fault"&gt;assuming it’s my fault&lt;/a&gt; is a good assumption while pointing fingers is not. When bugs popup, they’re much more likely caused by application code we wrote rather than framework or language constructs, thus it’s wiser to chop down the stack trace to lines associated with our own code. &lt;a href="https://en.wikipedia.org/wiki/Jeff_Atwood"&gt;Jeff Atwood&lt;/a&gt; even calls this  &lt;a href="https://blog.codinghorror.com/the-first-rule-of-programming-its-always-your-fault/"&gt;first rule of programming&lt;/a&gt;. When things didn’t work as expected, like when betrayal happens or relationship sinks, it’s always more rational to take the responsibility to reflect on ourselves rather than blaming others. This isn’t easy either, our ego will keep us blind from our mistakes. Self-defense is part of human nature, but true growth often comes from taking the harder road. &lt;/p&gt;

&lt;p&gt;Don’t forget to validate our assumptions. It’s usually done by taking actions and reviewing results. Again, journaling helps. It could be a repeated process since we might fail a couple times and our assumptions turned out to be totally wrong. But persistence is the key, as long as there is progress, we’re slowly moving towards the goal. Eventually the bug will be fixed, time to party right? Yes, but hold on for a second. Conducting a post-mortem reflection that summarizes lessons learnt, plus diligently asking ourselves where else in our life the same lesson can be applied, this will curate a long-term thinking that our future selves will be grateful for and save us from making the same mistake again.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Fitting goals into a job, not in it</title>
      <dc:creator>lxy-yz</dc:creator>
      <pubDate>Sat, 09 Apr 2022 05:01:07 +0000</pubDate>
      <link>https://dev.to/lxyyz/fit-goals-into-a-job-not-in-it-2iga</link>
      <guid>https://dev.to/lxyyz/fit-goals-into-a-job-not-in-it-2iga</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Programming into a language, not in it.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I came across this concept in Code Complete 2 and it resonates deeply with me. A language is just a mean towards a goal (e.g. communication). Regardless it is a human language to connect human, or programming language to instruct computers. Without knowing what the end purpose is, we can hardly assign any meaning to the process. &lt;/p&gt;

&lt;p&gt;In the meantime, same as any other tools in life, it comes with constraints and limitations. If we simply programming “in” the language, we are guaranteed to be bound by the limitations of the language and stuck at the implementation details. In order not to lose sight, we should always stay close to the problem we’re aiming to solve. After all, if the problem isn’t worth solving, why are we bother spending time on it at all. &lt;/p&gt;

&lt;p&gt;The same idea applies to job as well. Lots of jobs are filled with mundane tasks and not designed for intellectual growth. When I first enter the workplace, I have no idea about what a job is. I told myself that as long as I am willing to grow, the rest will follow. However, that is simply not true. Later I realized that I set the expectation too high on a job. There might be some job full of excitement and challenges, but that’s not for ordinary people. Dream job, if there is any, doesn’t come easy.&lt;/p&gt;

&lt;p&gt;If we can’t control what we are asked to do in a job, what else can we do? Complaining about the system is broken? Fuck no, this is the least useful thing to do in life. Finding another job? It still feels like gambling though. Until recently, inspired by above quote, another option pops into my mind. It is simply taking a step back and thinking &lt;em&gt;very&lt;/em&gt; hard about our goals first, then fitting the goal into the job. They don’t need to align perfectly, in fact, most of time they don’t. But the priority is clear. I got to admit that this is easy to say than done due to all the ambiguities to deal with when setting goals, but it’s a necessary step to redefine what a job actually means in our life.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why we {}</title>
      <dc:creator>lxy-yz</dc:creator>
      <pubDate>Fri, 25 Mar 2022 16:38:02 +0000</pubDate>
      <link>https://dev.to/lxyyz/why-we--5fdj</link>
      <guid>https://dev.to/lxyyz/why-we--5fdj</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;a href="http://paulgraham.com/vb.html"&gt;Life is short&lt;/a&gt;&lt;/strong&gt; so&lt;/p&gt;

&lt;p&gt;If you {} for &lt;a href="https://en.wikipedia.org/wiki/The_Bread"&gt;bread&lt;/a&gt; , I can understand, so do I.&lt;/p&gt;

&lt;p&gt;If you {} for &lt;a href="https://www.indiehackers.com/"&gt;making&lt;/a&gt;, I can understand, much want I.&lt;/p&gt;

&lt;p&gt;If you {} for &lt;a href="https://youtu.be/8R02NE050Jk"&gt;craftsmanship&lt;/a&gt;, I can understand, with much respect.&lt;/p&gt;

&lt;p&gt;If you {} for &lt;a href="http://paulgraham.com/genius.html"&gt;interest&lt;/a&gt;, I can understand, a bit jealous maybe.&lt;/p&gt;

&lt;p&gt;If you {} for … I’m not sure … 🤔&lt;/p&gt;

&lt;p&gt;If you {} for [], sorry forgive me, I can’t understand it. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;{}, [] are placeholders. E.g. replace {} with Coding, [] with LeetCode&lt;/li&gt;
&lt;li&gt;Inspired by reading &lt;a href="https://en.wikipedia.org/wiki/The_Moon_and_Sixpence"&gt;The Moon and Sixpence&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
