4 ms·
As a "battle" I think it is stupid. Otherwise, I disagree with you. They're very different languages. Python is great for people who are accidental programme
by dkarl 17y ago
As a "battle" I think it is stupid. Otherwise, I disagree with you. They're very different languages. Python is great for people who are accidental programmers or non-programmer programmers, especially ones who think mathematically and analytically. It's popular among scientists and engineers who need to understand a language pretty completely in a top-down way, but who want to waste as few brain cells as possible on a programming language because their brainpower is primarily applied to other things.
Personally, I've always programmed primarily in other languages (C++ being mein liebster Feind) but I've relied a lot on Python (and occasionally Jython) for day-to-day scripting and for delivering code to customers that reorchestrates existing code to do new things. Python has never lit a single creative spark in me, but it has always delivered for me without demanding much in return. Now, that is a statement you will never hear applied to Ruby.
I don't know much about Ruby, but the things I hear about it remind me of Perl in some ways. Back in the day, I spent a lot of time learning Perl, promptly forgetting it, and going back to Perlmonks to learn it yet again. Perl comes naturally for impressionists who love to program by instinct, pattern-matching, and trial-and-error. They love it when something new pops into their head and they type it in and it just works, and they aren't immediately sure how or why. Perl is also for dedicated professionals who want a tool that rewards more study and practice with more and more power -- mastery of Perl is a never-ending road with a seemingly never-ending escalation of power and awesomeness.
Ruby seems to be a much more easily understood language than Perl, but (from the outside) it seems to share Perl's magical flavor and open-ended approach to mastery. Python is better for people like me who want working, understandable code for the smallest lifetime intellectual investment.
- chromatic 17y ago> Perl is also for dedicated professionals who want a tool that rewards more study and practice with more and more power -- mastery of Perl is a never-ending road with a seemingly never-ending escalation of power and awesomeness. That sounds more like programming (which you can teach yourself in ten years) than any specific language.
- dkarl 17y agoThat's a trite response. Complexity, power, and culture differ between languages. In Perl, people make a game out of doing as much in a single line as possible. Experts do things that are mystifying to a beginner. In Python, an expert would be expected to produce a solution that is comprehensible to a less-expert programmer, spanning however many lines as are necessary. It would be un-Pythonic to write code that a less expert programmer couldn't understand.
- chromatic 17y ago> It would be un-Pythonic to write code that a less expert programmer couldn't understand. I assume you have syntactical concerns and syntactical concerns only in mind, as domain knowledge and local style and creative decisions are far more important for maintainability. Even so, I don't believe you. I've seen far too much Python code which uses decorators and generators and list comprehensions to believe that it's un-Pythonic to "write code that a less expert programmer couldn't understand".
- dkarl 17y agoThe point is that as a Python programmer, even a casual one, I know what decorators and generators are and can look up how they work. I can pretty confidently expect to figure out what they mean in any case I need to. And yeah, the language has arguably become less Pythonic as it caters to more expert programmers at the expense of less expert ones. From the beginning, there have been people who claimed that primitive, clear, inelegant code is worse than elegant, concise code that depends on extra language features. Usually that claim has been rejected, but as sometimes happens in politics, the people who care enough to influence the process are not always the people for whom the process is supposed to work. I see decorators as something of a Trojan horse through which Python became more of a language for me (a software developer who copes with, and sometimes even likes, C++) and less of a language for my customers (scientists and engineers). Which is tragic because there are plenty of languages for software developers and not enough languages for people who just need something stupidly simple yet powerful enough for all practical purposes. Still, despite the erosion of its simplicity, Python stands out for its philosophy of simplicity and its adherence to it. There remains a gulf between a language that sounded a clarion call for simplicity and has slipped a little from its principles and a language that chose the red pill and dove down the rabbit hole basically for the sheer beautiful hell of it.