SV: Python Productivity over C++
Michal Vitecek
M.Vitecek at sh.cvut.cz
Wed Jun 14 04:24:57 EDT 2000
Hung Jung Lu <hungjunglu at hotmail.com> wrote:
>--- In python-list at egroups.com, Neurocrat <neurocrat at o...> wrote:
>>for (int i = 0; i < 10; ++i);
>> cout << "Hello" << endl;
>>
>>This, of course, prints "Hello" only once, not 10 times as we
>
>When I started to use Python a few years ago, the thing that told me that
>Guido had some brain was exactly little tiny features like that.
>
>Try to talk to some hardcore Perl or C++ programmers, and most likely they
>will balk back at you. "What? Python does not even support increment
>operator like i++? What kind of a retarded language is that?"
>
>I have had hard time convincing to fellow C++ programmers that an assignment
>inside an "if" statement is a bad thing, to no avail. E.g:
>
> if ( a = getNumber() ) {...}
>
>Sure, totally valid statement in C++, but why would anyone introduce such a
>stupid feature so you and your compiler get confused all the time with
>
> if ( a == getNumber() ) {...}
i have no idea why you call this a stupid feature - IMO this all makes
the program shorter and as such more readable. this is really something i
hate about python, missing ++ and -- operators plus having to do the
assignment stupidly before if comment - more & longer source.
>C++ programmer get bitten all the time with the == && || operators, and
>refuse to acknowledge that there is a problem.
:) maybe C++ programmers like you? i personally never had any problem
with ==, && and ||, what's more - in the source those 'glyphs' help to
increase the readability - there's less of real text. can you describe
your problems with those operators? oh, and don't forget C/C++ has been
here for years - it's like with VI - you hate it until you
get to know it in deep.
and one more thing - most programming languages are similar to C/C++ in
syntax - and most programmers are/were coming from C/C++ world. making
differences like and, or instead of && ||, or no assignments in if
statements means much less people actually like python and refuse to use
it. it has some really great features, other are really stupid and
uncalled-for.
>
>Guido was smart enough to get rid of the confusing operators. You can't do
>
> if a = b:
>
>and you have to use explicitly the "or" "and" keywords instead of the
>cryptic "&&" "||". And the superflous operators "+=" "++" are eliminated.
>(Why? If you are trying to save nanosecond execution time, or 3 bytes in the
>code by using Python, you are in the wrong business.)
>
>And Perl people would issue you a stern warning about the indentation in
>Python, they'd say: "be very careful with the unusual indentation of Python,
>you miss one space and all hell breaks loose." Yeah right. I've been
>programming in Python for 3 years, now. It might have happened 2 or 3 times.
>Compare with Perl where every single program I wrote was a nightmare to
>debug, even if they are just a few lines. And guess what? No matter whether
>it is Perl or C++, I always do proper indentation and match up all the
>statements and parentheses neatly by hand, so do all the dozens programmers
>that I have worked with. So the parenthesis and the semicolons sit there for
>... I guess, to be pretty? :) For avoiding a bug that might happen once a
>year, Perl and C++ prefer that you introduce bugs that happen daily or even
>hourly. Great logics.
>
>After I saw what Guido did with the == && || ++ operators, I knew some brain
>was put into Python. And since then, I have never looked back.
>
>Hung Jung
>
>
>________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
>
>--
>http://www.python.org/mailman/listinfo/python-list
--
fuf
------------------------------ na IRC -------------------------------------
BillGates [bgates at www.microsoft.com] has joined #LINUX
...
mode/#linux [+b BillGates!*@*] by DoDad
BillGates was kicked off #linux by DoDad (banned: We see enough of Bill
Gates already.)
More information about the Python-list
mailing list