Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'run-time': 0.05; 'subject:Python': 0.06; 'assign': 0.07; 'javascript,': 0.07; 'linux,': 0.07; 'tries': 0.07; 'variables': 0.07; 'string': 0.09; 'english,': 0.09; 'php,': 0.09; 'subtle': 0.09; 'translate': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; 'language.': 0.14; 'windows': 0.15; '"python",': 0.16; "(i'm": 0.16; '.msi,': 0.16; 'encodings': 0.16; 'estou': 0.16; 'guilherme': 0.16; 'happily': 0.16; 'interpreter,': 0.16; 'linguagem': 0.16; 'newer,': 0.16; 'subject:OOP': 0.16; 'tcp/ip,': 0.16; 'there?': 0.16; 'accordingly.': 0.16; 'index': 0.16; 'appropriate': 0.16; 'ignore': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'all,': 0.19; 'bit': 0.19; 'basically': 0.19; "python's": 0.19; 'slightly': 0.19; 'thu,': 0.19; 'typing': 0.19; 'user.': 0.19; 'machine': 0.22; 'platforms': 0.22; 'programming': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'closely': 0.24; 'finally,': 0.24; 'instance,': 0.24; 'sends': 0.24; 'tells': 0.24; 'text,': 0.24; 'unicode': 0.24; 'software.': 0.24; 'environment': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; 'script': 0.25; '>': 0.26; 'define': 0.26; 'least': 0.26; '(for': 0.26; 'asking': 0.27; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'character': 0.29; 'related': 0.29; "doesn't": 0.30; 'errors': 0.30; 'message- id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'work.': 0.31; '(which': 0.31; 'gives': 0.31; 'code': 0.31; 'comments,': 0.31; 'contrast,': 0.31; 'obscure': 0.31; 'portuguese': 0.31; "they'll": 0.31; 'usar': 0.31; 'file': 0.32; 'probably': 0.32; 'languages': 0.32; 'run': 0.32; 'another': 0.32; 'linux': 0.33; 'url:python': 0.33; 'running': 0.33; 'mac': 0.33; 'except': 0.35; 'something': 0.35; 'test': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'there': 0.35; 'version': 0.36; 'sequence': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'half': 0.37; 'reports': 0.37; 'virtual': 0.37; 'application': 0.37; 'clear': 0.37; 'being': 0.38; 'minimum': 0.38; 'system,': 0.38; 'skip:& 10': 0.38; 'security,': 0.38; 'pm,': 0.38; 'does': 0.39; 'url:mail': 0.40; 'how': 0.40; 'consists': 0.60; 'most': 0.60; 'tell': 0.60; 'full': 0.61; 'took': 0.61; 'matter': 0.61; 'simply': 0.61; 'simple': 0.61; "you're": 0.61; 'back': 0.62; 'url:group': 0.63; 'more': 0.64; 'fire': 0.65; 'to:addr:gmail.com': 0.65; 'close': 0.67; '26,': 0.68; '\xc2\xa0\xc2\xa0': 0.74; 'guaranteed': 0.75; 'power': 0.76; 'pike': 0.84; 'referente': 0.84; 'rexx,': 0.84; 'samuel': 0.84; 'skip:] 10': 0.84; 'strengths': 0.84; 'uma': 0.84; 'crucial': 0.91; '8bit%:18': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5hCcn5Ihcl+ZRRiYm+ikUw56d0xeDXqhyyRmBXgKGss=; b=DCGEmsjYlNzzJKAVx00kqBRh5sp+CFMB0FuwG88epR8fF+ly5HpcOwldNsebNQB5pu evGEnZluc0G80/UqiFmbDVWYrMtdsnykkyTi+CWyi7hRLYJK21KOXxKv8fhMu1lWZydw 8gM3tEQ8YsS08dk2XNr2nOB/nh6UM+/wBVJtvAdnTqpsIUiDEmhot7Os2QxGZeEzcgkt SsfxWOlC+Cic4UbbhDqeGK1ACUgCWS3cmv4Kbo5CAruRAsezu1M1mWp0/DuR52dP1KXH MwLw4pt56S6W7Ersi092+x3FgvPBl6yLPJwEV7KnM52Hrqc9XzXfZ4slRziIwDLypaXR uxuA== MIME-Version: 1.0 X-Received: by 10.112.16.230 with SMTP id j6mr2836145lbd.90.1403805225349; Thu, 26 Jun 2014 10:53:45 -0700 (PDT) In-Reply-To: References: <021201cf9149$35dd7620$a1986260$@eos-hoepers.com> Date: Thu, 26 Jun 2014 14:53:45 -0300 Subject: Re: OOP no Python From: Guilherme Rezende To: Chris Angelico Content-Type: multipart/alternative; boundary=001a11c3c6d2ca790204fcc0dfdd X-Mailman-Approved-At: Thu, 26 Jun 2014 20:54:24 +0200 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 188 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1403808864 news.xs4all.nl 2910 [2001:888:2000:d::a6]:50546 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73630 --001a11c3c6d2ca790204fcc0dfdd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Samuel, http://groups.google.com/group/python-brasil On Thu, Jun 26, 2014 at 12:18 PM, Chris Angelico wrote: > 2014-06-27 0:16 GMT+10:00 Samuel David : > > Mas estou com uma d=C3=BAvida referente ao t=C3=B3pico =E2=80=9CPor que= eu deveria usar > Python > > e n=C3=A3o ?=E2=80=9D. > > Google Translate tells me you're asking "Why use Python instead of > ?". (I'm going to respond only in English, as my > Portuguese is basically nil. Sorry.) Well, there are a lot of reasons > :) > > One is that Python is a clear and simple language; a form of > "executable pseudo-code". If you start by writing what you want to do > as comments, then translate slightly into a more formal grammar to > make pseudo-code, you're pretty close to having stubby Python code. > There's a minimum of fuss, the language does its best to get out of > the way and let you do your work. > > Closely related to that is Python's excellent interactive mode. Since > you don't have to declare variables or anything, you can simply fire > up Python interactively (eg by just typing "python", or with something > like IDLE), and it is simultaneously a clean environment in which you > just say "a =3D 2+3" and assign 5 to a, and a full programming > environment that gives you all the power you need (for instance, you > can define functions, then call them - that's something I was never > able to do in REXX, at least not without some fiddling). In contrast, > a language like Pike is that bit more wordy at its interactive prompt, > as you need to make appropriate declarations. And any language that > doesn't have first-class functions is going to be much less clean for > this sort of work - REXX doesn't have any concept of run-time function > creation at all, except that it can (ab)use the file system for that > job. > > Another advantage of Python is Unicode support. Particularly if you're > using Python 3.3 or newer, you're guaranteed that a string consists of > a sequence of Unicode codepoints, and you can depend on being able to > index and slice it accordingly. This is way WAY better than C, or PHP, > or any other language that sticks its head in the sand and tries to > ignore character encodings altogether; and it's better than UTF-16 > languages like JavaScript, because you avoid the subtle errors that > can creep in when you index a string with astral characters. You can > happily write your program and test it on Portuguese text, and be > confident that it'll work just as well with Hebrew. > > Finally, Python is a well-established language. You can write an > application in Python and simply tell people "You'll need a Python > interpreter, version 3.3 or better, to run this", and be confident > that they'll be able to get one - most Linux distros include Python in > their repositories, a Mac probably has it installed, on Windows it's > just a matter of fetching the .msi, and there are unofficial builds > for obscure platforms like OS/2. (Which I make good use of, > incidentally. We have a legacy OS/2 system, now running as a virtual > machine under Linux, on which we run certain legacy software. How do > we back up the crucial data from there? Simple: A Python script that > archives the necessaries, sends them via TCP/IP, and reports its > status to the user. I think it took me all of half a screenful of code > to write that.) > > There are other languages that I use and love, too; each one has its > strengths and weaknesses. These are just a few of Python's strengths. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > --=20 *Guilherme Bessa Rezende* Software Engineer|DevOP [ IT, Security, Telecom, ] guilhermebr.com --001a11c3c6d2ca790204fcc0dfdd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Thu,= Jun 26, 2014 at 12:18 PM, Chris Angelico <rosuav@gmail.com> = wrote:
2014-06-27 0:16 GMT+10:00 Samuel David <<= a href=3D"mailto:samuel.costa@eos-hoepers.com">samuel.costa@eos-hoepers.com= >:
> Mas estou com uma d=C3=BAvida referente ao t=C3=B3pico= =E2=80=9CPor que eu deveria usar Python
> e n=C3=A3o <insira aqui a sua linguagem favorita>?=E2=80=9D.

