<?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: Gary Lu</title>
    <description>The latest articles on DEV Community by Gary Lu (@haikelei).</description>
    <link>https://dev.to/haikelei</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%2F1266365%2F1782fee4-52dd-4086-a7d9-e49e676bd4fa.jpg</url>
      <title>DEV Community: Gary Lu</title>
      <link>https://dev.to/haikelei</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/haikelei"/>
    <language>en</language>
    <item>
      <title>The Hidden Truth: Quality Issues Are Often Just Quantity Problems</title>
      <dc:creator>Gary Lu</dc:creator>
      <pubDate>Fri, 14 Jun 2024 09:46:55 +0000</pubDate>
      <link>https://dev.to/haikelei/the-hidden-truth-quality-issues-are-often-just-quantity-problems-2fc2</link>
      <guid>https://dev.to/haikelei/the-hidden-truth-quality-issues-are-often-just-quantity-problems-2fc2</guid>
      <description>&lt;p&gt;As a software engineer with nine years of experience, I've had the privilege of working with some truly exceptional developers. These colleagues have mastered the art of coding and consistently deliver high-quality software. However, I've also seen many others remain average and unremarkable. This disparity intrigued me, and I set out to understand the underlying reason.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Simple Concept
&lt;/h3&gt;

&lt;p&gt;After observing and analyzing my experiences, I discovered that the key difference often boiled down to a very simple concept: quantity. More specifically, the amount of practice, iterations, and exposure these experts had compared to their average counterparts. It wasn’t necessarily about innate talent or intelligence; it was about the sheer volume of work they put in.&lt;/p&gt;

&lt;h3&gt;
  
  
  Quantity: The Key to Quality
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What we often think of as quality problems are actually quantity problems. It's usually just a matter of not having enough, sometimes by several orders of magnitude.&lt;/strong&gt; Let me explain with a few examples:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Iteration and Improvement:&lt;/strong&gt; In my early years, I was part of an Android application development team. I noticed that the best developer in our team, who later became one of my best friends and mentors, constantly iterated on his work. The Android ecosystem is continually evolving, and every time Google introduced new features, he would enthusiastically go through all of them and pick a few to apply in our application. He never settled for the first solution; instead, he would write, test, refactor, and improve his code multiple times, always incorporating the latest technology. &lt;strong&gt;It was this relentless cycle of iteration that honed his skills and led to higher quality outcomes.&lt;/strong&gt;As a result, he grew faster than any other engineer I knew and eventually joined VIVO, one of China’s largest smartphone brand.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Exposure to Challenges:&lt;/strong&gt; The more projects and diverse problems a developer tackled, the better they became. Those who sought out additional projects, participated in hackathons, or contributed to open-source projects accumulated a wealth of experience. &lt;strong&gt;This varied exposure enabled them to approach problems from multiple angles and devise more effective solutions.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Feedback and Learning:&lt;/strong&gt; Developers who actively sought feedback and learned from their mistakes improved rapidly. In contrast, those who did the bare minimum and avoided critique stagnated. Regular code reviews, pair programming sessions, and mentorship were invaluable in accelerating their growth.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Misconception: Quantity vs. Quality
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The biggest misconception is thinking a quantity problem is a quality problem. This leads to the false hope that we can achieve our goals with clever tricks or cutting corners instead of increasing quantity.&lt;/strong&gt;That's when pseudoscience, superstition, and unnecessary complaints start to appear.  Many think that producing a large volume of work means sacrificing quality. However, my experience has shown that the opposite is often true. &lt;/p&gt;

&lt;p&gt;When I started picking up my English, I noticed Ruri Ohama, a successful English learner on YouTube. In her video &lt;a href="https://www.youtube.com/watch?v=NQlFIrSZiIE"&gt;"How I learned English by myself for free without studying" &lt;/a&gt; Ruri describes how she mastered English through consistent practice and exposure. She watched English movies, listened to music, and engaged in conversations with native speakers. This relentless practice and immersion significantly improved her fluency and the quality of her language skills. Ruri’s experience shows that the more you immerse yourself in an activity, the better you become at it.&lt;/p&gt;

&lt;p&gt;Another example is my favorite author, Keigo Higashino. Known for his captivating mystery novels, Higashino writes every day. This disciplined approach has produced a prolific body of high-quality work. His consistent writing practice allows him to explore new ideas and refine his storytelling techniques. Higashino’s daily writing habit demonstrates that the more you practice, the better you get, and the higher the quality of your output.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Quantity is the key to quality. Most quality issues boil down to not having enough of something on a smaller scale.&lt;/strong&gt; Understanding that can really change the way we approach learning anything. Instead of getting frustrated or anxious when you don’t meet your goals right away, remember that it often just takes more practice. Think about how Ruri Ohama improved her English by immersing herself in it every day, or how Keigo Higashino writes daily to hone his craft. &lt;/p&gt;

