TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Using the 5S Principle in Coding

109 点作者 Gigacore10 个月前

18 条评论

codelikeawolf10 个月前
When I used to work in manufacturing, my company was <i>super</i> into Lean. I even ended up getting an ASQ Six Sigma Green Belt certification. My favorite thing to say to people when they asked what 5S stood for was &quot;Shove Stupid Shit Someplace Secret&quot;. In my experience, that wasn&#x27;t an entirely inaccurate interpretation.<p>Joking aside, I think this article does a decent job of translating Lean manufacturing principles to coding, but the &quot;Set in Order&quot; 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&#x27;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&#x27;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.
评论 #40931764 未加载
评论 #40929191 未加载
评论 #40928777 未加载
评论 #40928946 未加载
评论 #40933587 未加载
smithbits10 个月前
It&#x27;s worth keeping in mind that lean manufacturing and all the interesting things that Toyota did that get written up are about building cars. In software the equivalent process is compiling and deploying code. Writing software is equivalent to designing, prototyping and testing a car. So while there are many interesting lessons to learn they are about the deployment and running of code, not about writing it. In the mass manufactured automobile industry you spend more time and effort building the product than designing it. In software you spend much more time designing (specs, coding, testing, all that stuff) the product than deploying it. The lessons of lean manufacturing may not apply to design.
评论 #40932820 未加载
评论 #40933499 未加载
评论 #40931902 未加载
评论 #40937328 未加载
w10-110 个月前
Toyota practice had such impact because it empowered people to speak up.<p>It&#x27;s not clear this article is empowering in that sense.<p>Instead of tracking&#x2F;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&#x27;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.<p>To me in software that&#x27;s all about scheduling: scheduling infrastructure work and cross-training early, doing post-mortem&#x27;s immediately, building design consensus iteratively with discussion and prototyping, etc. Scheduling and objectivity: not who&#x27;s saying it, but what&#x27;s being said. Both should empower IC&#x27;s by giving them actual time and actual say.<p>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.<p>Empowering people makes selecting and orienting them quite important - but that&#x27;s a separate issue.
kazinator10 个月前
Seiketsu (清潔) doesn&#x27;t mean standardize; it means &quot;clean, hygienic, sanitary&quot;. You hear it in the negative: fuseiketsu means filthy.<p>The first four S&#x27;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.<p>&quot;Be clean&#x2F;neat&#x2F;tidy, and have discipline&quot;.<p>Yay ...
hahamrfunnyguy10 个月前
I worked for a manufacturing company that rolled out 5S. It seemed to make a lot of sense on the shop floor, but the executives had us doing the same thing the same way in engineering.<p>All the math, software, and mechanical folks had to &quot;5S their work area&quot;. 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!<p>They furloughed everyone in the company a few weeks later and I decided it really wasn&#x27;t the place for me.
mvkel10 个月前
This _feels_ good to a single dev working on a project, where the rules are intuitive, no explanation is needed, and deadlines are fluid.<p>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&#x27;s the ultimate impact to the customer? Do they care how elegant the codebase is?<p>It&#x27;s worth noting what The Toyota Way is. It&#x27;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.<p>If deadlines are involved, I struggle to see the argument for making view files beautifully atomic vs. say, making an improvement that adds customers &#x2F; reduces churn.
dragonwriter10 个月前
I think this has one of the cases where trying to minimalistic in examples actually defeats the purpose, e.g., in the &quot;Sort&#x2F;Seiri&quot; React examples, the state variable in the component and all the imports that are retained are actually unused (a state variable in a component with no mutation code is just a constant with extra work, useState is only used for that variable, and the React import -- assuming this is the current major version of React for the last two years -- also isn&#x27;t used [in older versions, it was needed for JSX to be used as a side effect even if the import wasn&#x27;t otherwise used, and its a reflex legacy pattern that a lot of people probably haven&#x27;t broken even with current react].)
darksaints10 个月前
This is the sort of thing that makes me love (or hate) a codebase. I just have to point out that this sort of thing is extremely easy to do with typed languages, and can be (but not inherently) a total nightmare with untyped languages. Types matter, not just for correctness, but also cleanliness, order, and ease of maintenance.
bhk10 个月前
Ugh. Instead of 10 files in one directory, scatter them across 13 subdirectories. An anti-pattern in my book.
评论 #40933117 未加载
cjfd10 个月前
The documentation example is a clear example of absurdity. This is just a multiplication that might as well be inlined in all places where it is needed and then the &#x27;standard&#x27; is applied and it turns into a 21 line hellscape that points out the obvious.
barbariangrunge10 个月前
5S is more about organizing your workspace, but this article is about organizing your work product. And it doesn’t say anything that isn’t standard dev practice, it just organizes the items under a strained 5S umbrella. Imho
评论 #40928658 未加载
评论 #40928772 未加载
progx10 个月前
Consistant error handling should be number 1. Followed by tests.<p>Optimization is in &gt;80% of all Software unnecessary, it is a nice to have feature.
agumonkey10 个月前
This is for small projects or intermediate level, what people do for larger systems ? how do you organize shared api constraints &#x2F; models &#x2F; tests, branching model, versioning scheme, data migrations in case of a large refactor, infrastructure change. Every aspects can lead to fragmentation, friction &#x2F; grind and bitrot.
osigurdson10 个月前
There is something about branded practice names that just instantly invokes a gag reflex. Too many times, the branding is for a reason: some programmer wants to elevate themselves into thought leadership, sell books (mostly filler of course), speaking engagements m, etc., while never really adding anything to the industry.
rolandog10 个月前
Great article! As someone who has inherited poorly documented and maintained codebases (and that has worked in the chemical engineering world), this article hits home on so many points. This should be normalized as best practice or at the very least regular time allotments should be given to make codebases less inscrutable.
评论 #40928694 未加载
评论 #40929423 未加载
deeviant10 个月前
&quot;We heard there wasn&#x27;t enough buzzwords in the software dev world, so we decided to import some buzzwords from other industries...&quot;
richrichie10 个月前
Anyone runs a zero inbox policy of email organization?
01HNNWZ0MV43FF10 个月前
`&#x2F;organisms&#x2F;`<p>What?
评论 #40934168 未加载
评论 #40936770 未加载