3 ms·
> No one is using Python like that in the professional world. The most complex you'll see are simple comprehensions. It is possible that blub-Python and "let's
by evgen 3y ago
> No one is using Python like that in the professional world. The most complex you'll see are simple comprehensions.
It is possible that blub-Python and "let's code it in Java-flavoured Python" rules your particular slice of the profession, but in my world of getting shit done I see more FP and using simple built-in data structures in a >1 KLoc line script/module than I do of traditional OO and GoF styles. Most objects I deal with in Python are from libraries I call and not from our own code. Different strokes I guess, but I think you underestimate the breadth of Python usage and how much of it is semi-complicated scripting that picks from FP-style and OO-style depending on what is easiest to accomplish the task.
- hk__2 3y agoI think OP refers more to the "code-golf" part than FP: the repo contains code that uses OO when necessary and FP (although in a very light way) when it can. The biggest issue is that it tries to be as short as possible, which makes it hard to understand. Code should be simple, not short. Instead of looking at Loc, we should look at "how much time does someone need to understand this part of the code".
- rcarmo 3y ago$DIVINITY, I hate Java-flavoured Python with a passion. Sometimes I dive into corporate stuff that seems like it was done by the yard by interns measured in LOC per day, or literally code-generated from some overly abstract spec. Worse, sometimes I will have to dig down into accessors of accessors to find the actual logic for a library (which is why I often implement my own, shorter and easier to debug ones). I write Python in a mix of FP style (with the occasional class for handling specific contexts or tasks) that aims to be as concise and readable as possible, and yes, I will use global variables in a module if it saves me the trouble of herding some constants or common state around and making function invocations unnecessarily long.
- rcarmo 3y agoI guess that writing "Java Fanfic" is very popular, judging from the downvotes.