News for hackers. Stuff that matters.
Re:Five Coding Hats by throwaway092323 on Friday February 07, 2025 @11:59AM (#42974887)
I think this is a very useful framework for "choosing the right tool for the job".

For me personally, there isn't much difference between the Chef's Hat and the Teacher'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.

Re:Five Coding Hats by mmcdermott on Friday February 07, 2025 @02:33PM (#42976545)
I see one key difference. Teaching code should be stripped down to only what is required for what is being taught. Everything else must go.

You can see this dichotomy in Scheme. Versions <= 5 were teaching first, everything else second. Versions 6+ tried to do both.

Re:Five Coding Hats by ludston on Saturday February 08, 2025 @04:24AM (#42981695)
The difference is that code designed to be easy to read is not the same as code written to aesthetic principles. The easiest example of this I can think of is the difference between code that follows formal whitespace rules and code that gives variables long names so that it is easier to understand them. Or the difference between ensuring that none of the declarations at the top of a file are redundant vs ordering all of the function definitions such that they tell some kind of narrative.

Code can be aesthetic and yet hard to understand or ugly but obvious.