Why Python?

Cardinal Biggles had Eric in the comfy chair for over four hours before wringing this confession from him...
______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

on choosing which language is superior

Joe Holt's picture

you hit the nail there. it is easy to say that a code is superior until you use it yourself. every programming has its own difficulty and every coder has his or her own unique style. logic is not something that is uniform among people. so i have to say it really depends on the experience of the coder on judging which programming language is superior. contact me @Joe Holt if you need additional input.

Despite his famous name, I

Anonymous's picture

Despite his famous name, I think that the author hasn't got even the slightest idea about modern Perl (Perl 5) and how to manage big projects with it, something that so many large companies happily do (Amazon among these).
All the comments the author made about Perl seem to refer to Perl 4, and he seems to not have even the slightest clue about CPAN and the modern tools (Perl::Critic et al.) it offers to automate the enforcement of coding standards and best practices across a large developers team.

so tell me, what part of

Anonymous's picture

so tell me, what part of "written in 2000" did you NOT understand?

Another flame from a clueless perl programmer

Anonymous's picture

No, the author has programmed much more Perl then this random troll. The fact is Perl does indeed suck, which is why no one uses it anymore. Amazon just did a big rewrite to ensure they didn't depend too much on a dead language (Perl).

The most complex and

suicide's picture

The most complex and integrate computer hardware is useless without instructions telling it what to do. These instructions are called programs and are written in computer programming languages. These computer programming languages allow people to communicate with the computer.

Compared to today's computers, the first computers were very simple. They were programmed by flipping switches or by inserting punched cards. They were only capable of doing simple math problems, such as addition and subtraction. The language used for these simple computers was not capable to perform the tasks of today's modern computers - graphics, word manipulation, etc. To make programming modern computers possible, more sophisticated languages had to be developed.

Machine Language
In a computer, all information or data is represented by numbers that represents electrical circuits in the computer. Electrical circuits in a computer exist in only two conditions: ON and OFF. Computers represent these states with the binary number system. The binary number system uses only digits 0 and 1 where a 0 indicating the switch is off; a 1 indicates that it is on. Each character (letter, number, or symbol) in the computer's character set is represented by a series of these off and on switches - in other words, by a series of 0s and 1s. Each switch called a bit, with is short for binary digit. Most computers use eight bits, or switches to represent each number, letter, or symbol. The collection of eight bits used to represent a character is called a byte.

Because computers understand only these on and off switches, the first programmers had to write the program using nothing but 0s and 1s. Instructions written in 0s and 1s are called machine languageor machine code.
Writing a program in machine language is very difficult because even a simple program requires hundreds or even thousands of microprocessor instructions. Another problem is that the numbers used to represent microprocessor instructions are difficult for people to understand and these programs were often prone to errors.

Assemble Language
In trying to make programming easier and not having to write in binary, assembly language was born. Assembly Language is slightly more advanced than machine code. The assembly languages simplify the programmer's job by allowing the programmer to use mnemonics in place of 0s and 1s in the program. Mnemonics are letters and numbers to represent machine language instructions. However, assembly language is still difficult for novices to read, and is specific to the machine's architecture.
Assembly language programming is accomplished using an assembler. An assembler is a program that reads the codes the programmer has written and assembles a machine language program based on these codes.

High Level Procedural-Oriented Languages
Machine language and assembly language are called low-level languages. Most programming done today is done in high-level languages. In a high-level language, instructions do not necessarily correspond one-to-one with the instructions set of the microprocessor. High-level languages reduce the number of lines of code necessary to write a program and reduce the number of errors because the programmer does not have to write as many instructions, and the instructions are easier to read. High-level languages are also easier to move among computers with different microprocessors.
In high-level procedure-oriented languages, the emphasis of a program is on how to accomplish as task, or objects, the order of the instructions is extremely important. When writing programs in a procedure-oriented language, the programmer must determine not only the proper instructions to give the computer, but the correct sequence of those instructions as well. A programmer will typically use a design methodology called top-down design to create a procedure-oriented program. Top-down design begins with a general statement describing the purpose of the program this purpose is then broken into smaller, more manageable tasks; and eventually into the actually high-level procedure-oriented language instructions.
High-level procedure-oriented languages require a compiler to convert the English-like instructions into the 0s and 1s the computer can understand. Like assemblers, compilers are separate programs. A compiler translates the entire program into machine code before running the program. Some of the high-level procedure-oriented languages include BASIC, COBOL, Pascal, and C.

A computer does not understand high level language. Several translations must be accomplished before it will understand what the programmer intended. The instructions in a high-level language must be translated into the one language a computer understands -machine language. There are two types of programs that perform the task of translating high-level languages into machine language-interpreters and compilers. Once the "source code" is translated a second file is produced called an object code.In high-level procedure-oriented languages, the emphasis of a program is on how to accomplish a task or the algorithm. The programmer must instruct the computer every step of the way. The programmer determines and controls the order in which the computer should process the instructions. In all procedure-oriented programs, the order of the instructions is extremely important. When writing programs in a procedure-oriented language, the programmer must determine not only proper instructions to give the computer, but the correct sequence of those structures as well.

Object-Oriented Languages
The most recent advance in high-level languages has been the introduction of object-oriented languages. C++ and Visual Basic are two popular object-oriented languages. Programs that are WYSIWYG (what you see is what you get) are based on these same principles. Object-oriented languages view a problem solution as a set of interacting objects. A programmer typically uses a design methodology called object-oriented design (OOD). The programmer begins with a statement that describes the purpose of the program and divides the program into one or more objects. The objects in an object-oriented program can take on many different forms such as menus, options buttons, and command buttons. Objects may also take on real-life meanings (examples include an employee, date, and time card object).
There are two main advantages of object-oriented languages over procedure-oriented languages. First it allows a programmer to use familiar objects to solve a problem. Second, because each object is viewed as an independent unit, an object can be used in more than one application. Many object-oriented languages are direct descendants from procedure-oriented languages and can be used to create both object and procedure-oriented programs.
Like procedure-oriented languages, object-oriented languages need a compiler to translate the high-level instructions into machine code.

OOP Terminology

