Language Smells

Watching this video about the future of JavaScript, i liked one cite “The human compiler, at work.” from Paul Graham so much, that i googled it and stumbled upon Are Design Patterns Missing Language Features. To outline this great thoughts: if we wish to extract or already have extracted a design pattern, it is no longer a code smell, but a language smell. In other words not the programmer or developer cares not enough of the code design, but the language designer.

My first thoughts to this thesis: any language designer should carefully look at a statistic on how often each design pattern is used in the most famous open source projects (or even better proprietary one too) and think about getting them into the next language version. On the other hand some patterns have different realizations. For example the transition function of the state pattern could be implemented by entry-/exit-functions in each concrete state or as a function moveTo(oldState, newState) in the state machine. Both implementations have pros and cons, but if a language designer chooses one for the language, it would be a pain if a programmer/developer needs the other one. If both versions are implemented in the language, things get complexer. This would be contrary the design goal of simple languages.

Glad i found this inspiring thoughts! Whats your opinion?

Leave a Reply

Your email address will not be published. Required fields are marked *