Skip to content

Commit

Permalink
Add "special casing" blurb to design ethos page
Browse files Browse the repository at this point in the history
  • Loading branch information
LadyCailin committed Nov 26, 2018
1 parent 798a863 commit 33140f6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/main/resources/docs/DesignEthos
Expand Up @@ -79,4 +79,20 @@ and there are two hoses in the garage, you're not going to need to come back
and ask me which host to use, you would just select one. However, if one were broken,
I would have to go out of my way to tell you to use the one on the left, but this
is an exceptional circumstance, and I shouldn't have to explicitely tell you every
detail in the typical case.
detail in the typical case.

== Try not to special case things ==

When creating a new feature, first check to make sure that there is no design that
fits into existing paradigms. If there truly isn't, or there are justifiable exceptional
circumstances, then it's ok to special case it, but don't special case by default. When
this happens, it makes users have to learn a new paradigm, thus increasing the
complexity of the system, and making it take longer for users to become proficient.
One example of this in MethodScript is that almost everything is a function, so at
least when learning things initially, you don't need to know about operators.

This principal is quite deeply embedded into the language as a whole, for instance,
keywords are not implemented in the compiler, they are added to a list, and the compiler
processes them generically. This leads to increased ability to expand functionality,
and makes it easier to add new keywords to the language, without having to worry about
whether this will break any other code.

0 comments on commit 33140f6

Please sign in to comment.