Object - anything that can be seen or touched (example being a car); every object has attributes and behaviors
Attribute (data) - characteristics that describe the object (example: your car (the object) has tires (the attribute))
Behaviors - operations or actions that the object can either perform or have performed on it (example: your car (object) can accelerate (behavior))
Class - a pattern or blueprint for creating an object; it contains all of the attributes and behaviors that describes the object
Instance - the object that you create from a class; note that a class is not an object; however an instance of a class is an object
Encapsulation - combining of an object's attributes and behaviors into one package (a class)
Abstraction - hiding the internal details of an object from the user; protects against the user inadvertently making changes to the object
Exposed - attributes that are not hidden from the user
Inheritance refers to creating a new class (derived class) from an existing class (base class); note that the derived class inherits the attributes and behaviors from the base class
Linking - The object code for your C++ program must be combined with the object code for routines (such as input and output routines) that your program uses. This process of combining object code is called linking and is done by a program called a linker

lack of details in comments

Viking's picture

Most of the comments I see on Python have a religious feel to them. They do not
contain technical details. They are of the form: "Python programs are short and easy to program". What would be preferable would be comparions to Java, for example construct by construct, and not Java 1.4 or earlier but Java 1.5 that has autoboxing and for(type id : collection) loops, enumerated types, etc. One of the specific advantages I see in Python is the set, list and map collector syntax. However this is not highlighted in most of the comments I see. I wonder why. Another debate that I would encourage is the static versus dynamic typing issue. Can Python be used for softare that has to be reliable when it is dynamically typed? What is the experience writing thousands of lines of untyped code? Does it crash occasionally because a specific path throgh the program was never tested, causing a type error to occur (for example adding a number to a list of numbers.

So ... details guys and girls!

the basics are more or less

suicide's picture

the basics are more or less the way YOU can understand the language that of a computer system. numbers and letter with add ons.it is important to remember that just because you know the basics of hacking anything you need to know how to get in and get out with little or no trace that you were there.breaking into a major web site is in it's own way easy but very complicated understanding all the codes and passwords scripts and how to pass them with out getting booted because they will send illegal access codes to your IP address and shut you down while the feds are on to you.typing fast is also a key to good hacking.typing without mistakes is hard to complete but after you learn more of the world we live in you will make little mistakes.reasons you cant find alot of info on the net about how to learn to hack is because we dont want to let the secrets out.anyone can become a hacker it is just how you look at the way it works.you need to learn much about encoding and scripts.like if someone makes a page to a password that is loaded into the script box and then in the main page it will let you access it with the password but if someone forgets to upload the password file BAM you get in by simply pressing the button that login pages require.as if you try and steel from the net with no way knowing how to read the computer the way you have to.kiss you ass good bye.as i sat in my cell for hacking in the federalsystem and changing my record and then making ATM's read any card and give as much as i want i wanted to do it more and more...now i am known as suicide.understanding how to hack pro is a very long process as it takes some knowledge of how to read the sorce codes and all that happy stuff.and myspace is nothing to hack into...try hacking in something usefull.oh and hackers dont beg for ways to hack we just learn on our own.

learning python

Anonymous's picture

what is the best way to learn python? not easiest, best. should i buy a book, or can i learn on my pc. i have been abused by ppl that call themselves hackers several times, especially when im beating them at chess they can stop timers and so forth. these are not hackers, they are cheaters! i only desire to become a hacker to protect myself from cheaters and grow intelectually. i have a 4 year, so i know i can learn. i know noone can teach me i have to learn myself, but where do i start? useful information will be rewarded monetarily. i will be buying linux soon, so dont wait forever with the info. teaching me could be a part time job for some lucky hacker!peace out.

The Basics

Gharkib's picture

What you are describing, is not hacking, but rather cracking. A cracker is, as per the Great Jargon File
"One who breaks security on a system. Coined ca. 1985 by hackers in defense against journalistic misuse of hacker (q.v., sense 8)...a separate and lower form of life..."
This is a generalization of a cracker. Do you want to be that separate and lower form of life, or do you desire to transcend to Hackerdom? To learn more, read "The Loginataka", "How to Be a Hacker" and browse the "Jargon File".

Good article, disrupted by perl users

Anonymous's picture

The article was good and demonstrates well the fact that there is no need for perl anymore really. No more then there is for sed, awk or any of those old unix tools.

Unfortunatly perl seems to attract a very odd sort of person, someone who constantly feels the need to bash everything else that they feel threatens the language (notice the author didn't try to say don't use perl, just not for everything. not the response you will get from a perl advocate).

These strange people always say odd things like "Perl can actually be very readable if written that way". Great, so can assembler, but I would rather use a language that *encourages* this instead of one so hostile to it (the reason people write unreadable perl is because that code will run much faster then the readable counter-part).

Or another gem is "Perl can do anything I need it to do". Well if these were programmers instead of system admins that *think* they are computer scientists, they would realize any Turing compliant language can do "anything I need it to do". The question is only about how much code and how maintanable.

And the last thing they bring up is always "well I just couldn't live with a language that didn't have as many modules as perl does". Well, the vast majority of those modules you will never us. And many modules are basically the same problem space redone 10 different ways. Perl's CPAN giving it some great power is a myth. If you are doing something really obscure there is a chance CPAN might save you a little time, but for 99% of the people Python, Ocaml, Ruby, etc. have everything you will ever use.

The article mentions the fact that you lose familiarity with your program very quickly. This is a side effect of the chosen design. Larry Wall mistakenly believes that natural language is what a programing language should be modelled after. This view seems very ignorant of computer science in general. To manage complexity (and programming, after all, is mostly about managing complexity) steps must be made to ensure the program can easily be reasoned about. This is the exact opposite goal of a natural language. Just think of how many times you have misunderstood what someone said in their life. There is a reason for this.

Natural language has the distinguishing trait that it is *not* like riding a bycicle. When you ride a bycicle for just a little while and then leave it for 60 years, you will still know how later on should you try again. However, if you stop speaking a language for half that time you will have forgotten nearly everything about it. Natural language is so complicated we can only keep it in our head if we use it constantly. And someone wants to model a programming language after that?!

Hit 'em high!

__anonymous__'s picture


The article was good and demonstrates well the fact that there is no need for perl anymore really. No more then there is for sed, awk or any of those old unix tools.

That's strange, most of the CGI scripts on the web is written in Perl -- did you say useless? Hum, and those *old* unix tools are still useful. Correct me if I'm wrong but I think they're the best way to introduice the use of ``regular expressions'' -- even if it's only for a general culture.


Unfortunatly perl seems to attract a very odd sort of person,(...)

Do you mean that most of the hacker community are psycho? :). Yeah, you're dead right.


