In 'The Pragmatic Programmer,' there's a quote that suggests using well-known external languages like YAML, JSON, or CSV whenever possible, and to consider internal languages only if the users of your application won't be those learning it. I'm trying to understand what the author means by "your language" and the reasoning behind this recommendation. Can someone break down this concept for me?
4 Answers
The term "your language" refers to a domain-specific language (DSL) that you might create for specific tasks in your application. For example, if you develop a template language that lets users customize their profiles with tags to display their achievements, that's a DSL. The author suggests using external languages like JSON or YAML because they're familiar to many users, making it easier for them to work with your application without learning something completely new. Internal languages are DSLs created within your application, often using the language of the app itself, like Ruby or Lisp, which allow you to express domain ideas clearly.
Got it! So basically, if you're going to make users learn a new language, it’s smarter to pick one they might already be familiar with, like JSON, instead of making them learn a completely new DSL.
The author was probably addressing the issue of users needing to learn multiple languages for different applications. If your app requires them to learn a completely new DSL, it can be frustrating. Instead, using a language they might already know means fewer barriers to entry and a smoother experience. Think of it like avoiding the headache of needing to learn ten different languages to do similar tasks across applications.
That makes a lot of sense! It’s all about user experience and keeping things straightforward.
Yeah, it really helps to create a more cohesive ecosystem for users.
Also, what the author might be conveying is that external languages work better when users are directly interacting with the language, rather than having to learn a unique language that can leave them confused. They want users to spend less time learning the intricacies of a language that only serves one application.
Yeah, it’s all about efficiency. If users are already familiar with certain formats, use those!
Exactly, keeping it simple with what people know usually works out better in the long run.
This point actually emphasizes that if users have to learn something new, it should be a language they are already comfortable with, like YAML or CSV. The aim is to make their lives easier instead of piling on more complexity. The author distinguishes between general-purpose and restricted languages, suggesting that domain-specific languages should not add unnecessary learning overhead.
Exactly! The goal is to reduce the learning curve for users by providing them with familiar tools.