4 ms·
But at what cost? Of course if you spend X hours on idea Y, it will seem more natural, readable and meaningful (if you spend too much time, it might seem meanin
by viraptor 16y ago
But at what cost? Of course if you spend X hours on idea Y, it will seem more natural, readable and meaningful (if you spend too much time, it might seem meaningful even if it's wrong...).
Here, you get a mash of so many concepts in one line that it's hard to claim any readability really... From the start, you get list (@), one of 3 possible assignments (:=), separators and operators at different levels (, , ...^, (star), >=), math symbols in two different contexts (+, (star)), meaningful position in a list (seed, seed, function). On top of that, to read it without parens you have to keep all operator priorities in mind.
Readable? I have a hard time finding one (apart from J, K, APL, etc. family and silly ones) that is less readable than this sample. The "looks like Chinese" comparison is really apt - Chinese takes considerably more effort to learn than many other languages.
- masak 16y agoI could manipulate physical nature if I only learn mathematical notation, but at what cost? Here's the thing: I like Perl 6 because of the abstractions it gives me. In fact, I like learning new programming languages because of what I learn about ways of slicing the solution space. It's like learning new spoken languages, only easier. I spend the time I could spend complaining about some unknown language's syntax learning that language, trying to enrich my repertoire as a programmer.
- viraptor 16y agoI agree in general, as I try to learn at least one new language a year and it's a great exercise. However, I think some of them are crossing the line (perl5, 6 even more) and honestly believe that I would save at least a couple of weeks of my time at work this year if I wouldn't have to chase Perl code bugs that would be completely obvious in other languages. Both due to the crazy syntax and due to not exploding with an exception the moment something looks silly (warnings, strict, autodie and others are pretty much mandatory in code I get for review). At this point I'm an anti-perl advocate - and again, I believe it had positive effects at work. It goes beyond complaining about "unknown syntax".
- berntb 16y ago>>perl5, 6 even more Interesting. With modern Perl use (autodie, testing, Best Practices, etc)? Are you trolling or do you have a few specific examples of what makes you lose more work weeks a year than CPAN saves you? Also, what would be worse with Perl 6 -- that you can say already now (or do you have Rakudo in production)?
- viraptor 16y agoMigrating to modern Perl, which I admit involves various scripts spanning from "let's use globals only" to "proper architecture and tests". I can tell you the general areas that were problematic, but not the exact situations since I honestly don't remember all of them: Strings with utf8 flag, encoding, etc. - some CPAN modules simply didn't care about it - it's hard to find such bugs (different types are much better for this). Handling half situations with error codes and others with exceptions (I'm not even going into modules which find `dualvar` useful...). Continuing past failures (even if I force some behaviour in my code, other modules don't have to). Possibility to do silly things like mistake `eq` and `==` - if data source changes from number ids to strings, that causes a lot of fun (yes, you can argue this is due to the programmer's inexperience, but then we can't find people who can do this job, let alone those who can both do the job and know perl perfectly). Minor annoyances like re.pl not being very friendly just add to the list. So yes - of course you can write the best modern Perl and live happily. In practice I have to mess with old code and tricky things left by people saying "Perl is not that bad once you know more of it" - really, it's just setting up someone less experienced for failure. And you can be sure that there will be someone less experienced working on your code (while you're not available for any review). I prefer more explicit code, stopping completely before you do something that might not be exactly what you want. Re. Perl 6 - it brings in more new syntax, more operators, more different ways to do things, more unknown problems and less people who know it well enough to use it properly. I really don't see the reason to play with it now. I really don't want this to look like trolling, so I'm not even advocating languages I prefer. You may not agree with me, but this is just something I experienced for the last 3 or so years - those simple problems occur over and over again.
- 16y ago
- deleted 16y ago[deleted]