These strange people always say odd things like "Perl can actually be very readable if written that way". Great, so can assembler, but I would rather use a language that *encourages* this instead of one so hostile to it (the reason people write unreadable perl is because that code will run much faster then the readable counter-part).

I don't get the picture here. No *strange* people actually encourages the use of unreadable code. But the language is expressive enough that everybody could do *whatever* he wants -- even dumping some piece of _write-only_ code I have to admit.


Or another gem is "Perl can do anything I need it to do". Well if these were programmers instead of system admins that *think* they are computer scientists, they would realize any Turing compliant language can do "anything I need it to do". The question is only about how much code and how maintanable.

I suggest __Brainfuck__ :)
No more seriously, you'd hardly find another scipting language that produce more consice code than Perl. And the maintenance depends on the *way* you wrote it.


(...). Perl's CPAN giving it some great power is a myth. If you are doing something really obscure there is a chance CPAN might save you a little time, but for 99% of the people Python, Ocaml, Ruby, etc. have everything you will ever use.

So does Perl. I don't know if you've noticed the author mentionned that for a work of less than 100 lines, Perl is *okay*. And that's what 99% of the people have to deal with.


The article mentions the fact that you lose familiarity with your program very quickly. This is a side effect of the chosen design. Larry Wall mistakenly believes that natural language is what a programing language should be modelled after. This view seems very ignorant of computer science in general. To manage complexity (and programming, after all, is mostly about managing complexity) steps must be made to ensure the program can easily be reasoned about. This is the exact opposite goal of a natural language. Just think of how many times you have misunderstood what someone said in their life. There is a reason for this.(...)

Yeah, Larry Wall wasn't a visionary after all -- he's just a jack adams with rubbish ideas :) -- we've been deceived. A true language should include a bunch ``goto'' and whatever else a machine could easily read except for a human side, right?
The main advantage of natural language is that you don't need to know all the *vocabulary* to understand it. That's not the case of machine-language: you need to know exactly what you're doing if you don't want to be in trouble. So yes, you could start to learn a ``natural language'' very quickly but you need time and and practice before you could mastered its arcanes -- that's the downside.

PS: I'm not a Perl zeloat, just an average user.

"That's strange, most of the

Jesin's picture

"That's strange, most of the CGI scripts on the web is written in Perl -- did you say useless?"

That's strange, most of the users of the web are running Windows...

"Hum, and those *old* unix tools are still useful."

Yes, *those* old unix tools are still useful. Those. As in plural. As in, "do one thing, do it well." Each of those tools has its own syntax specialized for its own specific purpose. Perl takes all those tools and tries to squeeze not only the functionality but also the syntax of every single one into the same language. Python has the same functionality, it just doesn't try to put all of it into the core language. It's called the standard library. For example:

import optparse

re: Hit 'em high

Anonymous's picture

That's strange, most of the CGI scripts on the web is written in Perl -- did you say useless? Hum, and those *old* unix tools are still useful. Correct me if I'm wrong but I think they're the best way to introduice the use of ``regular expressions'' -- even if it's only for a general culture.

Yes most of the "cgi" scripts are perl. But most of the web isn't written in CGI anymore. Welcome to early 2000. And by "old unix tools" I meant things like sed and awk. They are still useful on the command line but not really needed in scripts like they were before. And every language has regular expressions now. No need to go into Perl for it.

Do you mean that most of the hacker community are psycho? :). Yeah, you're dead right.

Most of the hacker community... Why must obscure groups always try to make themselves sound like the majority? No, I mean people who use Perl and like it have issues.

I don't get the picture here. No *strange* people actually encourages the use of unreadable code. But the language is expressive enough that everybody could do *whatever* he wants -- even dumping some piece of _write-only_ code I have to admit.

Of course you don't get the picture. Perl is all about misunderstandings and it's advocates take this trait to heart. And have you not read you lord's writings? Look at what he says you do to read lines of a file, then look what he says an "experienced" perl programmer would do. Just because someone *says* they are writing good code doesn't mean it's true.

I suggest __Brainfuck__ :)
No more seriously, you'd hardly find another scipting language that produce more consice code than Perl. And the maintenance depends on the *way* you wrote it.

Interesting that you chose a language with similar readability. :) And yes, of course you can find languages that produce more concise code. The difference is; some concise lisp, for example, is still readable and probably accomplishes something useful. And to find something perl does in less lines of code you have to select specific sorts of tasks. Stay away from making classes, for example. More sensible languages like Python, Ruby, well almost anything other then C or Java do this much simpler and obvious what is going on.

So does Perl. I don't know if you've noticed the author mentionned that for a work of less than 100 lines, Perl is *okay*. And that's what 99% of the people have to deal with.

Uh, did you completely miss the point of the paragraph? And no, 99% of the people *start* with less then 100 lines, but when you get something working you always wind up adding features to it. So for this reason it is just best to avoid perl all together in all cases.

Yeah, Larry Wall wasn't a visionary after all -- he's just a jack adams with rubbish ideas :) -- we've been deceived.

Pretty much. Calling Larry a visionary surely must be a joke. He is closer to a lottery winner (i.e. he did nothing more then "buy a ticket" by putting his program on the net and managed to win some support. Being in the right place at the right time). But yes, anyone who thinks perl is anything but a horribly designed, horribly implemented exercise in what not to do that had already been learned a couple of decades before, is deceived.

A true language should include a bunch ``goto'' and whatever else a machine could easily read except for a human side, right?

