<div dir="ltr">Samuel, <div><br></div><div><a href="http://groups.google.com/group/python-brasil" target="_blank" style="font-family:arial,sans-serif;font-size:13px">http://groups.google.com/group/python-brasil</a><br></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 26, 2014 at 12:18 PM, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2014-06-27 0:16 GMT+10:00 Samuel David <<a href="mailto:samuel.costa@eos-hoepers.com">samuel.costa@eos-hoepers.com</a>>:<br>

<div class="">> Mas estou com uma dúvida referente ao tópico “Por que eu deveria usar Python<br>
> e não <insira aqui a sua linguagem favorita>?”.<br>
<br>
</div>Google Translate tells me you're asking "Why use Python instead of<br>
<some other language>?". (I'm going to respond only in English, as my<br>
Portuguese is basically nil. Sorry.) Well, there are a lot of reasons<br>
:)<br>
<br>
One is that Python is a clear and simple language; a form of<br>
"executable pseudo-code". If you start by writing what you want to do<br>
as comments, then translate slightly into a more formal grammar to<br>
make pseudo-code, you're pretty close to having stubby Python code.<br>
There's a minimum of fuss, the language does its best to get out of<br>
the way and let you do your work.<br>
<br>
Closely related to that is Python's excellent interactive mode. Since<br>
you don't have to declare variables or anything, you can simply fire<br>
up Python interactively (eg by just typing "python", or with something<br>
like IDLE), and it is simultaneously a clean environment in which you<br>
just say "a = 2+3" and assign 5 to a, and a full programming<br>
environment that gives you all the power you need (for instance, you<br>
can define functions, then call them - that's something I was never<br>
able to do in REXX, at least not without some fiddling). In contrast,<br>
a language like Pike is that bit more wordy at its interactive prompt,<br>
as you need to make appropriate declarations. And any language that<br>
doesn't have first-class functions is going to be much less clean for<br>
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<br>
job.<br>
<br>
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<br>
index and slice it accordingly. This is way WAY better than C, or PHP,<br>
or any other language that sticks its head in the sand and tries to<br>
ignore character encodings altogether; and it's better than UTF-16<br>
languages like JavaScript, because you avoid the subtle errors that<br>
can creep in when you index a string with astral characters. You can<br>
happily write your program and test it on Portuguese text, and be<br>
confident that it'll work just as well with Hebrew.<br>
<br>
Finally, Python is a well-established language. You can write an<br>
application in Python and simply tell people "You'll need a Python<br>
interpreter, version 3.3 or better, to run this", and be confident<br>
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<br>
just a matter of fetching the .msi, and there are unofficial builds<br>
for obscure platforms like OS/2. (Which I make good use of,<br>
incidentally. We have a legacy OS/2 system, now running as a virtual<br>
machine under Linux, on which we run certain legacy software. How do<br>
we back up the crucial data from there? Simple: A Python script that<br>
archives the necessaries, sends them via TCP/IP, and reports its<br>
status to the user. I think it took me all of half a screenful of code<br>
to write that.)<br>
<br>
There are other languages that I use and love, too; each one has its<br>
strengths and weaknesses. These are just a few of Python's strengths.<br>
<br>
ChrisA<br>
<span class="HOEnZb"><font color="#888888">--<br>
<a href="https://mail.python.org/mailman/listinfo/python-list" target="_blank">https://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><div><b>Guilherme Bessa Rezende</b></div><div>Software Engineer|DevOP</div><div>[ IT, Security, Telecom, ]</div><div><a href="http://www.guilhermebr.com" target="_blank">guilhermebr.com</a></div>
</div><div>    </div><div><br></div></div>
</div>