There goes the neighborhood .... On Tue, Dec 20, 2011 at 10:14 AM, Erez Schatz <[email protected]> wrote:
> On 20 December 2011 09:11, sawyer x <[email protected]> wrote: > > 2011/12/20 Yossi Itzkovich <[email protected]> > >> > >> Hi Erez, > >> > >> A very good summary. Another claim that I heard more than once (related > >> to your 4th factor) is that , due to Python strict syntax, Python code > is > >> easier to maintain. > > > That's a two-sided coin though. > > > > Some people think of Python as readable due to its lack of symbols. > However, > > some people think of Perl as readable due to its usage of symbols. "What > is > > that? Oh, that's an array, I can see it by the symbol used." In most > > languages you have to scroll up, find documentation in comments, or look > at > > the usage to understand what the variables are. In Perl you just look at > the > > variable. > > In Perl, you also have the benefit of knowing what is a variable, and > how it is used (i.e. context). To a, say, Java developer, the idea of > context is terrifying, seeing if (@array) and not if ( array.length > > 0 ) is, to a non-perler, confusing and unreadable, the same way a > non-native speaker will feel upon meeting an unknown idiom. > > So Perl is explicit in that regard, while Python is implicit, hence the next section shouldn't be that conclusive. > > Also, while Python programmers delight in the assumption that their > language > > is ostensibly readable, it is not always legible. I've seen many Python > > programs which were written in a way that takes you quite some time to > > understand what the hell is going on. Legibility is not brought by strict > > rules of character assortment, but by understanding the context of the > > reader. Rules can always be worked around and I've seen experienced > Python > > programmers whose code I would literally hate to read because it was so > > disorganized, so illegible, so impossible to understand. They just found > a > > way around the rules, as people always do. > > Like any language, Python code is easier to maintain as long as the > usual practices wrt maintainability are preserved. I've seen examples > of Python code that is as unmaintainable as any other language. > > I tried to avoid "maintainability" in my summary. Python is explicit, > Perl is implicit. To a Perl programmer, Perl is immensely more > readable than any other language, to a non-Perler, it's gobbledegook. > Like mentioned above, it's not that clear cut (sigils). Plus, in Python, the culture leans heavily towards duck typing, I don't care what a variable (object) is, all I care is it's behavior. I Don't care if it's a file, all I care is that it can read() and write(). When needing to slice something, don't care if it's an array, all I care it can actually slice, eg: String can do it too). In that regard Perl is more explicit than Python. Regarding CPAN etc, Python has PyPI <http://pypi.python.org>, Ruby has gems, Node.js has npm etc. That's a solved problem long time ago. >From my point of view today there's no real advantage for one dynamic language over the other, it's a matter of petty preferences (but hey, they're mine petty ones ;-) ). Cheers -- Meir Kriheli http://meirkriheli.com
_______________________________________________ Perl mailing list [email protected] http://mail.perl.org.il/mailman/listinfo/perl