&lt;p&gt;So, next time you feel like giving up, just remember that sometimes, it’s simply a matter of putting in more reps. Keep at it, and the quality will come.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>vscode</category>
      <category>programming</category>
      <category>devops</category>
    </item>
    <item>
      <title>Why I Choose WebStorm Over VSCode</title>
      <dc:creator>Gary Lu</dc:creator>
      <pubDate>Thu, 13 Jun 2024 10:08:07 +0000</pubDate>
      <link>https://dev.to/haikelei/why-i-choose-webstorm-over-vscode-3flj</link>
      <guid>https://dev.to/haikelei/why-i-choose-webstorm-over-vscode-3flj</guid>
      <description>&lt;p&gt;As a front-end developer with four years of experience, I've often found myself as the odd one out in my team for my choice of IDE. While the majority of my colleagues surf the waves of Visual Studio Code (VSCode), I remain steadfastly committed to WebStorm. This decision is not a matter of stubbornness or resistance to change but is rooted in a decade-long journey of software development that has shaped my preferences and workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Decade with JetBrains IDEs
&lt;/h2&gt;

&lt;p&gt;My journey with JetBrains products began long before I delved into front-end development. From 2015 to 2021, I utilized Android Studio for developing Android applications. In the realm of Android development, it remains the top choice even today, and my preference was established during that period. &lt;br&gt;
Over the next two years, I ventured into backend and frontend development. For Java programming, IntelliJ IDEA was my first and unquestionable choice. However, in the frontend arena, while most of my colleagues use VSCode, my experiences have instilled in me a profound appreciation for the interaction design and feature set of JetBrains IDEs. &lt;br&gt;
As a result, I use WebStorm for developing frontend projects.&lt;br&gt;
Here are the key reasons why I continue to choose WebStorm over VSCode:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Seamless Transition from IDEA Products
&lt;/h3&gt;

&lt;p&gt;Having spent six years immersed in the JetBrains ecosystem, switching to WebStorm was a natural progression. The familiarity with the interface, shortcuts, and overall design significantly reduced the learning curve. The muscle memory and workflow efficiency I've developed over the years transferred seamlessly to WebStorm, allowing me to focus on coding rather than relearning an IDE.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Robust Out-of-the-Box Features
&lt;/h3&gt;

&lt;p&gt;One of the standout features of WebStorm is its comprehensive set of tools and features available right out of the box. Unlike VSCode, which relies heavily on extensions to achieve similar functionality, WebStorm provides a robust environment that includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Advanced JavaScript and TypeScript support&lt;/li&gt;
&lt;li&gt;Comprehensive code refactoring tools&lt;/li&gt;
&lt;li&gt;Built-in debugging and testing tools&lt;/li&gt;
&lt;li&gt;Seamless integration with version control systems&lt;/li&gt;
&lt;li&gt;Excellent support for modern frameworks like React, Angular, and Vue.js&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These features significantly enhance productivity and reduce the need to hunt for and manage multiple extensions.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Superior Code Analysis and Refactoring
&lt;/h3&gt;

&lt;p&gt;WebStorm excels in code analysis and refactoring capabilities. The IDE provides intelligent code completion, on-the-fly error detection, and powerful refactoring tools that are a cut above what VSCode offers through its extensions. This level of code insight is invaluable for maintaining high code quality and accelerating development.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Integrated Development Tools
&lt;/h3&gt;

&lt;p&gt;WebStorm's integration with build tools, task runners, and package managers is seamless. Whether it's Webpack, Gulp, npm, or Yarn, WebStorm handles these integrations with ease. The built-in terminal, database tools, and REST client further consolidate the development environment, making it a one-stop shop for all development needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Consistent Updates and Support
&lt;/h3&gt;

&lt;p&gt;JetBrains is known for its regular updates and excellent support. WebStorm receives frequent updates that bring new features, improvements, and bug fixes. The active community and responsive support team ensure that any issues are quickly addressed, providing a stable and reliable development environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;While VSCode is undeniably a powerful and popular IDE, my preference for WebStorm is deeply rooted in my extensive experience with JetBrains products. The seamless transition, robust out-of-the-box features, superior code analysis, integrated development tools, and consistent updates make WebStorm the ideal choice for my development needs.&lt;/p&gt;

