TL;DR: Watch out for fancy language assumptions
The least surprise principle violation
Use good linters
Prefer declarative languages
Many programming languages favor laziness over readability and clean code.
You should use them with caution and trust your tests.
tools = [ "Amazon Codewhisperer", "Bard" # Notice the missing comma "ChatGPT", "Dalle-E" # Also here "Eliza" ] print(len(tools)) # This will output 3 print(tools) # ['Amazon Codewhisperer', 'BardChatGPT', 'Dalle-EEliza'] # Missing Commas act as hidden string concatenators
tools = [ "Amazon Codewhisperer", "Bard", "ChatGPT", "Dalle-E", "Eliza" ] # We added all the missing commas print(len(tools)) # 5 print(tools) # ['Amazon Codewhisperer', 'Bard', 'ChatGPT', 'Dalle-E', 'Eliza']
Many modern programming languages come with a significant amount of accidental complexity.
They are often optimized for writing code quickly, even though they may be prone to defects.
Unfortunately, when working with these languages, it is essential to exercise extreme caution.
Code Smells are my opinion.
A programming language is low level when its programs require attention to the irrelevant.
Alan J. Perlis
This article is part of the CodeSmell Series.
My new book about clean code is available for pre-order.
You will find several recipes like this one with a higher level of detail