Hacker News new | past | comments | ask | show | jobs | submit login

  clean, adjective

    1. Free from dirt, stain, or impurities; unsoiled.
    2. Free from foreign matter or pollution; unadulterated.
    3. Not infected.
    4. Honest or fair, or showing that you have not done anything illegal
Clean isn't a word that can be used to describe software. It just doesn't have any relevance to an observable, objective quality of software. There is no definition of what 'clean' code is; you can't show me code and say objectively "this is not clean", because there's no real definition of "clean code". It's a loan word, seemingly to indicate a lack of desirability or quality. And it also implies things that don't have anything to do with software. But there really is no concrete example or evidence of what clean software is. So it's nonsense.

We talk about a computer "science". But in reality it's not a science, it's a cargo cult. We use imprecise language with no concrete definition of what we're actually saying and doing. And we wonder why the end result is so poor.




I always know I'm going to get a coherent and relevant argument when someone starts with a dictionary definition.

Most creative trades share a definition of clean that expands on #2, where 'foreign matter' includes items, not detritus. If you leave a toothbrush on your desk the desk is not clean, even if the toothbrush is still new in the wrapper. It can also mean 'cleared and ready to begin a new task', which is a step that would precede any mis-en-place work one might engage in before properly starting the task.

Clean means something beyond that in software. It's fairly well agreed upon. It's not in the dictionary. That doesn't invalidate it.


> It's fairly well agreed upon.

Then could you share that agreed-upon definition with me? And also, exactly how much is "fairly well" agreed upon? 60%? So would 2/5 of people disagree when you call some code unclean? Are there classes where they teach kids in school how to identify unclean code? Are there instructions on how to clean it up?

And most importantly, is there any kind of scientific research that shows the effects of unclean code? Or are humans just overly concerned with appearances, and make up their own rituals and reasons for whatever becomes habitual?


I had to ask ChatGPT what is the meaning of "cargo cult" Notwithstanding the fact that most of us don't know how ChatGPT collects data and follow cue from its output: "Originally a religious movement that emerged in Melanesia during World War II. The movement professed that Western technology and prosperity were result of supernatural powers" I don't scoff at people using the phrase "clean code". I know what is conveying. I do find ChatGPT supernatural.


So if I show you some code, you will be able to immediately point at the unclean code and tell me why it's unclean, and everyone else will agree with you?


The term clean is somewhat esoteric and leaves room for dissent. We also use the term "code smell" Which Wikipedia refers as: "Smells are certain structures in the code that indicate violation of fundamental design principles and negatively impact design quality" When people asked me about fundamental design principles I point them to S.O.L.I.D https://lostechies.com/wp-content/uploads/2011/03/pablos_sol...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: