Using the 5S Principle in Coding
The article explores applying the 5S principle from lean manufacturing to coding with JavaScript examples. It covers sorting, organizing, maintaining, standardizing, and sustaining code for efficiency and maintainability using tools like ESLint and Git.
Read original articleThe article discusses the application of the 5S principle, derived from lean manufacturing, to coding practices. The 5S principles - Sort, Set in Order, Shine, Standardize, and Sustain - are explored in the context of coding using JavaScript examples. Sorting involves removing unnecessary items like unused code and dependencies. Setting in order focuses on organizing the codebase logically for efficiency. Shining emphasizes maintaining clean, readable code adhering to standards. Standardizing involves establishing consistent practices and naming conventions. Sustaining requires regular review and improvement of standards. Tools like ESLint, Prettier, and Git are recommended for implementing these principles. The article emphasizes the importance of continuous integration, code documentation, and automated testing for long-term adherence to these principles. Overall, the 5S principle can lead to cleaner, more efficient, and maintainable code in software development.
Related
Exposition of Front End Build Systems
Frontend build systems are crucial in web development, involving transpilation, bundling, and minification steps. Tools like Babel and Webpack optimize code for performance and developer experience. Various bundlers like Webpack, Rollup, Parcel, esbuild, and Turbopack are compared for features and performance.
Software Engineering Practices (2022)
Gergely Orosz sparked a Twitter discussion on software engineering practices. Simon Willison elaborated on key practices in a blog post, emphasizing documentation, test data creation, database migrations, templates, code formatting, environment setup automation, and preview environments. Willison highlights the productivity and quality benefits of investing in these practices and recommends tools like Docker, Gitpod, and Codespaces for implementation.
Self and Self: Whys and Wherefores (2009) [video]
The YouTube video discusses career and idea management, prioritization, Simula creation, structured programming, leadership in development, values in design, and efficient garbage collection. It mentions optimizing a Small Talk system in graduate studies.
Optimizing JavaScript for Fun and for Profit
Optimizing JavaScript code for performance involves benchmarking, avoiding unnecessary work, string comparisons, and diverse object shapes. JavaScript engines optimize based on object shapes, impacting array/object methods and indirection. Creating objects with the same shape improves optimization, cautioning against slower functional programming methods. Costs of indirection like proxy objects and function calls affect performance. Code examples and benchmarks demonstrate optimization variances.
Readability: Google's Temple to Engineering Excellence
Google's strict readability process involves code approval by maintainers and readability mentors, shaping coding standards. Despite criticism, it enhances skills, maintains quality, and fosters global code consistency. A proposed "Readability Lite" aims for mentorship and quality without strict enforcement.
Joking aside, I think this article does a decent job of translating Lean manufacturing principles to coding, but the "Set in Order" section grinds my gears a little bit. I have worked on many projects of various sizes, and I think my fellow web devs tend to lean too hard into an overly nested directory structure. In manufacturing terms, imagine if you needed to open a cabinet that contains a toolbox with a plastic organizer in one of the drawers that contains a box that you had to open to get access to some rivets. It doesn't take much for that level of organization to kneecap efficiency. I would much rather have a single directory with 20 files than try to chase down a component file that's eight directories deep. Give me a big list of long descriptive file names, not short names that rely on the directory name to give context.
It's not clear this article is empowering in that sense.
Instead of tracking/pleasing your boss, quality principles were stated and your job was to implement those principles, halting work as needed. This leads to problems being dealt with in time and in context, instead of being ignored or concealed. (Remind you of PG's distinction between being persistent vs. obstinate?) The difference lay not really in the major premise (the principles) but in how and when the minor premise of fault-correction was applied.
To me in software that's all about scheduling: scheduling infrastructure work and cross-training early, doing post-mortem's immediately, building design consensus iteratively with discussion and prototyping, etc. Scheduling and objectivity: not who's saying it, but what's being said. Both should empower IC's by giving them actual time and actual say.
In particular, clean code is often not the best, but can empower those otherwise bereft of natural authority. Sometimes duplication is better than dependencies, a little pile is better than a lot of structure, a complex PR is easier to review all at once, etc.
Empowering people makes selecting and orienting them quite important - but that's a separate issue.
The first four S's are all in the same semantic neighborhood: they all have to do with neatness, cleanliness and order. Basically they collapse into one. The last S, shitsuke, is just discipline.
"Be clean/neat/tidy, and have discipline".
Yay ...
All the math, software, and mechanical folks had to "5S their work area". Our manager gave us rolls of tape and a label printer so we could mark off where everything on our desk was supposed to be put away. The instructions we were handed showed marking off staplers and tape dispensers for desk jobs. It really was absurd!
They furloughed everyone in the company a few weeks later and I decided it really wasn't the place for me.
But I have to imagine this creates a lot of friction within a team, all trying to adhere to rules under the guise of efficiency, at great opportunity cost. And what's the ultimate impact to the customer? Do they care how elegant the codebase is?
It's worth noting what The Toyota Way is. It's a way to ensure high production quality. It is also slow. This is why Toyota effectively abandoned The Toyota Way in the mid 2000s, and why they were raked through the coals over recall issues in 2013. Growth.
If deadlines are involved, I struggle to see the argument for making view files beautifully atomic vs. say, making an improvement that adds customers / reduces churn.
Optimization is in >80% of all Software unnecessary, it is a nice to have feature.
What?
Related
Exposition of Front End Build Systems
Frontend build systems are crucial in web development, involving transpilation, bundling, and minification steps. Tools like Babel and Webpack optimize code for performance and developer experience. Various bundlers like Webpack, Rollup, Parcel, esbuild, and Turbopack are compared for features and performance.
Software Engineering Practices (2022)
Gergely Orosz sparked a Twitter discussion on software engineering practices. Simon Willison elaborated on key practices in a blog post, emphasizing documentation, test data creation, database migrations, templates, code formatting, environment setup automation, and preview environments. Willison highlights the productivity and quality benefits of investing in these practices and recommends tools like Docker, Gitpod, and Codespaces for implementation.
Self and Self: Whys and Wherefores (2009) [video]
The YouTube video discusses career and idea management, prioritization, Simula creation, structured programming, leadership in development, values in design, and efficient garbage collection. It mentions optimizing a Small Talk system in graduate studies.
Optimizing JavaScript for Fun and for Profit
Optimizing JavaScript code for performance involves benchmarking, avoiding unnecessary work, string comparisons, and diverse object shapes. JavaScript engines optimize based on object shapes, impacting array/object methods and indirection. Creating objects with the same shape improves optimization, cautioning against slower functional programming methods. Costs of indirection like proxy objects and function calls affect performance. Code examples and benchmarks demonstrate optimization variances.
Readability: Google's Temple to Engineering Excellence
Google's strict readability process involves code approval by maintainers and readability mentors, shaping coding standards. Despite criticism, it enhances skills, maintains quality, and fosters global code consistency. A proposed "Readability Lite" aims for mentorship and quality without strict enforcement.