3 ms·
Programming languages carry with them certain conventions. Straying too much from the established code style will make your code a pain to work with. It's pret
by lubonay 11y ago
Programming languages carry with them certain conventions. Straying too much from the established code style will make your code a pain to work with.
It's pretty hard to hit the right balance between adhering to the original language and matching your DSL to the problem domain. If you build a DSL that requires a day of studying code and documentation in order to make a minor change, you might be better off without it.
- sklogic 11y ago> Straying too much from the established code style will make your code a pain to work with. This is a theory. Reality is a bit different. There is nothing in common between, say, JavaScript and the regular expressions DSL embedded into it, but yet they come ok together. Code style is overrated.
- zzalpha 11y agoThe difference is that's a standard embedded DSL (another excellent example is C#'s LINQ). Inventing your own alien syntax is a recipe for long-term code maintenance disaster. Anyone who's worked on a codebase that's lived longer than a decade has likely experienced this pain firsthand.
- sklogic 11y agoMost of the code I worked with was 30-40 years old. Often full of ad hoc DSLs. Refreshing this kind of code was easier than any other kinds - rewriting the DSL itself with the modern technologies was sufficient, 90% of the remaining code base did not need much maintenance then.