&lt;p&gt;That said, I remain open to using VSCode if the need arises. For now, WebStorm satisfies all my work requirements and aligns perfectly with my workflow, giving me no compelling reason to switch. By sticking with WebStorm, I can leverage a decade's worth of familiarity and efficiency, enabling me to focus on what I do best—writing high-quality code.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>vscode</category>
      <category>programming</category>
      <category>devops</category>
    </item>
    <item>
      <title>Why Have You Chosen to Use a Message Queue?</title>
      <dc:creator>Gary Lu</dc:creator>
      <pubDate>Mon, 29 Jan 2024 06:20:40 +0000</pubDate>
      <link>https://dev.to/haikelei/why-have-you-chosen-to-use-a-message-queue-aoj</link>
      <guid>https://dev.to/haikelei/why-have-you-chosen-to-use-a-message-queue-aoj</guid>
      <description>&lt;p&gt;Sometimes during an interview, the interviewer might notice on your resume that you have experience using a message queue like Kafka, and then ask you why you chose to use a message queue. Before you answer this question, you should understand that what the interviewer really wants to know is your company's business scenario, the technological challenges you faced, how you addressed those challenges, and why you chose the solutions you did. After you provide the project background, you can then delve into the technology. There are three key points for using a message queue:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decoupling&lt;/li&gt;
&lt;li&gt;Asynchronous processing&lt;/li&gt;
&lt;li&gt;Peak shaving&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Decoupling
&lt;/h2&gt;

&lt;p&gt;Consider this scenario: System A sends a message to Systems B, C, and D using an API interface. What happens if System E also needs this message? Conversely, what if System C no longer requires the message? In this situation, the developer of System A may become overwhelmed.&lt;/p&gt;

&lt;p&gt;In this scenario, System A is tightly coupled with the other systems. However, if we use a message queue (MQ), System A can produce a message and send it to the MQ, completing its task. Regardless of which system needs the message, they can retrieve it from the MQ. If a system no longer requires the message, it can simply unsubscribe from it. None of these actions require System A's direct involvement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Asynchronous Processing
&lt;/h2&gt;

&lt;p&gt;In this scenario, when a user initiates a request from the frontend page, it takes 100ms in System A, 200ms in System B, 250ms in System C, and 300ms in System D. Consequently, the total processing time for this request is nearly 900ms, resulting in a poor user experience.&lt;/p&gt;

&lt;p&gt;Ideally, every operation initiated by the user should be handled within 200ms to ensure a seamless experience.&lt;/p&gt;

&lt;p&gt;By using a message queue (MQ), System A can receive the user request, process it in 100ms, and then send the result to the MQ, allowing Systems B, C, and D to handle the message asynchronously (within the bounds of business requirements). This approach reduces the overall processing time to just 100ms, transforming the user experience from awful to awesome.&lt;/p&gt;

&lt;h2&gt;
  
  
  Peak Shaving
&lt;/h2&gt;

&lt;p&gt;Every day from 12 AM to 12 PM, System A operates peacefully, with a query-per-second (QPS) rate of 50. However, at 12 PM, the QPS suddenly spikes to 5000 or more. This surge in requests places significant stress on the database queries.&lt;/p&gt;

&lt;p&gt;When using MySQL, a single MySQL architecture can handle 2000+ queries per second, which represents its upper limit. A QPS of 5000+ would cause the system to break down. However, after the peak, the QPS returns to a lower rate, around 50+ QPS.&lt;/p&gt;

&lt;p&gt;In this scenario, if we use a message queue (MQ), during the peak time of 5000 requests per second, the system can handle 2000 requests per second, leaving 3000 requests to be stored in the MQ. Over the course of an hour, the MQ would store millions of messages, preventing the system from breaking down during peak times. After this period, System A would process the remaining messages until all have been handled.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;While message queue (MQ) offers several advantages as discussed above, it introduces complexities and potential new issues. Apart from the mentioned benefits, its implementation can reduce system availability. Once integrated into your system, MQ becomes a core component, necessitating measures to ensure its stability and prevent breakdowns.&lt;/p&gt;

&lt;p&gt;Another challenge that may arise is the issue of consistency. Due to the decoupling and asynchronous nature of systems, it's possible for some components, such as Systems A and C, to process successfully while others, like Systems B and D, encounter failures. In such cases, a compensation mechanism may be necessary to address this situation, although the specific approach will depend on the nature of your project.&lt;/p&gt;

&lt;p&gt;Ultimately, as with any technology, there are both positive and negative aspects to consider when implementing a message queue.&lt;/p&gt;

</description>
      <category>kafka</category>
      <category>java</category>
      <category>interview</category>
    </item>
  </channel>
</rss>
