3 ms·
I do not like that you expect redundant fields be omitted. Just because they might be the default does not mean you shouldn't show your business rules
by glenaddict 6y ago
I do not like that you expect redundant fields be omitted. Just because they might be the default does not mean you shouldn't show your business rules
- rikatee 6y agoYou're right - that's why the GitHub bot just gives "food for thought" advice and does not block the merge. It's "have you considered" rather than "you must do this". The dev has the choice of if to commit the change that is suggested That gets a bit lost in the game I know :)
- Syntonicles 6y agoI have worked on similar projects to this game in the past (at scale) so it's close to my heart. To me the benefit of the default redundant arguments error is pedagogical. It forces me to think more closely about what it means to set nullable, assuming I was coming to the game with a limited understanding of Django code. Just glimpsing a note in the docs doesn't register nearly as quickly interactive play does. I would love to see this format used more extensively. When I'm learning an API I tend to fire up a REPL and explore it by poking. I do it even with basic mathematics that have fallen out of my brain. Very much enjoyed and it served as a quick refresher!
- rikatee 6y agoglad you liked it :)
- georgyo 6y agoI think for code readability show defaults can be confusing, unless you _always_ show those defaults. The following implies that bar might be null-able if you don't know what the default is. foo = text(null=False) bar = text() While writing code you likely have the defaults you care about in your head. Someone reading your code may not. You want to make sure your code leads their thought process down the right path. So either you _always_ show the default, or you only override the default.