4 ms·
> So, whether you prefer an imperative, functional, object-oriented, or pipelined approach The problem with this: if you give people a multi-paradigm language,
by iLemming 7y ago
> So, whether you prefer an imperative, functional, object-oriented, or pipelined approach
The problem with this: if you give people a multi-paradigm language, they'd be using all of them. Often in the same codebase.
- dan-robertson 7y agoI think people should use all of them. Some problems are much better expressed with logic programming, others with inheritance, others with polymorphic functions. There is one school which says people ought to be giving a powerful programming language to better write powerful programs in the best way. The idea is to amplify what a single programmer can produce. Another school says you should give programmers a non-powerful language because they aren’t to be trusted. The goal is to make changing enormous codebases easy (or maybe to maximise lines of code). Perl fits into the first category and java is representative of the second. So I think this argument isn’t so much about Perl as it is a complaint about its philosophy. It could equally go on an article about the next c++ feature.
- pjc50 7y agoI'd like a definition of "powerful" that is more than just "agrees with my personal prejudices"; Perl lacks the power of a strongly checked type system, for example.
- tadzik_ 7y agoAll the examples in the post are written in Perl 6 though, which does not lack it.
- 0x445442 7y agoAny business problems that can be shown, objectively, to be better solved by one paradigm versus another can also be isolated into its own code base/module where said paradigm is canonical and ubiquitous. The problem is, this rarely happens and with a language like Perl and Java you end up with a mish mosh of hard to reason about code bases because the authors at the time were just trying to muddle through as best they could with whatever approach resonated with them.
- nanomonkey 7y agoThis is what finally killed it for me and Python. I'm inclined to functional programming and writing SQL instead of using an ORM. This was easily possible in Python, but my coworkers would often refer to it as "hacky" even though my tests would show it was more performant than marshaling objects to do a simple transform. My direct lead would often only write imperative code, and one off scripts with very little reuse possible (let alone tools that could be handed off to other team members). Very frustrating. I find more opinionated languages like Clojure help. On that note, is the title a riff on "Simple Made Easy"?
- brokenkebab 7y agoYour problem was in environment which didn't embrace the ways you like, not that language was multi-paradigm. "I love Python cooked functionally, but my colleagues do only OO" is equivalent to "I love Clojure, but my colleagues do only Java".
- 0x445442 7y ago"I love Python cooked functionally, but my colleagues do only OO" is equivalent to "I love functional Java but my colleagues do only OO Java". Fixed that for you. The whole point of the comment was that Clojure, by and large, forces you to work one way and Python doesn't.
- brokenkebab 7y agoThe whole point of the comment was that Clojure, by and large, forces you to work one way and Python doesn't. The point of my comment is that it's not true (except in a narrow educational meaning). Your working environment (managers, colleagues, existing codebase) is what defines your limits in general, including language, approach, style, and frameworks. If your current shop can't accept your call to write more functional code in whatever language is used there, it obviously won't start developing in Clojure. It works exactly this way, not in the opposite direction. Ergo, the guy's problem was that his environment wasn't inclined to switch from OO. He couldn't say "Mates, let's use Clojure, because it will finally FORCE you to discover the beautiful world of FP", because they just want to keep doing what they were doing yesterday. Fixed that for you. It's not a correction, and I hope you see now what I mean.
- mhd 7y agoThis is Perl, the native language of Tim Toady, so this is to be expected. Never mind that functional and imperative programming have been attached to OO languages since at least SmallTalk…