Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
shortening Python code
#11
Are the users of your libraries generally also helping you develop them? I can see why documentation like that in that case is useful. Otherwise, users who aren't developing them are likely more interested in what the functions do, rather than how they're doing it. Good abstractions with good names and automated tests help this. Automated tests are better than comments for this sort of thing because they have the benefit that they will fail if the behaviour doesn't match. Well, should would be a better word. Tests need to be written in a way that actually check the code does what it's supposed to. This sounds obvious, but I've seen submissions for my company's programming test where candidates write tests, but all those tests do is check that no exception is thrown by the functions. This means they're useless, because you could write whatever logic in those functions, even create some bugs and the tests wouldn't fail.
Reply


Messages In This Thread
shortening Python code - by Skaperen - Oct-13-2022, 11:42 PM
RE: shortening Python code - by Larz60+ - Oct-14-2022, 03:07 AM
RE: shortening Python code - by Gribouillis - Oct-14-2022, 04:50 AM
RE: shortening Python code - by DeaD_EyE - Oct-14-2022, 08:13 AM
RE: shortening Python code - by snippsat - Oct-14-2022, 11:41 AM
RE: shortening Python code - by Skaperen - Oct-14-2022, 10:49 PM
RE: shortening Python code - by ndc85430 - Oct-15-2022, 04:14 AM
RE: shortening Python code - by Skaperen - Oct-15-2022, 10:33 PM
RE: shortening Python code - by Gribouillis - Oct-15-2022, 02:53 PM
RE: shortening Python code - by Skaperen - Oct-15-2022, 10:23 PM
RE: shortening Python code - by ndc85430 - Oct-23-2022, 07:01 AM
RE: shortening Python code - by wavic - Oct-23-2022, 08:53 AM
RE: shortening Python code - by Skaperen - Oct-23-2022, 10:54 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020