Re: What is different with Python ?



On Sun, 12 Jun 2005 20:22:28 -0400, Roy Smith wrote:

> At some point, you need to draw a line in the sand (so to speak) and say,
> "I understand everything down to *here* and can do cool stuff with that
> knowledge. Below that, I'm willing to take on faith". I suspect you would
> agree that's true, even if we don't agree just where the line should be
> drawn. You seem to feel that the level of abstraction exposed by a
> language like C is the right level. I'm not convinced you need to go that
> far down. I'm certainly not convinced you need to start there.

The important question is, what are the consequences of that faith when it
is mistaken?

As a Python developer, I probably won't write better code if I understand
how NAND gates work or the quantum mechanics of electrons in solid
crystals. But I will write better code if I understand how Python
implements string concatenation, implicit conversion from ints to longs,
floating point issues, etc.

It seems that hardly a day goes by without some newbie writing to the
newsgroup complaining that "Python has a bug" because they have discovered
that the floating point representation of 0.1 in decimal is actually more
like 0.10000000000000001. And let's not forget the number of bugs out
there because developers thought that they didn't need to concern
themselves with the implementation details of memory management.

It makes a difference whether your algorithm runs in constant time,
linear, quadratic, logarithmic or exponential time -- or something even
slower. The implementation details of the language can hide quadratic or
exponential algorithms in something that looks like a linear or constant
algorithm. Premature optimization is a sin... but so is unusably slow
code.



--
Steven.


.



Relevant Pages

  • Re: Calculating two free axes
    ... You can permuate the coordinates if vn is zero to get ... On paper you solve systems of linear equations easily. ... generate a set of linearly independent vectors huh? ... algorithm to do this while I have. ...
    (comp.graphics.algorithms)
  • Re: hide python code !
    ... doors or installing burglar alarms, ... Compiling code to machine language isn't like locking your door. ... Compiling code doesn't prevent me from seeing your code or your algorithm, ... Would you argue that Python source code hides your ...
    (comp.lang.python)
  • String similarity
    ... The algorithm that I have chosen for the comparison between string was ... Python reducing the code from 1394 lines of "C" to 152 lines of Python ... Initially I have rearranged part of "C" code in one module "simil" ... Comparing string this is not possible and the only way that I have found ...
    (comp.lang.python)
  • Re: hide python code !
    ... Compiling code to machine language isn't like locking your door. ... Compiling code doesn't prevent me from seeing your code or your algorithm, ... Would you argue that Python source code hides your ... 'imperfect protection' with 'pointless protection'. ...
    (comp.lang.python)
  • Re: Regression analysis -- how-to?
    ... > were it not for the fact that, the last time I asked an algorithm ... Do you want to learn about regression? ... > (linear, quadratic, logarithmic, exponential, power and inverse) and at ... > least two types of linear correlation coefficient (rank and product ...
    (comp.lang.pascal.delphi.misc)