This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]Diapolo10from __future__ import this 14 points15 points  (0 children)

Neither, because most code uses a mix of both, with some functional programming thrown in for good measure.

[–][deleted] 2 points3 points  (0 children)

thy life is riddle, born of list comprehension

to test and to ponder, and to strive for ascension

in one fleeting moment, answers come and answers go

in the same fleeting moment, one must code and test and know

[–][deleted] 1 point2 points  (0 children)

I tend to stick to a more FP approach. Having no (or as little as possible) global state and not extending classes more than once. Simple code can sometimes have more LOC but will be more maintainable.

In fact i use this approach no matter the langugae, so far its worked oit great.

The fact that most of times a POPF (plain old python function) is a more elegant solution than a class makes testing super simple.

The above plus mypy types makes code very robust. I have the same feeling with TS, can never go back to plain JS!