Google Translate tells me you're asking "Why use Python inst= ead of
<some other language>?". (I'm going to respond only in Engli= sh, as my
Portuguese is basically nil. Sorry.) Well, there are a lot of reasons
:)

One is that Python is a clear and simple language; a form of
"executable pseudo-code". If you start by writing what you want t= o do
as comments, then translate slightly into a more formal grammar to
make pseudo-code, you're pretty close to having stubby Python code.
There's a minimum of fuss, the language does its best to get out of
the way and let you do your work.

Closely related to that is Python's excellent interactive mode. Since you don't have to declare variables or anything, you can simply fire up Python interactively (eg by just typing "python", or with some= thing
like IDLE), and it is simultaneously a clean environment in which you
just say "a =3D 2+3" and assign 5 to a, and a full programming environment that gives you all the power you need (for instance, you
can define functions, then call them - that's something I was never
able to do in REXX, at least not without some fiddling). In contrast,
a language like Pike is that bit more wordy at its interactive prompt,
as you need to make appropriate declarations. And any language that
doesn't have first-class functions is going to be much less clean for this sort of work - REXX doesn't have any concept of run-time function<= br> creation at all, except that it can (ab)use the file system for that
job.

Another advantage of Python is Unicode support. Particularly if you're<= br> using Python 3.3 or newer, you're guaranteed that a string consists of<= br> a sequence of Unicode codepoints, and you can depend on being able to
index and slice it accordingly. This is way WAY better than C, or PHP,
or any other language that sticks its head in the sand and tries to
ignore character encodings altogether; and it's better than UTF-16
languages like JavaScript, because you avoid the subtle errors that
can creep in when you index a string with astral characters. You can
happily write your program and test it on Portuguese text, and be
confident that it'll work just as well with Hebrew.

Finally, Python is a well-established language. You can write an
application in Python and simply tell people "You'll need a Python=
interpreter, version 3.3 or better, to run this", and be confident
that they'll be able to get one - most Linux distros include Python in<= br> their repositories, a Mac probably has it installed, on Windows it's just a matter of fetching the .msi, and there are unofficial builds
for obscure platforms like OS/2. (Which I make good use of,
incidentally. We have a legacy OS/2 system, now running as a virtual
machine under Linux, on which we run certain legacy software. How do
we back up the crucial data from there? Simple: A Python script that
archives the necessaries, sends them via TCP/IP, and reports its
status to the user. I think it took me all of half a screenful of code
to write that.)

There are other languages that I use and love, too; each one has its
strengths and weaknesses. These are just a few of Python's strengths.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list



--
Guilherme Bessa Rezende
Softw= are Engineer|DevOP
[ IT, Security, Telecom, ]
=C2=A0=C2=A0 =C2=A0

--001a11c3c6d2ca790204fcc0dfdd--