LogoTRUONG PHAM
Home
Projects
Blogs
YouTube
Contact

Newsletter

Stay updated with technical artifacts and engineering insights.

LogoTRUONG PHAM

Building scalable software and sharing insights on technology & life.

Sitemap

  • Home
  • Projects
  • Blogs
  • YouTube
  • Contact

Connect

  • GitHub
  • LinkedIn
  • Email
  • YouTube

© 2024 TRUONG PHAM. © All rights reserved.

Privacy PolicyTerms of Service
Back
Blog #50: Frontend Is Not Easy – When Simplicity is the Ultimate Sophistication
50 FRONTEND LESSONS – HARD-EARNED EXPERIENCES

Blog #50: Frontend Is Not Easy – When Simplicity is the Ultimate Sophistication

The final lesson in the series: Why we need to treat Frontend like a true engineering discipline rather than just 'drawing interfaces'.

TP
Truong PhamSoftware Engineer
PublishedSeptember 20, 2024

This is the final article in my 50-sharing journey. The context is no longer a specific project, but the result of many years working as a Frontend Engineer. I want to conclude by analyzing a "Philosophy-driven Technical Decision" I have pursued throughout my career: Treating the Frontend as a complex engineering system instead of just a display layer.

The Problem: "Frontend is just a shell" – A Dangerous Prejudice

For many years, the prevailing prejudice was: "Logic sits on the Backend, Frontend just needs to call APIs and draw a pretty button." This prejudice lead to Frontend projects often not being properly invested in terms of Architecture, Testing, and Deployment processes.

The consequences were:

  • Code ballooning in proportion to features, turning into a massive technical debt.
  • Performance being ignored until users complained.
  • Talented developers wanting to switch to Backend because they felt Frontend "had nothing left to learn."

Options Considered

When faced with building a Frontend team for a long-term Enterprise project, I stood between 2 directions:

Option 1: UI-First Approach

  • Solution: Focus maximum effort on making the UI quickly, use existing libraries, and don't care too much about the underlying structure.
  • Pros: Extremely fast initial development speed. Business sees results immediately.
  • Cons: The project collapses after about 6-12 months because the code is unmaintainable. No scalability.

Option 2: Engineering-First Approach

  • Solution: Establish strict standards for Architecture (like Clean Architecture, Atomic Design), Monitoring (Performance Monitoring), and automated testing before writing the first line of UI code.
  • Pros: Sustainable system, runs smoothly at scale. Team has profound technical thinking.
  • Cons: High initial investment cost. Feature release speed in the early stages is about 30% slower. Fear of being seen as "Over-engineering."

Final Decision and Analysis

I have always chosen and defended Option 2.

// Example of a 'Technical Contract' for every Component
/**
 * Mandatory standards for a Core Component:
 * 1. Contains no business logic directly.
 * 2. Must have Unit Tests for UI states.
 * 3. Must pass Accessibility (A11y) checks.
 * 4. Must have render time measured using a Profiler.
 */
export const StandardComponent = ({ data, ...props }) => {
  useEffect(() => {
    perfMonitor.trackUsage(componentName); // Track actual performance
  }, []);

  return <View data={transform(data)} {...props} />;
};

Impact on Performance: Measuring and setting "Performance Budgets" (e.g., Bundle size not exceeding 200KB, LCP under 2.5s) turns performance from a "subjective" feeling into precise engineering numbers.

Impact on Maintainability: A 5-year-old Frontend project can still be easily upgraded in terms of libraries and refactored thanks to abstraction layers and test case coverage.

Impact on Team: Developers feel proud of their work. They see that making an "input field" run smoothly on 1,000 different devices is a high-level engineering problem, no less than designing a Distributed System on the Backend.

Epilogue for the 50-article series

Frontend is by no means easy. It is where art (Design), psychology (UX), and high-level engineering (JS Engine, Network, Browser Internal) intersect. Keeping everything "looking simple" for the user is the achievement of an extremely complex technical system underneath.

If I were starting my career over, I would still choose this path: the path of caution, meticulousness, and always valuing the technical essence of every line of code.

The 50-article journey of "Hard-earned Experiences" pauses here. Thank you for accompanying me through the ups and downs of the Frontend world. Remember: The code you write today is the legacy for your colleagues tomorrow.


Notes on the respect for the interface engineering profession.

Series • Part 50 of 50

50 FRONTEND LESSONS – HARD-EARNED EXPERIENCES

Blog #49: Surviving Black Box API – When you have to live with 'Instability'
45Blog #45: The Brutal Difference Between Staging and Production46Blog #46: Feature Flag – The 'Lifebuoy' for Risky Releases47Blog #47: Long-term Tab Crash – What happens when Users never close their Tabs?48Blog #48: Slow AI UX Fail – When User Experience can't wait for Artificial Intelligence49Blog #49: Surviving Black Box API – When you have to live with 'Instability'50Blog #50: Frontend Is Not Easy – When Simplicity is the Ultimate SophisticationReading
TP

Written by Truong Pham

Software Engineer passionate about building high-performance systems and meaningful experiences.

Read more articles