Search code examples
design-patternsprogramming-languages

Programming Languages and Design Patterns


different programming languages have different features or lack certain features. Design patterns are a way to work around those shortcomings. I have seen the books and lists about design patterns in static, object oriented languages (Java, C++), but also the Videos about design patterns in Python.

I'm interested in to see some common design patterns in other languages like Forth, Icon, Lisp etc. A short description how they look like and why are they needed in a language would be nice. Maybe a short comparision to another language that solves this problem without a design pattern.


Solution

  • Design patterns are sometimes called "idioms". In non-OO languages (C, Forth, COBOL, etc.) they're just "the usual ways of doing things". Sometimes, they're called "algorithms". Every language (indeed, every discipline) has patterns of designing solutions.

    If you've seen something two or three times, you've seen a pattern. If you can describe the context, the problem, the solution and consequences, you've elevated the pattern from something vague to something concrete and specific.

    In non-OO languages, the patterns aren't often named and catalogued. Don't know why this would be the case, it seems to be so.