Um, the reason I am against perl is exactly *because* it takes us backwards in computer science. It's basically C with strings, automatic memory allocation and without core dumps happening quite as often. It's hilarious that you assumed I wanted a *less* human readable language. We need *higher* level languages to get our work done fast, instead of playing around with bit twiddling. And we have had higher level languages for quite some time now.

The main advantage of natural language is that you don't need to know all the *vocabulary* to understand it. That's not the case of machine-language: you need to know exactly what you're doing if you don't want to be in trouble. So yes, you could start to learn a ``natural language'' very quickly but you need time and and practice before you could mastered its arcanes -- that's the downside.

Uh, no. You analogy is 100% wrong. You need to know a *lot* of vocabulary before you even *think* about talking. Babies supposedly know around 2-4k words before they say their first one. And notice you jumped from "to understand it" for natural language but "know what you are doing" for machine-language (obviously you would want a well designed high level language, not machine language). There is a very large gap between being able to *understand* (your natural language statement) a language, natural or computer, and being able to *speak/use* (your machine-language statement) a language, natural or computer. So basically, your point is completely invalid and you don't seem to have any idea about any of these subjects you are talking about. But don't feel bad, the rest of your camp are no better.

PS: I'm not a Perl zeloat, just an average user.

What a ridiculous attempt to add validity to your clearly zealotus statements. And of course it failed miserably. It is very clear to everyone that you are a perl zealot.

Ain't Here To Be Your Friend

__anonymous__'s picture


Yes most of the "cgi" scripts are perl. But most of the web isn't written in CGI anymore. Welcome to early 2000.

Um... It seems that there are still a bunch of neanderthals out of here. How about these guys -- did you forget to profess them the wise words?


And by "old unix tools" I meant things like sed and awk. They are still useful on the command line but not really needed in scripts like they were before. And every language has regular expressions now. No need to go into Perl for it.

There's a little difference between ``still useful on the command line'' and ``No more then there is for sed, awk or any of those old unix tools''. Of course every language have regular expressions. The main issue is the implementation in the given language. For example, it's tiresome to use it with Java.


Most of the hacker community... Why must obscure groups always try to make themselves sound like the majority? No, I mean people who use Perl and like it have issues.

It's funny seeing someone overreacting at every piece of joke. Everytime these magic words are pronounced, there's always someone who take them at first degree. Did you really think I was serious? Come on!


Of course you don't get the picture. Perl is all about misunderstandings and it's advocates take this trait to heart. And have you not read you lord's writings? Look at what he says you do to read lines of a file, then look what he says an "experienced" perl programmer would do. Just because someone *says* they are writing good code doesn't mean it's true.

My ``Lord''? Do you think that I worship Larry Wall? For me, Perl is just a language like another one. It's not that I don't hate it that I must be an addicted. And yes, I don't take for granted what everyone says: I don't agree with Eric Raymond and you, see.


Interesting that you chose a language with similar readability. :)

Why bother? It's simple, ergonomic and have practical utilities :)


And yes, of course you can find languages that produce more concise code. The difference is; some concise lisp, for example, is still readable and probably accomplishes something useful. And to find something perl does in less lines of code you have to select specific sorts of tasks. Stay away from making classes, for example. More sensible languages like Python, Ruby, well almost anything other then C or Java do this much simpler and obvious what is going on.

Let's put it clear once for all. Perl is *ugly* because the designers and the Perl community *wanted* it that way. The readability has been sacrificed for the utility. So actually, everyone knows with what he have to deal with when he uses it. Of course Python and Ruby choose another philosophy -- fine. It's up to everyone to find out what fits his mind.


Uh, did you completely miss the point of the paragraph? And no, 99% of the people *start* with less then 100 lines, but when you get something working you always wind up adding features to it. So for this reason it is just best to avoid perl all together in all cases.

In everything? Even if you have to use a lot of pattern matching? And for a sysadmin for example, a typical script is about 30 lines. I don't use Perl for everything but I actually think that in some situations it's the best candidate.


Pretty much. Calling Larry a visionary surely must be a joke. He is closer to a lottery winner (i.e. he did nothing more then "buy a ticket" by putting his program on the net and managed to win some support. Being in the right place at the right time).

So does Richard Stallman and Linus Torvalds and the list goes on. So what? Being in ``the right place at the right time'' doesn't require any quality?
You need to have a certain insight of the situation to be able to understand that there's a vacuum and somebody got to fill it.
Maybe if another language which would have the same features appeared at the same time, the story could be different. But that's not the case, Perl was already on the wild and had a huge community before Python and later Ruby appeared. And the language is flexible enough that it adapted succefully | awkwardly (depending from which board you come from) when the internet rose up.


But yes, anyone who thinks perl is anything but a horribly designed, horribly implemented exercise in what not to do that had already been learned a couple of decades before, is deceived.

cf what I mentionned above.


Um, the reason I am against perl is exactly *because* it takes us backwards in computer science. It's basically C with strings, automatic memory allocation and without core dumps happening quite as often.

Yes and everybody actually reckons that, you know.


It's hilarious that you assumed I wanted a *less* human readable language. We need *higher* level languages to get our work done fast, instead of playing around with bit twiddling. And we have had higher level languages for quite some time now.

Need to be enlightened?
Of course we need a high level language to accomplish a job rapidly. It's not time consuming anymore except in some critical areas. So when I'm refering to the ``goto'' trick, I'm not talking about the level of the language.
You mentioned earlier we should ensure that a program should easily be reasonned about for a *good* language, fine. In theory that's great. But in practice?
A program to be easily reasonned about should have no ambiguities in the syntax so you don't have to misinterpret it. The best way to accomplish this is to produice a ``turing-machine'' like code. That's why I ask you if a *true* language should include a bunch of ``goto''.


Uh, no. You analogy is 100% wrong.

That for sure is the best way to keep the discussion on.


You need to know a *lot* of vocabulary before you even *think* about talking. Babies supposedly know around 2-4k words before they say their first one.

Sounds interesting. Source?
So let's suppose it's true. But remember that for example there's over 500,000 words in english. Thus, the baby needs to know less than 0.8 % of the total vocabulary before he could pronounce a word. I don't think it's that much.


