r/functionalprogramming • u/Lubbadubdub • Sep 06 '17
Python Using Python... Struggling with inconsistency...
I'm mainly working with Python at the moment. Most people in my company are using oop, which is kinda "natural" given the choice of the language. In general, I don't like oop. I prefer simple solutions to complex ones when they can solve the same thing and oop adds one layer of abstraction to functions. I value consistency and explicity. I hate it that in Python sometimes you call by reference and sometimes by value and there's no apparent model behind it. Most people are using oop coz they dont care as much about which paradigm to use and it's always easier to argue for oop since "everything is an object anyway" (which is not entirely true and how is that a valid argument..). Is there a way to be more "functional" with Python? Are there good argument against using oop? Or maybe I should just give up and go with the flow...
View all comments
Show parent comment
1
u/ws-ilazki Sep 08 '17
Going off on a tangent a bit, but that's the same logic behind Go, though its creator, Rob Pike, is a bit less tactful about it:
(The link isn't to the original source, but rather to a blog post that links to that source plus another related quote and its source. More efficient!)
I think Go takes that logic a bit too far, though, and makes something a bit too simple. Python may make it frustrating to do things GvR thinks you shouldn't be doing, but at least it doesn't eschew nearly all modern improvements to programming...
Anyhow, back on the topic of Python, that "sacrifice power for ease, flexibility for enforced readability" mindset is both a boon and a bane, depending on how you look at it. It gives it some benefit as a learning language, or for non-programmers that find themselves needing to write a program (such as scientists), which is why I've called it "a programming language for people that hate to program" and "the next generation of BASIC". People love to hate on BASIC, but it had a similar niche as Python and enjoyed its popularity for many of the same reasons. I've pissed people off saying it, but it's not an insult at all; there's nothing to be ashamed about there, because if not Python, something would appear to fill that role.
I understand that, I really do. I just don't like the trade-off in expressiveness and flexibility. I believe a large part of that is because of my preference for FP over OOP when possible, which often puts me at odds with the language when I try to use it. (Though, oddly, I didn't mind Ruby's OOP for some reason; maybe due to its Smalltalk influence?)
Also, not a deal-breaker by itself, but my general preference for flexible, concise languages (even if they require more discipline to maintain readability) probably doesn't win Python any points, either.
TL;DR: I get why people like Python, it just doesn't fit well for me because my preferences align closer to languages like Perl, or various lisp dialects, than to its design.