Larry Wall Quotes on Programming

102 quotes

  1. Although the Perl Slogan is There's More Than One Way to Do It, I hesitate to make 10 ways to do something. :-)

  2. And don't tell me there isn't one bit of difference between null and space, because that's exactly how much difference there is. :-)

  3. Besides, REAL computers have a rename() system call. :-)

  4. I dunno, I dream in Perl sometimes...

  5. If you want to program in C, program in C. It's a nice language. I use it occasionally... :-)

  6. It's all magic. :-)

  7. Perl programming is an *empirical* science!

  8. Real programmers can write assembly code in any language. :-)

  9. There are probably better ways to do that, but it would make the parser more complex. I do, occasionally, struggle feebly against complexity... :-)

  10. Though I'll admit readability suffers slightly...

  11. You want it in one line? Does it have to fit in 80 columns? :-)

  12. Besides, it's good to force C programmers to use the toolbox occasionally. :-)

  13. If I allowed 'next $label' then I'd also have to allow 'goto $label', and I don't think you really want that... :-)

  14. In general, if you think something isn't in Perl, try it out, because it usually is. :-)

  15. It's there as a sop to former Ada programmers. :-)

  16. last|perl -pe '$_ x=/(..:..)...(.*)/&&$1ge$1&&$1lt$2' That's gonna be tough for Randal to beat... :-)

  17. Perl itself is usually pretty good about telling you what you shouldn't do. :-)

  18. There are many times when you want it to ignore the rest of the string just like atof() does. Oddly enough, Perl calls atof(). How convenient. :-)

  19. > (It's sorta like sed, but not. It's sorta like awk, but not. etc.) Guilty as charged. Perl is happily ugly, and happily derivative.

  20. ...this does not mean that some of us should not want, in a rather dispassionate sort of way, to put a bullet through csh's head.

  21. What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?

  22. Well, enough clowning around. Perl is, in intent, a cleaned up and summarized version of that wonderful semi-natural language known as 'Unix'.

  23. Lisp has all the visual appeal of oatmeal with fingernail clippings mixed in.

  24. They can always run stderr through uniq. :-)

  25. Of course, I reserve the right to make wholly stupid changes to Perl if I think they improve the language. :-)

  26. I think $[ is more like a coelacanth than a mastadon.

  27. That could certainly be done, but I don't want to fall into the Forth trap, where every running Forth implementation is really a different language.

  28. Randal can write one-liners again. Everyone is happy, and peace spreads over the whole Earth.

  29. P.S. Perl's master plan (or what passes for one) is to take over the world like English did. Er, *as* English did...

  30. You can prove anything by mentioning another computer language. :-)

  31. I think you didn't get a reply because you used the terms 'correct' and 'proper', neither of which has much meaning in Perl culture. :-)

  32. True, it returns ' ' for false, but ' ' is an even more interesting number than 0.

  33. Any false value is gonna be fairly boring in Perl, mathematicians notwithstanding.

  34. We didn't put in ^^ because then we'd have to keep telling people what it means, and then we'd have to keep telling them why it doesn't short circuit. :-/

  35. Perl has a long tradition of working around compilers.

  36. Of course, this being Perl, we could always take both approaches. :-)

  37. A 'goto' in Perl falls into the category of hard things that should be possible, not easy things that should be easy.

  38. Well, that's more-or-less what I was saying, though obviously addition is a little more cosmic than the bitwise operators.

  39. The choice of approaches could be made the responsibility of the programmer.

  40. But the possibility of abuse may be a good reason for leaving capabilities out of other computer languages, it's not a good reason for leaving capabilities out of Perl.

  41. Magically turning people's old scalar contexts into list contexts is a recipe for several kinds of disaster.

  42. switch (ref $@) { OverflowError => warn 'Dam needs to be drained'; DomainError => warn 'King needs to be trained'; NuclearWarError => die; }

  43. I surely do hope that's a syntax error.

  44. Anyway, my money is still on use strict vars . . .

  45. Just don't make the '9' format pack/unpack numbers... :-)

  46. Well, you can implement a Perl peek() with unpack('P',...). Once you have that, there's only security through obscurity. :-)

  47. That gets us out of deciding how to spell Reg[eE]xp?|RE . . . Of course, then we have to decide what ref $re returns... :-)

  48. 'Course, that doesn't work when 'a' contains parentheses.

  49. (To the extent that anyone but a Prolog programmer can understand X totally. (And to the extent that a Prolog programmer can understand 'cut'. :-))

  50. The code also assumes that it's difficult to misspell 'a' or 'b'. :-)

  51. Well, hey, let's just make everything into a closure, and then we'll have our general garbage collector, installed by 'use less memory'.

  52. Boss: You forgot to assign the result of your map! Hacker: Dang, I'm always forgetting my assignations... Boss: And what's that 'goto' doing there?!? Hacker: Er, I guess my finger slipped when I was typing 'getservbyport'... Boss: Ah well, accidents will happen. Maybe we should have picked APL.

  53. And other operators aren't so special syntactically, but weird in other ways, like 'scalar', and 'goto'.

  54. If this were Ada, I suppose we'd just constant fold 1/0 into die 'Illegal division by zero

  55. Almost nothing in Perl serves a single purpose.

  56. It's hard to tune heavily tuned code. :-)

  57. Perl will always provide the null.

  58. Well, I think Perl should run faster than C. :-)

  59. To Perl, or not to Perl, that is the kvetching.

  60. I suppose you could switch grammars once you've seen 'use strict subs'. :-)

  61. Perl should remain fast and intuitive (to the extent that it is :-)

  62. Just put in another goto, and then it'll be readable. :-)

  63. I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, 'What is that, swearing?

  64. : I could understand principles of Perl source in 2-3 days [. . .] Gee, it took me about eleven years. :-)

  65. There's often more than one correct thing. There's often more than one right thing. There's often more than one obvious thing.

  66. I'd make people say 'use Fork;' if I thought I could get away with it.

  67. Maybe we should take a clue from FTP and put in an option like 'print hash marks on every 1024 iterations'. :-)

  68. The court finds everyone to be in contempt (including himself :-), and orders everyone sentenced to five years hard labor. (Working on Perl, of course.)

  69. I note that the Python folks still think they like JPython. I wonder how long that will last?

  70. Perl did not get where it is by ignoring psychological factors.

  71. If this were Ada, we'd simply doc it as 'erroneous'.

  72. That being said, I think we should immediately deprecate any string concatenation that combines '19' with '99'. :-)

  73. Accidental stacks considered harmful.

  74. And in the limiting case where the optimizer is completely broken because it's not implemented yet, we get to work around that too. Optionally...

  75. #define NULL 0 /* silly thing is, we don't even use this */

  76. #define SIGILL 6 /* blech */

  77. break; /* don't do magic till later */

  78. stab_val(stab)->str_nok = 1; /* what a wonderful hack! */

  79. OOPS! You naughty creature! You didn't run Configure with sh! I will attempt to remedy the situation by running sh for you...

  80. #else /* !STDSTDIO */ /* The big, slow, and stupid way */

  81. /* This bit of chicanery makes a unary function followed by a parenthesis into a function with one argument, highest precedence. */

  82. Be consistent.

  83. Does the same as the system call of that name. If you don't know what it does, don't worry about it.

  84. Even if you aren't in doubt, consider the mental welfare of the person who has to maintain the code after you, and who will probably put parens in the wrong place.

  85. Help save the world!

  86. If you want your program to be readable, consider supplying the argument.

  87. Perl is designed to give you several ways to do anything, so consider picking the most readable one.

  88. Remember though that THERE IS NO GENERAL RULE FOR CONVERTING A LIST INTO A SCALAR.

  89. The autodecrement is not magical.

  90. I simultaneously believe that languages are wonderful and awful. You have to hold both of those. Ugly things can be beautiful. And beautiful can get ugly very fast. You know, take Lisp. You know, it's the most beautiful language in the world. At least up until Haskell came along. (laughter) But, you know, every program in Lisp is just ugly. I don't figure how that works.

  91. Now, I'm not the only language designer with irrationalities. You can think of some languages to go with some of these things.

  92. If there's a particular problem that Perl is trying to solve, it's the basic fact that all programming languages suck. Sort of the concept of original sin, applied to programming languages.

  93. There are a lotta computer languages out there doing drugs.

  94. The three chief virtues of a programmer are: Laziness, Impatience and Hubris.

  95. The problem with being consistent is that there are lots of ways to be consistent, and they're all inconsistent with each other.

  96. Q. Why is this so clumsy? A. The trick is to use Perl's strengths rather than its weaknesses.

  97. I already have too much problem with people thinking the efficiency of a perl construct is related to its length. On the other hand, I'm perfectly capable of changing my mind next week... :-)

  98. I might be able to shoehorn a reference count in on top of the numeric value by disallowing multiple references on scalars with a numeric value, but it wouldn't be as clean. I do occasionally worry about that.

  99. Interestingly enough, since subroutine declarations can come anywhere, you wouldn't have to put BEGIN {} at the beginning, nor END {} at the end. Interesting, no? I wonder if Henry would like it. :-)

  100. > This made me wonder, suddenly: can telnet be written in perl? Of course it can be written in Perl. Now if you'd said nroff, that would be more challenging...

  101. I knew I'd hate COBOL the moment I saw they'd used 'perform' instead of 'do'.

  102. Many computer scientists have fallen into the trap of trying to define languages like George Orwell's Newspeak, in which it is impossible to think bad thoughts. What they end up doing is killing the creativity of programming.

All Larry Wall quotes