And notice you jumped from "to understand it" for natural language but "know what you are doing" for machine-language (obviously you would want a well designed high level language, not machine language).

Yeah, I'm a lazy bastard so I said it all at once. I was talking about the syntax not the vocabulary. Of course a machine-language have only few vocabularies.


There is a very large gap between being able to *understand* (your natural language statement) a language, natural or computer, and being able to *speak/use* (your machine-language statement) a language, natural or computer.

Of course *understanding* a language doesn't mean that you could speak|use it fluently. But for a natural language -- since it's more flexible and permissive -- you could learn it by practice.
E.T. phone home: even if it's not a correct english, everyone understands what it means. But a machine -- say an A.I. -- wouldn't understand the phrase if it's not spelt correctly.


So basically, your point is completely invalid and you don't seem to have any idea about any of these subjects you are talking about. But don't feel bad, the rest of your camp are no better.

Rest of my camp? :) I represent nobody else than myself.
And I don't feel bad. Do you really think that I would take into my heart what you're groaning about? I'm cold to all of this, cold to what you feel.


What a ridiculous attempt to add validity to your clearly zealotus statements. And of course it failed miserably. It is very clear to everyone that you are a perl zealot.

Did you make a local survey to know their opinion? It's not that I don't agree with you that I'm inevitably a Perl fanatic.
An ad hominem attack never works on me. Like I said before, we're not obliged to be friends.

So long, John...

Too bad, wonder if I can get my money back for these roses...

Anonymous's picture

Um... It seems that there are still a bunch of neanderthals out of here. How about these guys -- did you forget to profess them the wise words?

Do you even look at the links you post? The first hit on the first link is a company from the late 70's called CGI (since it's before the web I'm guessing it doesn't mean common gateway interface). Most of the rest on the first page are just explaining what CGI is. On your second link, I don't know. It was a 404 error, maybe they moved into early 2000 as well.

There's a little difference between ``still useful on the command line'' and ``No more then there is for sed, awk or any of those old unix tools''. Of course every language have regular expressions. The main issue is the implementation in the given language. For example, it's tiresome to use it with Java.

No actually there isn't. The phrase "no more useful" means the same as "just as useful as but no more". Get it?

And yes, in Java regular expressions, making hello world, printing to the screen, etc., etc. are complicated. In python and ruby, for example, re's are just as simple (some might say easier).


It's funny seeing someone overreacting at every piece of joke. Everytime these magic words are pronounced, there's always someone who take them at first degree. Did you really think I was serious? Come on!

The way I usually detect jokes is when someone says something that is funny on purpose. Sorry I missed this one some how. ;)


My ``Lord''? Do you think that I worship Larry Wall? For me, Perl is just a language like another one. It's not that I don't hate it that I must be an addicted. And yes, I don't take for granted what everyone says: I don't agree with Eric Raymond and you, see.

I still don't buy your "I'm not a Perl zealot, just an average Joe" routine. So yea, I kind of do suspect you of having life size Larry Wall posters, etc.


Let's put it clear once for all. Perl is *ugly* because the designers and the Perl community *wanted* it that way. The readability has been sacrificed for the utility. So actually, everyone knows with what he have to deal with when he uses it. Of course Python and Ruby choose another philosophy -- fine. It's up to everyone to find out what fits his mind.

No, it is ugly because it was made by and for Unix Sys admins. So it looks like the other tools they used. And you speak as if you have to get such an ugly language to get tersity. This is simply not the case. In fact, for the things I tend to do; lisp, smalltalk, python, ruby and some others all do the same thing in less statements then equivalent Perl code.


In everything? Even if you have to use a lot of pattern matching? And for a sysadmin for example, a typical script is about 30 lines. I don't use Perl for everything but I actually think that in some situations it's the best candidate.

Well, as I said before, Python and Ruby do pattern matching just as easy, and if the script winds up needing more features you can maintain it and still read it when you come back in a few years. I worked in Perl for 5+ years and I honestly can't think of a single thing it does better then some other solution.


So does Richard Stallman and Linus Torvalds and the list goes on. So what? Being in ``the right place at the right time'' doesn't require any quality?
You need to have a certain insight of the situation to be able to understand that there's a vacuum and somebody got to fill it.

But none of these people did that. Linus is not a visionary because of his initial release of Linux. He is a visionary because of everything that happened after that. Likewise Larry isn't excluded based on his original release of Perl. He, like Linus, probably didn't do the first release with the plan of making something big.

Larry is excluded because of everything that occurred after that. In the beginning Perl was what we would today call a DSL for text processing. It was when he decided to try and make it a general programming language and bolted on one misunderstanding based feature after another.

And the language is flexible enough that it adapted succefully | awkwardly (depending from which board you come from) when the internet rose up.

Any language was "flexible" enough to do the kind of adapting they did.

Yes and everybody actually reckons that, you know.

I have met enough "Perl mongers" in person and online to know this to be false. They genuinely believe that Perl is well implemented, and further, the language we should all be programming in!

You mentioned earlier we should ensure that a program should easily be reasonned about for a *good* language, fine. In theory that's great. But in practice?
A program to be easily reasonned about should have no ambiguities in the syntax so you don't have to misinterpret it. The best way to accomplish this is to produice a ``turing-machine'' like code. That's why I ask you if a *true* language should include a bunch of ``goto''.

Again, it's only your Perl-based CS understanding that makes you think this is so hard to do. Perl is actually one of the few languages that has syntax ambiguities. I would suggest going out and learning some better designed programming languages so you can see that you don't have to go so low level to make a language clear and powerful.


That for sure is the best way to keep the discussion on.

I suppose I should lie to you instead?

Sounds interesting. Source?

http://en.wikipedia.org/wiki/Pimsleur_language_learning_system

It was in one of the CD's or something for this system. It has been some time since I heard it, but it was part of their explanation of why the language teaching packet came with no text at all.


So let's suppose it's true. But remember that for example there's over 500,000 words in english. Thus, the baby needs to know less than 0.8 % of the total vocabulary before he could pronounce a word. I don't think it's that much.

Well it takes around 2 years to form the simplest sentences. It is simply unnecessary to make your programming language this difficult. You could also paint your house with a toothbrush, but why?


