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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Five coding hats

93 点作者 pdubroy3 个月前

15 条评论

NotAnOtter3 个月前
I like analogy&#x27;s like this. Not in love with this specific one. It feels like OP thought of the first two hats and then tried to think up other hats, rather than have the nebulas idea of different ways of working and structured the analogy around it.<p>Analogies should &quot;simplify&quot; not complicate. If you&#x27;re ever writing an analogy and think &quot;How can I add more meat to this? You know, enough to make it worth sharing in a blog post?&quot; you&#x27;re on the wrong path.
评论 #42985416 未加载
disambiguation3 个月前
Putting on my nitpick hat:<p>I think scrappy and mcguyver could be the same hat.<p>I also think chef here is really craftsman, whereas chef makes me think of cooking, as in playful discovery, which is worth its own hat.<p>As someone else mentioned, war time &#x2F; emergency this is not a drill hat deserves a spot on the shelf.
评论 #42976719 未加载
gorjusborg3 个月前
I&#x27;d also add &quot;Surgeon&#x27;s hat&quot;:<p>Coding using only exacting, mechanical transformations that can be reasoned to be safe. Used when coding in poorly understood, mission-critical code bases. You do the bare minimum change to get the result, using verifiably safe operations.
评论 #42976492 未加载
Blackarea3 个月前
Looks like different flavors of doing it &quot;clean&quot; and going &quot;hacky&quot;. No real content here imo tbh - Hat analogy is fun though
pdimitar3 个月前
This could be formulated much better IMO but it&#x27;s good that OP gave us this to check out and comment on.<p>I&#x27;d simplify this to &quot;commercial hat&quot; and &quot;hobbyist hat&quot;, more or less, but there&#x27;s another axis entirely and that&#x27;s the hat OP kind of looks down on, namely &quot;chef&#x27;s hat&quot;.<p>Because making code readable and maintainable also makes it suitable for teaching and onboarding juniors -- or any other teammate really.<p>As a guy with 23 years in the profession I started getting sick of myself being a hobbyist at times so I just do whatever is needed for a code to work BUT I don&#x27;t keep it together with spit and 5-year old duct tape; I also give it some of the &quot;chef&#x27;s hat&quot; treatment. How much of the &quot;chef&quot; touch do you give it determines the readability and maintainability. And whether you or your employer care about those, well, this is where actual real-world nuance and spectrum come into play.
评论 #42982045 未加载
评论 #42980241 未加载
stevage3 个月前
That&#x27;s actually a pretty useful way to think about it all.<p>Probably the different hands vary from person to person.<p>The &quot;Chef&#x27;s hat&quot; reminds me of when you&#x27;re writing code for a publicly distributed library, with inline documentation. Making it look nice does matter.
zoogeny3 个月前
I too read de Bono&#x27;s Thinking Hats book and found it worth considering. It reminds me of Nietzsche&#x27;s Perspectivism [1]<p>I don&#x27;t think having a fixed set of N perspectives is the correct approach. Rather, it is often a good idea to understand that there are many perspectives to view things from and to encourage productive perspectives when possible.<p>One frustrating thing I find with people I consider closed minded is an insistence on viewing every single issue from a single unchanging perspective.<p>1. <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Perspectivism" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Perspectivism</a>
aqueueaqueue3 个月前
There is another hat: the space helmet. This is for the architecture astronaut. When you see the word Monad in Java code, this is likely them.
eamonobr3 个月前
I let copilot add onto this framework and liked it:<p>Detective&#x27;s Hat The detective&#x27;s hat is all about investigation and debugging. When you put on this hat, you&#x27;re diving deep into the code to find the root cause of a bug or issue. This involves a lot of patience, attention to detail, and sometimes a bit of intuition. You might use tools like debuggers, log analyzers, and performance profilers to track down elusive problems.<p>Architect&#x27;s Hat The architect&#x27;s hat is for designing systems and thinking about the big picture. With this hat on, you&#x27;re considering how different components of the system interact, scalability, maintainability, and future growth. This involves creating diagrams, writing design documents, and making decisions that will impact the project long-term.<p>Gardener&#x27;s Hat The gardener&#x27;s hat is about nurturing and maintaining code. This involves refactoring, cleaning up technical debt, and ensuring that the codebase remains healthy and manageable over time. It&#x27;s about pruning unnecessary parts and fostering good practices so that the code can grow sustainably.<p>Scientist&#x27;s Hat The scientist&#x27;s hat is for experimentation and research. When you wear this hat, you&#x27;re exploring new technologies, trying out different algorithms, or conducting performance benchmarks. It&#x27;s about being curious and methodical in your approach to discovering new solutions.<p>Librarian&#x27;s Hat The librarian&#x27;s hat is focused on documentation and knowledge sharing. With this hat on, you&#x27;re writing clear documentation, creating tutorials, and ensuring that information is easily accessible to others. This helps in building a knowledge base that can be referred to by team members or the wider community.<p>Diplomat&#x27;s Hat The diplomat&#x27;s hat is for collaboration and communication. When you wear this hat, you&#x27;re working with other teams, stakeholders, or clients to understand their needs and ensure that everyone is on the same page. It&#x27;s about negotiating requirements, managing expectations, and fostering a collaborative environment.
KerryJones3 个月前
This comes across more as styles than hats. Hat&#x27;s, typically, refer to a &quot;role description&quot;. Put on my &quot;eng manager hat&quot;, put on my &quot;product manager hat&quot;, not doing the same thing differently.<p>I&#x27;m not sure &quot;style&quot; is the right word, but &quot;hat&quot; feels like the wrong one.
user39393823 个月前
How about the hat where Prod is crashed, your heart is racing, and you throw caution to the wind because things can’t get any worse?
评论 #42976809 未加载
评论 #42976014 未加载
评论 #42976573 未加载
评论 #42978838 未加载
评论 #42980927 未加载
评论 #42983758 未加载
评论 #42975800 未加载
throwaway0923233 个月前
I think this is a very useful framework for &quot;choosing the right tool for the job&quot;.<p>For me personally, there isn&#x27;t much difference between the Chef&#x27;s Hat and the Teacher&#x27;s Hat; the way I make code presentable is the same as how I make it self-documenting. I can tell I did a good job if the person reading my code feels smart.
评论 #42981695 未加载
评论 #42976545 未加载
motorest3 个月前
What a wonderful and highly quotable link. I was looking for a good way to communicate these concepts and here it is. I think this ca be specially useful in PRs, when you have reviewers wearing a chef&#x27;s hat reviewing spike code that was written with a scrappy or macgyver&#x27;s hat.
fullstackwife3 个月前
There is another hat: cannot resist pigeonholing other people<p>once you get someone pigeonholed, it becomes a self fulfilling prophecy
评论 #42982003 未加载
评论 #42984341 未加载
em-bee3 个月前
what about the tightrope walker without a net for coding in production?