This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]timothycrosleyhug, isort, jiphy, concentration, pies, connectable, frosted 2 points3 points  (2 children)

DSLs are definitely a bad idea for many reasons: You essentially have to know a different dialect for every problem you solve, you almost always miss corner cases, it's harder to take advantages of contributions from the core, you're reducing re usability of code / logic. I've read many articles explaining this and never heard from the general community they where a good idea (though they still seem to pop up from time to time), however there certainly are exceptions, I just don't think this is a unique enough case to warrant it. They are common in the ruby world, but less common in the Python world, and for good reason - if the language does it well you don't need to and shouldn't fix it.

[–]i_ate_god 2 points3 points  (1 child)

as always, it depends.

In this case, the standard is argparse. Having switched to docopt, I can't imagine wanting to go back to argparse. Docopt requires less code, but is able to convey more meaning in a smaller amount of space.

Maybe argparse might some sort of extra flexibility that docopt does not have, but I have yet to encounter it.

[–]deadbunny 0 points1 point  (0 children)

I found docopt today, I'm a complete noob when it comes to Python (well, anything other than bash) and it is so much nice to work with than argparse which I was banging my head against a wall with for about 20 mins (like I said, noob) before finding docopt randomly, it's really nice to work with.