Of course *understanding* a language doesn't mean that you could speak|use it fluently. But for a natural language -- since it's more flexible and permissive -- you could learn it by practice.
E.T. phone home: even if it's not a correct english, everyone understands what it means. But a machine -- say an A.I. -- wouldn't understand the phrase if it's not spelt correctly.

This still isn't the point. The point is, yes people can and do learn natural language, but it is extremely complicated. If you are trying to manage complexity (which is basically what programming is) you want exactly the opposite of such a system.


Did you make a local survey to know their opinion? It's not that I don't agree with you that I'm inevitably a Perl fanatic.

It is not that you disagree with me. It is the position you take on these issues that labels your camp.

When I was looking for a

Anonymous_x's picture

When I was looking for a language for test system and tool making to replace C and C++, I had a look at Perl. But only a look. It is a truly ugly language and looked quite possibly more unmaintainable than Forth. Seeing a few random source listings convinced me the learning curve would be brutal.

A look at Python code suggested good things could be done quickly and efficiently. The indentation was not a big deal once I stopped mixing spaces and tabs - Python's only gotcha. I ended up writing some of the smartest code I had ever written simply because it was so easy to do.

Perl PHP and Python

Mohamed's picture

I agree with what you said that as the Perl code gets larger, it becomes unreadable. However, PHP is based on Perl (as far as I understand), and PHP is pretty readable and browsable even in large chunks of code. What I tried lately is to use PHP as in shell scripts, and it worked fairly well. Of course it was slow, and I expected that from the start however it was orders of magnitude simpler than Perl. I didn't do much Python coding but I also know that it is pretty powerful and I know many people who are currently using it in automated testing esp. in web applications where it fetches the pages and submits forms ...etc.

PHP not based on Perl!

PythonLearner's picture

Err, no, PHP is not based on Perl and doesn't read anything like Perl. PHP reads a lot more like C. Knowing C and similar languages, I was able to learn PHP very rapidly. Perl is a whole different world.

Everyone's different and the most different part if the brain

Jenda's picture

If Python fits your brain better than Perl, go ahead use Python. If Visual Basic fits ... OK, I'm kidding.
Anyway Perl fits MY brain just perfect so I'm gonna go on using it.

Tried Python, did not like it, returned back home. Tried Ruby, did not like it, returned back home. Maybe sometime I find something that'll feel even more natural and will allow me to be even more productive, until then Perl is my tool.

Python for Automated Testing?

Quincunx's picture

I didn't do much Python coding but I also know that it is pretty powerful and I know many people who are currently using it in automated testing esp. in web applications where it fetches the pages and submits forms

Really? I just happened to come across this article, and know virtually nothing about Python. I thought it might be a good intro as to the main benefit of using this language over another (and I think it has been).

Anyway, for the past few weeks I've been trying to find automated GUI testing tools for web applications; preferrably in PHP. Could you point me in the direction of the Python projects for testing, or people using them?

Rebol

Nick Antonaccio's picture

My preference is for REBOL. It has the easiest cross platform GUI tools I've seen, an elegant built-in parse dialect, built-in network protocols, CGI interface, many useful built-in data types (times, dates, money values, urls, binary representations of images, etc. are all recognized natively). Scripts run unchanged on 40+ platforms. REBOL's designed to allow for natural language dialecting, and it's got the most natural learning curve that I've seen, at least for average computer users who are new to coding. It comes in an absolutely tiny download (~ 1/7 to 1/2 meg, depending on platform and distribution). It's a shame so few people even know it exists.

I wrote a tutorial that teaches absolute beginners how to do many useful things with REBOL in about 160 pages:

http://musiclessonz.com/rebol_tutorial.html

Thanks!

Thoughts

J.Bell's picture

Having read a large amount of the replies to this article, (not all of them or I would be suffering a migrane) I would like to make some comments that may be of more use than slagging off the author (nameing no names).

What comes to mind first is the amount of replies asking how to become a hacker. Now correct me if I'm wrong, but I came to this article under the impression that it was an evaluation of Python, not a tutorial on hacking.

My advice to anybody who reads this in the hope that they will become hackers is to go and do some independant research. Although I do not claim to be a hacker, I do know that hacking is not something that can be taught straight off. It is something that requires a logical but open mind, background knowledge and understanding of computers, programming languages, network protocols and workings... the list goes on.

This is why you can't just "become a hacker" it takes a lot of work and independent research. A good place to start might be Eric Raymonds homepage "http://www.catb.org/~esr/". There is a very good article on hacking in the HOWTO's section, however it is all a matter of preference.

Secondly I would like to agree with certain people that breaking in to private computers and organisations is not hacking. It may require some skills that many hackers have, however this particular practice is commonly known as cracking... and yes it is illegal. If you want to become a hacker so that you can crack, I would imagine that you don't have the right mindset or patience to learn how to hack.

Moving on... all these posts claiming that people who keep moving from one programming language to another are "whimps". I completely disagree. In my opinion, a greater knowledge of programming as a whole, leads to more compact, efficient and pleasing programs that one can produce. I firmly agree with Eric's comment that learning different programming languages helps you to think about one same problem in different ways. This is a key method to problem solving and hence why I disagree that better programs can be written by learning only one language very well.

Finally, I am under the impression that the hacker morale embraces freedom of speech. Just some comments on this. I would advise that if you do have a strong opinion on a matter and would like to voice it, then you should be prepared to back your opinion up with some reasoning behind it. I have seen so many posts ranting about how they are right and other people are wrong with absolutely no reasoning as to why they are.

I would like to say more, but I think this post is long enough anyway. Comments are appreciated.

Thank you Eric Raymond for an extensive look in to Python. Your articles are always valued.

J.Bell

Oh look, somebody sane.

Ste Griffiths's picture

J.Bell,

I completely agree with you.
as eric raymond states in his indespensable how to guide:

