I am trying to encode my own DSL for file manipulation, just for the sake of training.
My goal is to make it understandable and easy to use.
Here are 3 alternatives for adding a row to the .yml database:
1. append("windows").to("database.yml")
2. append(string: "windows").to(file: "database.yml")
3. append_string("windows").to_file("database.yml")
4. append_string "windows", to_file: "database.yml"
5. append string: "windows", to_file: "database.yml"
Im a bit lost in all of these alternatives.
Can someone with experience in DSL give me some guidance and explain what the pros and cons are with each?
Everyone reads the same way, but I want to know which one follows the best practice for DRY and a good coding standard.
EDIT: I think it would be nice if I can specify some optional parameters, for example.
append(string: "windows").to(file: "database.yml", :force => true)
, , , . , 4-5, : force = > true, , .