2 ms·
I agree that in this particular example of creating an instance of an entity, it's bad. It doesn't even make sense, like something you would set up as a strawma
by nerdponx 5y ago
I agree that in this particular example of creating an instance of an entity, it's bad. It doesn't even make sense, like something you would set up as a strawman in a post about being too DRY.
What would be the point? To try and ensure that certain setup measures are taken in all cases?
Do people actually write code like this? Maybe this is a programming language culture difference, but I never see this pattern in my Python work, professional or otherwise.
I think my issue is that this post takes a very narrow view of what Boolean flags are used for. I would hope that they are not advocating against things like `fetch(url, verifySsl = false)` !
- fiddlerwoaroof 5y agoIn Python libraries (pyyaml, for example), occasionally you’ll come across a pair of methods named something like `load` and `load_safe`. For the example you gave, I think it’d be a much better design to have `fetch` and `fetchNoVerify` because this would make it much easier to audit the code to see if SSL verification is ever skipped.