"There is another group of people who loudly call themselves hackers, but aren't. These are people (mainly adolescent males) who get a kick out of breaking into computers and phreaking the phone system. Real hackers call these people ‘crackers’ and want nothing to do with them. Real hackers mostly think crackers are lazy, irresponsible, and not very bright, and object that being able to break security doesn't make you a hacker any more than being able to hotwire cars makes you an automotive engineer. Unfortunately, many journalists and writers have been fooled into using the word ‘hacker’ to describe crackers; this irritates real hackers no end."

I'm laughably young be some people's standards to be getting into REAL hacking, but am very interested and have downloaded python only as the almighty guide referred to it as a good beginners language.

I came across this article through searching for 'Python for idiots'.
unfortuantely i came only across an atricle about python, and some idiots.

This page is for people serious about hacking, not cracking, nor any other illegal wannabe activity. Its nice to see somebody who knows what they think, rather than some who merely think what they know.

Ste Griffiths

Getting Started

JabaPyth's picture

Theres a big difference between putting a computer together and knowing how to use one. Assuming you do want to be a hacker and not a cracker, then Python is a good place to start. As was previously mentioned, it is a good begginer's language, with easy syntax and an intuitive vocabulary. Nevertheless, is is still powerful, and could last you as long as you're interested.
The first place to start? Python.org

Good Luck

Go to www.freepascal.org and

Anonymous's picture

Go to www.freepascal.org and download it.
Or go to http://lazarus.freepascal.org and use ist.
You can use Borlands Free Personal Delphi:
http://www.turboexplorer.com/
Then Search in Google "pascal tutor".

PASCAL is the BEST language of the world. Easy to learn and programming. You can do all with pascal.
Java, Basic, Python, Perl, PHP ... are toys! Slow! PHP is good for dynamic websites.
You can do with Delphi/Lazarus all easier and quickly as C, C++ or other toys. Too many Windows programs are coded by Delphi/Object Pascal.

Word to the wise

Anonymous's picture

Word to the wise:
www.lua.org
:)

Interesting

Sajjad's picture

Was going to ask, but found the answer myself:

http://lua-users.org/wiki/LuaVersusPython

Lua looks promising, but it seems so similar to Python and offers so little more that I doubt a Python programmer would bother with it. I might be wrong though since this is the first time I've heard of Lua.

Why Python

Charles DeRykus's picture

I disagree with Eric. Basically, he's exposing his own subjectivity about his chosen language. He uses the characteristic slap-shot
words that language zealots and converts everywhere fling at
"competition": "eccentric", "fragile" , "jerry-rigged", and, of course, "ugly".

To me, the mark of a really great language advocate or designer is
someone who wouldn't feel the need to bash the competition with
the patronizing remark that Perl is just a niche utiility "For tiny projects (100 lines or fewer)"; who wouldn't need to embroider the discussion with his fame or personal accomplishments; who doesn't backfill argument holes with hyperbole about his Python programs working the "first time".

And a real language designer understands the complexity, history,
and roles of computer languages; sees the trade-offs and embraces
diversity; learns from and adopts good features of other languages;
supports and strives for the interoperation of other languages with his own. Moreover, He'd distance himself from any shallow advocacy.

ESR is a well known, talented programmer but, despite his reputation
and "12 languages", does, what everyone at one time or another has
done: becaome enamored with his own prejudices.

--
Charles DeRykus

Insult or compliment?

Anonymous's picture

>He uses the characteristic slap-shot
words that
>language zealots and converts everywhere fling at
>"competition": "eccentric", "fragile" , "jerry-rigged",
>and, of course, "ugly".

... and of course, Perl programmers take these words as compliments.

To each his own.

Some of them

Jenda's picture

There's nothing wrong with being excentric. And ugly ... I don't find Perl ugly, but I understand it may look that way to some. Camels are not the nicest and smelliest animals, but if I need to cross a desert you know what I'd choose. Rather than a great-looking stallion.

im new to the game

Anonymous's picture

hey i like what you say and the way you say it not that i undersatnd a word of it.
i would like to learn to become a hacker im 23 and very eager to learn any help will do can you send me some programs or post them i'll give you all u need if u reply thanx

Re

Anonymous's picture

haha... so you're saying that you're a "real language designer" whereas Eric is not?

That's funny. Your style of critique is so stupid and blah it makes me want to re-use it on you, but it's not designed for re-use and a "real language designers critic" would know how to make their critique re-usable for maximum effect and virality... bleh.. you're way off buddy. Learn to think before you talk.

RE:two dozen == 24

Marco S.'s picture

Hey, Peter - this was a Joke. You know this "==" in the Subject. Only for Programmers the "==" is EQUAL-TO. Standard-humans would write a "=". Got it 8-)))))

Actually "==" makes it a

Anonymous's picture

Actually "==" makes it a conditional as opposed to an assertion. Goes towards questioning if the original author can evaluate that conditional correctly or not!

The right direction

MichaelEBrown's picture

Excellent article and great unbiased perspective. As Eric, I also have almost a dozen languages under my belt. Python is one of the better. I'll use anything that I need to get the job done, but these days I try to avoid Perl, C++, and C, and I use Java, Python, and C# when I can.

RE:Just to get food

Anonymous's picture

Hello mate,
Are you aware about the fact that __python__ isn't comestible -- even if it's a non-venomous snake? Moreover, there is a threat of extinction against this species. So it'd be nice if you don't pourchase them.

New To The Game

Lawal Adekunle's picture

I've heard a lot about python ,perl etc but i am sort of a newbie when it comes to programming. I really want to get serious about coding but i dont know where to start. I also want to know how long it will take me to get a grasp of it. I would really appreciate it if you could help me out.

What is it wrong with all of you Python lovers

Anonymous's picture

What is it wrong with you all of you pathetic programmer whimps. Always wasting time looking for and learning "new better" programming languages that will save you time - and wasting truckloads of time doing so!!! Then after learning five new programming languages you choose one, do a project with it and start learning the next five - 'because it will save you more time'. LOL!!!! Get a grip. Are you guys are just lazy and/or dumb and/or bad programmers? Just perhaps you should just learnd ONE programming language and learn that one really well, eh? What do you say? I callenge anybody who claims they can be more productive with Python or any of their crappy languages than I can be with just simple and plain C! That's right. C. Anytime! Anywhere! What's more I can still run and even compile (gosh!) my programs from 10 years ago. You probably don't even remember what programming trash you used back then, eh? I thought so. Plus my program will be fifteen times smaller and sixty times faster. But please just go back wasting more of your time learing yet another language you will hardly use and never be good at pretending you are a trendsetter. Chuckle chuckle.

