No anonymous lambdas, hmm? That does seem like an advantage to Perl. It has anonymous lambdas which are quite nice-looking (something that cannot be said of most of Perl's features). However, they are limited to expressions (one or more through progn-like functions).
I have SICP right here; can you give me a reference that says you cannot write to lexicals in proper closures? It doesn't say you should not or should be allowed to. Python's closures are still implemented according to the environment model, only you don't have define and set!, but =. In the next major version, you'll get a feature that will make them work like you want (though it's not taken from Scheme either).
And regarding lambda, I don't give a damn about what Guido said, the obvious solution of having its contents wrapped by INDENT and DEDENT tokens is clear and simple. Probably, he just doesn't like how it looks when DEDENT is followed by a comma.
If they want to be taken seriously (by me, anyway), they should at least be consistent. Ever thought that I may be an environmentalist because I'm not stupid enough to destroy what lets me and everything I love or like live? Or you prefer to find yourself an excuse to, despite being atheist, be a polluting, gas-wasting redneck?
Being "religious" doesn't mean anything. Where one chooses to put one's faith is, and no, it's not the same thing. Yes, it means to have blind, irrational beliefs, which, 99% of the time, are even contradictory and illogical. That says something.
After that, remember that believing in Evolution requires that one be worse at math than one thinks he is, and it also requires that one have more faith than the much-maligned Christian You don't understand what a theory is about, and you don't seem to understand belief either. Let's see what you say when somebody comes up with a new theory that works better than the current one (and no, creationism is not even valid theory material). You are trying too hard to be a believer; why not just join Scientology?
I've yet to see anyone prove to me that my faith is misguided Here's the first indicator that something is going wrong:
1. It's faith
*Any* faith is misguided. You may think something probable, work with a theory, build new premises upon reasoning on existing ones (and remember to carry, add and multiply probabilities if you're not basing on facts!), or just play what-if, but blindly believing on something "just cuz", "just cuz it's nice", "just cuz lotsa ppl think so" or "just cuz there has to be sumthin lool" is not going to help anything or anyone.
But to each their own. I'm equipped with a brain so I like using it and refuse to accept things blindly and irrationally.
I hate to have to say this because I know what would Commander Ackbar say of.NET (unlike some gullible fools), but Microsoft has a better choice of languages for.NET DLR than the community has for Parrot, not to mention.NET DLR actually works. Even some gullible fools are trying hard to make IronPython work on Linux, Santa knows why.
They don't need to be faked because they exist for real. It's just that "=" doesn't do what one'd expect at first, and this may be uncomfortable but it's how it is and nevertheless it's getting fixed. (The other two choices would have been to add a defining statement that'd make your variables global the second you forgot, like JavaScript or Perl, or to try to be smarter in how you detect outer variables or create inner versions of them if they don't exist, but even that may have problems too.)
And you are: 1. Mocking environmentalism; 2. Thinking by hating a religion I hate the gullible fools that follow it (if anything, I hate the immoral atheists who created it to abuse their lambs); 3. Disregarding that illogical and contradictory things don't need to be disproven, and that even if presented with a non-illogical and non-contradictory belief such as "flying green elephants no-one has ever seen", it's their task to prove, not mine to disprove.
(Wow, I hadn't realized how badly does Slash suck. No proper code formatting, ugly HTML formatting, no HTML entities, no Unicode support,... This is like my 6th attempt.)
Python's lambda is limited to a single expression, which sucks, but you can always do def _(...) just before use. As for closures, Python implements closures properly (properly = as described in SICP, the environment model of evaluation), but immutable objects such as numbers or strings are, well, immutable, and the = operation played on a bare symbol always defines it in the current scope. However, an improvement on this regard is coming on Python 3000.
Python's parsing of vertical whitespace is not ambiguous. Lambda doesn't support statements because Guido doesn't want to. I would easily allow something like:
"interesting programming" --- You call line noise "interesting programming"? Name one thing that's not insanely unmaintainable and therefore useless that you can do on Perl and cannot on Python.
Python is not dumbed down, it's simplified. The introduction of R6RS (Scheme) contains the best insight I could ever find on the design of languages (and software in general): "Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary.". Python does this better.
Ruby slow? Who gives a damn? Faster processors or larger farms are cheaper than man hours, so if it's more productive than, say, Java (and pretty much anything that's not assembly would be), then it's well worth it. The problem with Ruby is that it's fugly and doesn't follow the above mentioned principle, and that it has sub-par Unicode support (then again, PHP does too), not that it's slow.
And Python has good Unicode support, what are you talking about?
Also, if you consider PHP's misfeature of magic quotes (or who knows what else), you need to relearn the definition of security.
Python runs even on frigging PSPs. I call that portable.
Lol, why is parent -1 Flamebait? He should be funny.
I'm a tree-hugging, religion-hating, free software-supporting atheist, but the reason why I don't use Perl is not that Larry Wall is a Christian. It's that I want to keep my sanity.
Since you are about to get screwed up, better do it while listening to your latest DRM-ridden iTunes music in your grossly overpriced iPod. Make iMalware part of your digital lifestyle. It looks much better than Windows'!
What a great idea! The Apple iChair. Sit different. A chair for classy metrosexual fanboys to use their obscenely overpriced iMacs and listen to their defective by design and obscenely overpriced iPods while on it. Even farts smell stylish if thrown on the iChair.
I'm sure the pig would have wanted to live. This is so "heartless". I hope you fail. And no, I'd rather die if my heart fails than accept something that took countless lives to create.
While I don't usually find "the Pythonic way" too bad, I always follow my own personal style, which is a lot more Lispy. For example, I'll prefer a higher-order function over a class with just __init__ and __call__ any day (__call__ is great for objects that have methods and publicly-used properties, but it's kind of lame to use it just to avoid a higher-order function).
In a recent talk I said something that upset a lot of people: that you could get smarter programmers to work on a Python project than you could to work on a Java project.
I didn't mean by this that Java programmers are dumb. I meant that Python programmers are smart. It's a lot of work to learn a new programming language. And people don't learn Python because it will get them a job; they learn it because they genuinely like to program and aren't satisfied with the languages they already know.
Which makes them exactly the kind of programmers companies should want to hire. Hence what, for lack of a better name, I'll call the Python paradox: if a company chooses to write its software in a comparatively esoteric language, they'll be able to hire better programmers, because they'll attract only those who cared enough to learn it. And for programmers the paradox is even more pronounced: the language to learn, if you want to get a good job, is a language that people don't learn merely to get a job.
Only a few companies have been smart enough to realize this so far. But there is a kind of selection going on here too: they're exactly the companies programmers would most like to work for. Google, for example. When they advertise Java programming jobs, they also want Python experience.
A friend of mine who knows nearly all the widely used languages uses Python for most of his projects. He says the main reason is that he likes the way source code looks. That may seem a frivolous reason to choose one language over another. But it is not so frivolous as it sounds: when you program, you spend more time reading code than writing it. You push blobs of source code around the way a sculptor does blobs of clay. So a language that makes source code ugly is maddening to an exacting programmer, as clay full of lumps would be to a sculptor.
At the mention of ugly source code, people will of course think of Perl. But the superficial ugliness of Perl is not the sort I mean. Real ugliness is not harsh-looking syntax, but having to build programs out of the wrong concepts. Perl may look like a cartoon character swearing, but there are cases where it surpasses Python conceptually.
So far, anyway. Both languages are of course moving targets. But they share, along with Ruby (and Icon, and Joy, and J, and Lisp, and Smalltalk) the fact that they're created by, and used by, people who really care about programming. And those tend to be the ones who do it well.
I disagree. I'm a supporter of multi-paradigm programming ("the right tool for the right job") and consider functional programming approaches the most important of all. I find Python very comfortable to work with, and much conceptually cleaner than Ruby.
While Ruby has one advantage or two over Python, such as multi-expression lambdas and Python's statements turned to expressions (statements are a common root of evil and an unnecessary procedural concept), the main problems I see in Ruby as a language, leaving libraries aside, are that it has several different implementations of the same concept of function - blocks, procs and methods, having mediocre first-class function support due to keeping that silly value vs. function value behaviour inherited from the equivalent Common Lisp misfeature, completely misunderstanding properties (partly as a result of the former: a method should really be just a property which happens to be a function, or an object that can be used with the (...) operator), and having unnecessary complexity and irregularity in the syntax which is good for nothing and bad for everything. I suppose people who enjoy Perl may enjoy Ruby in the sense that it feels like you're writing some kind of "seekret haxxor code", but all you're really doing is spend about the same time writing a much less readable and maintainable program that looks like ass.
I'd like to post quote from the first words of R6RS, the Scheme standard, which I consider to be the ultimate design criteria, not only for programming languages, but for software in general, and perhaps things beyond software:
"Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary."
Anything you can scavenge, with as much RAM as possible (for the system cache), running Linux without GUI and needless stuff (saved RAM goes for the system cache), and the best storage drive you can afford having the size you require. Of course, your priorities as far as storage goes should be:
1. RAM (make all of it fit in RAM; most expensive; ridiculously fast; will probably require a 64 bit machine). Hint: Google uses pulls the critical stuff off RAM, not hard drives. 2. Flash storage (excellent for concurrency; fragmentation and parallel operations don't degrade performance; lots of other advantages such as durability, power, noise, size, weight, can be turned off anytime, etc.). 3. Hard disk drive. Disregard the bus, the hard disk is usually slower anyways. Especially skip SCSI unless you have a very good reason for it; prefer SATA.
And regarding lambda, I don't give a damn about what Guido said, the obvious solution of having its contents wrapped by INDENT and DEDENT tokens is clear and simple. Probably, he just doesn't like how it looks when DEDENT is followed by a comma.
1. It's faith
*Any* faith is misguided. You may think something probable, work with a theory, build new premises upon reasoning on existing ones (and remember to carry, add and multiply probabilities if you're not basing on facts!), or just play what-if, but blindly believing on something "just cuz", "just cuz it's nice", "just cuz lotsa ppl think so" or "just cuz there has to be sumthin lool" is not going to help anything or anyone.
But to each their own. I'm equipped with a brain so I like using it and refuse to accept things blindly and irrationally.
I hate to have to say this because I know what would Commander Ackbar say of .NET (unlike some gullible fools), but Microsoft has a better choice of languages for .NET DLR than the community has for Parrot, not to mention .NET DLR actually works. Even some gullible fools are trying hard to make IronPython work on Linux, Santa knows why.
They don't need to be faked because they exist for real. It's just that "=" doesn't do what one'd expect at first, and this may be uncomfortable but it's how it is and nevertheless it's getting fixed. (The other two choices would have been to add a defining statement that'd make your variables global the second you forgot, like JavaScript or Perl, or to try to be smarter in how you detect outer variables or create inner versions of them if they don't exist, but even that may have problems too.)
And you are:
:) .
1. Mocking environmentalism;
2. Thinking by hating a religion I hate the gullible fools that follow it (if anything, I hate the immoral atheists who created it to abuse their lambs);
3. Disregarding that illogical and contradictory things don't need to be disproven, and that even if presented with a non-illogical and non-contradictory belief such as "flying green elephants no-one has ever seen", it's their task to prove, not mine to disprove.
But I get your point
Oops, my first example got screwed up. I meant:
... This is like my 6th attempt.)
Argh, this never shows up properly. Consider % a space.
higher_order_function(lol, lambda x, y:
%%%%code goes here...
%%%%more statements...
, next_arg, etc)
(Wow, I hadn't realized how badly does Slash suck. No proper code formatting, ugly HTML formatting, no HTML entities, no Unicode support,
Python's lambda is limited to a single expression, which sucks, but you can always do def _(...) just before use. As for closures, Python implements closures properly (properly = as described in SICP, the environment model of evaluation), but immutable objects such as numbers or strings are, well, immutable, and the = operation played on a bare symbol always defines it in the current scope. However, an improvement on this regard is coming on Python 3000.
...code goes here... ...more statements...
Python's parsing of vertical whitespace is not ambiguous. Lambda doesn't support statements because Guido doesn't want to. I would easily allow something like:
higher_order_function(lol, lambda x, y:
, next_arg, etc)
Or, if Python didn't have statements (which are the real flaw IMO), you would just do something like:
higher_order_function(lol, lambda x, y: progn(
whatever,
whatever), next_arg, etc)
Define progn as lambda *a: a[-1].
"interesting programming" --- You call line noise "interesting programming"? Name one thing that's not insanely unmaintainable and therefore useless that you can do on Perl and cannot on Python.
Python is not dumbed down, it's simplified. The introduction of R6RS (Scheme) contains the best insight I could ever find on the design of languages (and software in general): "Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary.". Python does this better.
Ruby slow? Who gives a damn? Faster processors or larger farms are cheaper than man hours, so if it's more productive than, say, Java (and pretty much anything that's not assembly would be), then it's well worth it. The problem with Ruby is that it's fugly and doesn't follow the above mentioned principle, and that it has sub-par Unicode support (then again, PHP does too), not that it's slow.
And Python has good Unicode support, what are you talking about?
Also, if you consider PHP's misfeature of magic quotes (or who knows what else), you need to relearn the definition of security.
Python runs even on frigging PSPs. I call that portable.
Lol, why is parent -1 Flamebait? He should be funny.
I'm a tree-hugging, religion-hating, free software-supporting atheist, but the reason why I don't use Perl is not that Larry Wall is a Christian. It's that I want to keep my sanity.
No, MySQL is working on another engine (Falcon), and there are third-party (and still GPL) transactional engines like Solid.
"What would they replace it with?" - An "S"
I suppose they'll add a "metrosexual gene" for the Mac version. iSpore: breed with style.
SELECT goal FROM life; did not work as expected.
Lol, Apple iFanboys are wasting their mod points on this. Better keep them busy here rather than have them influence meaningful discussion.
iMalware. Get hacked with style.
Since you are about to get screwed up, better do it while listening to your latest DRM-ridden iTunes music in your grossly overpriced iPod. Make iMalware part of your digital lifestyle. It looks much better than Windows'!
Will it recognize metrosexual accents?
Now that's high-resolution. Hmm, 33 MPix hentai...
I think it's overkill. The vast majority of us don't have that kind of room, bandwidth, money, and vision to benefit from this.
What a great idea! The Apple iChair. Sit different. A chair for classy metrosexual fanboys to use their obscenely overpriced iMacs and listen to their defective by design and obscenely overpriced iPods while on it. Even farts smell stylish if thrown on the iChair.
Only $1000.
Like all "automagic" bullshit for lusers, whatcouldpossiblygowrong
I'm sure the pig would have wanted to live. This is so "heartless". I hope you fail. And no, I'd rather die if my heart fails than accept something that took countless lives to create.
While I don't usually find "the Pythonic way" too bad, I always follow my own personal style, which is a lot more Lispy. For example, I'll prefer a higher-order function over a class with just __init__ and __call__ any day (__call__ is great for objects that have methods and publicly-used properties, but it's kind of lame to use it just to avoid a higher-order function).
def progn(*a):
return a[-1]
There you go, multiexpression lambdas in the form of:
lambda args: progn(expr1, expr2, expr3...)
The problem lies in statements, IMO one of the worst features ever.
The Python Paradox
Paul Graham
http://www.paulgraham.com/pypar.html
August 2004
In a recent talk I said something that upset a lot of people: that you could get smarter programmers to work on a Python project than you could to work on a Java project.
I didn't mean by this that Java programmers are dumb. I meant that Python programmers are smart. It's a lot of work to learn a new programming language. And people don't learn Python because it will get them a job; they learn it because they genuinely like to program and aren't satisfied with the languages they already know.
Which makes them exactly the kind of programmers companies should want to hire. Hence what, for lack of a better name, I'll call the Python paradox: if a company chooses to write its software in a comparatively esoteric language, they'll be able to hire better programmers, because they'll attract only those who cared enough to learn it. And for programmers the paradox is even more pronounced: the language to learn, if you want to get a good job, is a language that people don't learn merely to get a job.
Only a few companies have been smart enough to realize this so far. But there is a kind of selection going on here too: they're exactly the companies programmers would most like to work for. Google, for example. When they advertise Java programming jobs, they also want Python experience.
A friend of mine who knows nearly all the widely used languages uses Python for most of his projects. He says the main reason is that he likes the way source code looks. That may seem a frivolous reason to choose one language over another. But it is not so frivolous as it sounds: when you program, you spend more time reading code than writing it. You push blobs of source code around the way a sculptor does blobs of clay. So a language that makes source code ugly is maddening to an exacting programmer, as clay full of lumps would be to a sculptor.
At the mention of ugly source code, people will of course think of Perl. But the superficial ugliness of Perl is not the sort I mean. Real ugliness is not harsh-looking syntax, but having to build programs out of the wrong concepts. Perl may look like a cartoon character swearing, but there are cases where it surpasses Python conceptually.
So far, anyway. Both languages are of course moving targets. But they share, along with Ruby (and Icon, and Joy, and J, and Lisp, and Smalltalk) the fact that they're created by, and used by, people who really care about programming. And those tend to be the ones who do it well.
I disagree. I'm a supporter of multi-paradigm programming ("the right tool for the right job") and consider functional programming approaches the most important of all. I find Python very comfortable to work with, and much conceptually cleaner than Ruby.
While Ruby has one advantage or two over Python, such as multi-expression lambdas and Python's statements turned to expressions (statements are a common root of evil and an unnecessary procedural concept), the main problems I see in Ruby as a language, leaving libraries aside, are that it has several different implementations of the same concept of function - blocks, procs and methods, having mediocre first-class function support due to keeping that silly value vs. function value behaviour inherited from the equivalent Common Lisp misfeature, completely misunderstanding properties (partly as a result of the former: a method should really be just a property which happens to be a function, or an object that can be used with the (...) operator), and having unnecessary complexity and irregularity in the syntax which is good for nothing and bad for everything. I suppose people who enjoy Perl may enjoy Ruby in the sense that it feels like you're writing some kind of "seekret haxxor code", but all you're really doing is spend about the same time writing a much less readable and maintainable program that looks like ass.
I'd like to post quote from the first words of R6RS, the Scheme standard, which I consider to be the ultimate design criteria, not only for programming languages, but for software in general, and perhaps things beyond software:
"Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary."
Anything you can scavenge, with as much RAM as possible (for the system cache), running Linux without GUI and needless stuff (saved RAM goes for the system cache), and the best storage drive you can afford having the size you require. Of course, your priorities as far as storage goes should be:
1. RAM (make all of it fit in RAM; most expensive; ridiculously fast; will probably require a 64 bit machine). Hint: Google uses pulls the critical stuff off RAM, not hard drives.
2. Flash storage (excellent for concurrency; fragmentation and parallel operations don't degrade performance; lots of other advantages such as durability, power, noise, size, weight, can be turned off anytime, etc.).
3. Hard disk drive. Disregard the bus, the hard disk is usually slower anyways. Especially skip SCSI unless you have a very good reason for it; prefer SATA.
And there you go.