0

I'm looking at this question Python: give start and end of week data from a given date. It seems most people prefer using standard libraries instead of going for something like pendulum which seems to be much easier to use and readable in terms of code.

How do I think about the trade offs on what to choose when deciding on what approach to take? My main objective is to code once and not have to update the code ever again. This going from 2.7 to 3.x is really a pain to update my whole code base. It seems like I should always use standard library unless the library saves me tons of time.

Can a more experienced programmer comment on this?

jason
  • 3,811
  • 18
  • 92
  • 147
  • well that answer is from 5 days ago and the others 5 years – dan-klasson Mar 10 '19 at 15:03
  • thanks for pointing that out, I didn't notice that. so you are saying that it might over take the standard library answer given enough time? – jason Mar 10 '19 at 15:05
  • Python 2 --> 3 completely muddies this. That's a fundamental change. Outside of that, you can keep external libraries in virtual environments. If you're happy with how that library works (I.e. not throwing security risks at you) and you can distribute it fine, then use it. – roganjosh Mar 10 '19 at 15:06
  • no. i'm just saying you can't really judge what's popular by that answer. if you're gonna do a lot of date handling use that library. if it's just a one off probably not worth it. whenever using third party libraries you have to factor in whether it will be maintained. like upgrading python versions like @roganjosh mentioned – dan-klasson Mar 10 '19 at 15:06
  • the activity of the non-standard library is important because you don't want to wait 10 years before the library gets updated so that it support the latest language features. – Ramy M. Mousa Mar 10 '19 at 15:11

0 Answers0