3 ms·
>>> My experience with Python is that a mid sized code base does not survive a full staff turnaround. So somewhere around the time the last original author is g
by ngc248 4y ago
>>> My experience with Python is that a mid sized code base does not survive a full staff turnaround. So somewhere around the time the last original author is gone, the codebase becomes a haunted graveyard - scary to everyone.
This is 100% true for medium to large codebases. Also because of the dynamic typing just looking at the codebase, it is very hard to understand the "shape" of variables and data. Of course this is improving now because of the type hints, but still it is comparatively hard.
- raverbashing 4y ago> it is very hard to understand the "shape" of variables and data And is it in, let's say Java, with several inheritance levels and very opaque types? It's one thing I struggle with Sure you know a TypeA has method do_stuff() and returns a TypeB but what actually is happening, beats me. Then you chase down TypeA and find out the actual implementation is spread across TypeA0, TypeBaseA and you can't make sense of anything
- praptak 4y agoYes, the ecosystem encourages complex hierarchies and abuse of "patterns" but at least the standard tooling has no problems with things like "find me all places this method is called from" or "find me all implementations of this method". YMMV, but my experience with plain Java is better than with Python. That was about plain Java. Where it stops working is some "dependency injection" frameworks which jumped the shark and stopped being about dependency injection (cough Guice cough). A fracking argument to a method comes from god-knows-where because The Framework injects it based on a combination of its class and and annotation? Yes, now it is as bad as Python or maybe even worse :)
- formerly_proven 4y agoFinding references isn't really that much harder in Python, it tends to work almost always with e.g. Pycharm and has for a long time. There's of course always the shotgun approach and just searching for the identifier, which turns up all but the most opaque ways to do things (e.g. concatenating a string together, then doing getattr - which you can also do in Java with reflection). Ye olde metaprogramming tricks in Python would often elide inspectors like that of Pycharm, which is why it had e.g. special support for the Django or SQLalchemy ORMs. Personally, I've never been fond of those, and find the Java-zope-style code borderline unreadable (heavy reliance on magic, non-local effects and "oh that setuptools entry over there refers to this class here and that's how we load it" kind of tricks) and stuff like Django is (or was) not much better in some areas. More modern metaprogramming approaches can often be typed in Python, which resolves a lot of the issues with it. All that being said, the by far most common cause of bugs in Python is None in my experience, not any of the shenanigans the language allows you to do. Mid-sized (5k < loc < 100k?) can absolutely survive a complete "hostile takeover" from new developers, with all the same potential (but not mandatory) issues and pitfalls that pretty much any such codebase invites, in particular in dynamically typed languages.