P
Paul Rubin
Rhodri James said:Or, dare one say it, conventions?
If the language-tool combo uses the info in a formal way, they are
extensions, not conventions.
Rhodri James said:Or, dare one say it, conventions?
Steve Holden said:Sometimes I just want to shout "be quiet, Python is just fine the way it
is", but alas your objections are usually too sensible to be dismissed
in that way. In the long term I feel it has to be good for Python that
it has such conscientious critics.
I'd say functional programming emphasizes a style that avoids use
of side effects, but saying "functions cannot have side effects" is
a bit of an overstatement. Even Haskell lets you code effectfully
when necessary, using the type system (IO Monad) to separate
effectful code from pure code.
One feature of Ada that I always thought was a good idea is the
distinction between functions and procedures, where functions are
guaranteed to not have side effects. But I don't think Ada allows
advanced functional programming such as passing functions as arguments
to other functions.
Russ P. said:I think we need to distinguish here between purely functional
languages and a languages that support functional programming. I would
be even more averse to a purely functional language than I am to a
purely OO language such as Java.
One feature of Ada that I always thought was a good idea is the
distinction between functions and procedures, where functions are
guaranteed to not have side effects. But I don't think Ada allows
advanced functional programming such as passing functions as arguments
to other functions.
If Scala only had default arguments and argument passing by keyword
(and maybe "continue" and "break"), I think it would be *very* hard to
beat for a very wide range of applications.
I have a situation which I face almost every day, where I have some
gigabytes of data that I want to slice and dice somehow and get some
numbers out of. I spend 15 minutes writing a one-off Python program
and then several hours waiting for it to run.
Often, the Python program crashes halfway through, even though I
tested it on a few megabytes of data before starting the full
multi-gigabyte run, because it hit some unexpected condition in the
data that could have been prevented with more compile time checking
that made sure the structures understood by the one-off script matched
the ones in the program that generated the input data.
I would be ecstatic with a version of Python where I might have to
spend 20 minutes instead of 15 minutes writing the program, but then
it runs in half an hour instead of several hours and doesn't crash. I
think the Python community should be aiming towards this.
(..)
Russ please do your research before you post.
The whole idea of the Functional Paradigm is _in fact_ computing
expressions and functions. Functional Programming is an implementation
of formal systems (calculus). Therefore it would be very useless
for any functional language to not do what you describe aboave.
Passing the result of a function as input to another function
_is not_ Advanced Functional Programming, but a requirement
of the functional paradigm.
We are in an era for programming languages sort of like the Windows 95
era was for operating systems, where everything is broken but some of
the fixes are beginning to come into view. So there is no language
that currently really works the right way, but some of them including
Python are (one hopes) moving in good directions.
I started looking at Scala a while back. It is has many nice features.
It seamlessly combines object orientation with advanced functional
programming.
If the language-tool combo uses the info in a formal way, they are
extensions, not conventions.
I really wonder why peoples that seems to dislike one of the central
features of Python - it's dynamism - still use it (assuming of course
they are free to choose another language). And FWIW, I at least had a
partial answer on this.
It could just be an issue of practicality. Python is an industrial
strength language with libraries for everything and you can use it for
your daily work. There are nice little languages out there that are
however not usable for real work because of lack of libraries/lack of
support/small community etc.
So _exactly_ how does this thread relate to the subject: Does Python
really follow its philosophy of "Readability counts"?
I don't understand why some folks spew such violent rhetoric against
the idea of augmenting Python with features to alert you automatically
when you depart from the convention, so that you can check that the
departure is actually what you wanted. A lot of the time, I find, the
departures are accidental and automated checks would save me
considerable debugging.
So I can claim that Python is not strictly object oriented until it
gets encapsulation (in the sense of data hiding). That is simply a
fact, and no amount of pleading or obfuscation will change it.
Should Python get true encapsulation? I don't know. Maybe
encapsulation cannot be added without excessive overhead or without
compromising other more important aspects and features of the
language. But I do know that not having encapsulation is a limitation
to the use of Python for good software engineering. I may be in the
minority in the Python "community" on this one, but I am apparently in
the majority in the OO programming "community."
I would be fine having something like pylint built-in in the language
and running at every change of the source code (unless disabled with a
command line switch). I think this is the only reasonable solution to
get some additional protection we can hope for.
There are lots of Python developers (and most of the core developers)
that think the OO community is wrong about enforced encapsulation.
Personally, I think in a few years everybody will realize the mistake
of enforced encapsulation and that the OO definition in the Wikipedia
page will be changed. Even if not, Wikipedia definitions does not
matter much, everybody has his own idea of what OO means,
and the Python definition is good as any other. Don't get pissed off
on words.
If one is a clumsy programmer, then perhaps
one ought to be using a language that holds one's hand.
Michele Simionato said:To be fair, this has been true for the last 50 years. If a language
that works the right way really existed, CS would be dead and there
would be no progress to make. Happily I think we will never end in
that situation![]()
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.