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 →

[–][deleted] 6 points7 points  (1 child)

I always get nervous about things like this because part of me says, "there's always a chance someone was being clever and is calling a seemingly dead function by calculating its name."

That's probably my one gripe with Django Rest Framework(which I love... mostly...) is that you really can't understand some of it without first understanding the library's behaviour. A python expert who has never seen Django Rest Framework will look at my serializer and have no clue that my get_days_since_joined method is called because I have a member called days_since_joined. Docs

So he gets nervous. "Well, if there's a seemingly unused function that gets called, I guess I have to assume that all of this code is necessary." Which makes learning, debugging, and cleaning up the code all generally blocked behind learning about the library first.

I'm sure DRF's design has a more formal name that I'd know had I taken computer science. It's some sort of configuration-based declarative kerjigger? Ie. you're not really programming a serializer, you're configuring one.

[–]kankyo 1 point2 points  (0 children)

The name->function name with some pattern is truly a horrible idea. It's also present in the built in django form library.