RE:What is it wrong with all of you Python lovers

The Librarian's picture

"Just perhaps you should just learnd ONE programming language and learn that one really well, eh?"

and uh duh, how do you choose that one without looking at more than one Language. Or, just take the first one you see I guess.

"I callenge anybody who claims they can be more productive with Python or any of their crappy languages than I can be with just simple and plain C! That's right. C. Anytime! Anywhere! What's more I can still run and even compile (gosh!) my programs from 10 years ago."

Uh, let's see. For example, I write a gui hello world in C and compile it for say MS Windows, then rewrite and compile it for Mac, then rewrite it and compile for Amiga,... Palm, ...Nokia ... others. Now then, write a gui hello world in python and portability rules.

"Python runs on Windows, Linux/Unix, Mac OS X, OS/2, Amiga, Palm Handhelds, and Nokia mobile phones. Python has also been ported to the Java and .NET virtual machines." -Python DOS too. ;-)

"Anyway, if your background is primarily C and similar languages, I'd recommend taking it to "broaden your horizons" a bit. If nothing else, learning something different will make you think about the same problems in different ways.

OTOH, if you're not really into programming in general then I'd drop it." -
gamedev

"Learning only one language supports tunnel vision" - me
python -c "print 'Hello World'"

What is it wrong with all of you Python lovers

Anonymous's picture

" You probably don't even remember what programming trash you used back then, eh?"

Sure I do. I used C. ;-)
I still do from time to time, but when I discover a programming language that makes me more productive and more importantly, makes programming more fun, I'm not going to let fear of change stop me from using it.

Oh, and speaking of "waste of time". Well... you can probably guess where I'm going with this...

I wonder, what esoteric

Anonymous's picture

I wonder, what esoteric language was used to wtie all those spam ? Erlang ? :D

Readability is key

Lou Keeble's picture

I had pretty much the same experience as you, Eric.

Perl is not easily readable (even your own code). Python is.

It is fun to write & read code in Python.

Have you looked at Ruby? My impression so far is that it is very similar to Python. I couldn't find a good reason to prefer Ruby over Python. Ruby on Rails seems to be a way of generating code using simple conventions, so could be done in a similar way with other languages.

I would be interested to hear your opinion. Thanks!

Seems to be promising

Datanumeric's picture

We started out with C then Perl, Php and now using Python and trying out Ruby on rails seems to be promising.

It's nice to see discussion of scripting.

Dave O'Hearn's picture

I always like to see discussions of different scripting languages. It's unfortunate that people view this as a "language war" of one scripting language against another. What's really at stake is scripting itself. There are so many things that can be done with scripting, but so few scripting languages are general-purpose. VBScript only works well with COM. Javascript is intended for web browsers. Tcl is made for short bits of "glue code". PHP is for web pages. PERL matured to be general-purpose, but its roots are in text manipulation.

I have not worked with Python yet, but it's nice to see attempts at making general-purpose scripting languages, and it's nice to hear reports from people who have used them. We need more of these languages, and more research in them.

At the risk of sounding

Anonymous's picture

Um, we don't need more languages. We need one that has a general enough application space, so that we prefer to apply it to the next problem rather than deciding that the new problem needs yet another language. How many languages do you want to have to learn? As far as I'm concerned, Python is that one language, or pretty darn close.

Open question: what's a 'scripting' language? why is Python called a 'scripting' language, so people put it in the same head space as bash, tcl, perl, awk? It has mostly replaced C/C++ for me, in addition to having entirely replaced those scripting languages.

From a 'python marketing' standpoint, I'd define a scripting language as one which requires you to put $ or whatever in front of variable names, and makes quoting strings an optional construct, and does string variable substitution inside string constants unless you force it not to with odd escape characters. A non-scripting language is one which has simple, clear-cut lexical conventions and parsing syntax.

There: now python's not a scripting language, it's a real language that has dynamic runtime typing and name binding, and dynamic compilation (unlike most 'scripting' languages). This distinction may seem contrived, but I think this goes a long way to explain why most scripting languages become unmaintainable very quickly for longer scripts, and Python doesn't. The $ are an advantage when you are writing a simple bash script, but a serious burden in code which is more complex, or is not actually working with strings.

I think the official position is that Python is a 'dynamic' language.

Python vs Java

Leendert Schouten's picture

In advance I appologize for my minimal knowledge of the english language. Iam also not a guy who's studying abilities are above average. So now having said this and being busy with studying Java 2 for about 3 months now I read your article about python.

I am an AIX system administrator for a couple of years now, but having no college degree or even an AIX certification of some kind is holding me back from getting a regular ongoing job.

So reading your article and having a hard time remember the massive amount of java 2 details, it convinced me to at least hold my J2 study and give python a try. I will also have a look at Ruby, you never know how it hits me. :)

Thanks

You really cant compare Java

Wifiseeker's picture

You really cant compare Java and scripting languages like Phyton. If you compare that, you shoud take JSP as the scripting language.

WIll it scale?

webdesigner's picture

I am looking for a complementary language to Php5, for more demanding projects. It should be faster, have an standartised class framework and scale fairly well. The speed of development should remain rather high. Python or Java or ???

because Larry Wall has a bigg

Anonymous's picture

because Larry Wall has a bigger mustache.

After using python cross-plat

Anonymous's picture

After using python cross-platform in a real world project I can tell you that perl is much better.

If you have a large class and at some line you accidentally add a blank line or you end up chopping a line, then your program will act busted - when it was just a silly extra line.

Multiple versions(old/new) of python running together on the same linux box causes problems that you shouldn't have to deal with but since python doesn't have a plan for dealing with multiple version of the same library file then I guess you're screwed.

try blender which uses a old version of python, get a python plugin for blender and then put it on a system with a new version of python - ouch the pains.

python - no thanks - been there done that.

I'll take 2 curly braces any day.

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix