• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Learning Python together

Changes from 2.6 to 3.0

I've been using 3 for sometime and I haven't really run into any major issues. The one thing I find very annoying, especially with Eclipse, is that if I the 3 as the interpreter, Eclipse gives a warning for the following statement:

C++:
print 'foo'
However, I don't see any warnings if I use following print statement:

C++:
print ('foo')
I'm not sure if this a result of a difference between 2.6 and 3.x or just something within Eclipse.

This is because in Python 3.x, the print statement has been turned into a print function. This alone is enough to break a lot of legacy code!

Bear in mind that Python 3.x will become a lot faster with the inclusion of Unladen Swallow, Google's Python speed-up project. However, NumPy/SciPy are not compatible with 3.x yet, I believe. Although I may be wrong. Does anybody know?

QS.
 
I just looked into it, python comes installed on osx and works with cocoa apps and mac c libraries. Go to terminal and type 'python' :) 10.5 has 2.5.1 so I'm going to update to 2.6.

Yeah i knew that. I was talking about numpy/scipy. I've installed on python 2.6, works like a charm.
 
What happened to Perl?!

They started the language re-design, circa 2000, and still haven't delivered, so the language became mostly irrelevant in the meantime (well, Perl advocates will fiercely claim that the new version, Perl 6, is actually usable while ago, and that old version, Perl 5.x, was actually updated regularly along the way, but I think at least the fact that the language is irrelevant these days is undeniable). The opinions about re-designed language were mixed: basically, Perl was already write-only language more or less, and this is even more true with the new version. There were some promising artifacts along the way, like Parrot, virtual machine able to support many scripting/dynamic languages (so that it would be possible to compile say both Perl and Python, and then other alike languages, to the same virtual machine, and thus share the libraries, and work on runtime optimization), but this generated not that much interest from other dynamic language implementers, as more interesting and more actively maintained virtual machine implementations appeared in the meantime (like the work of LLVM guys).

Back on topic: the Downey book, used at this MIT course mentioned, is a very good introduction into Python too. But the problem with Python (both the language, and its standard library) is that, while indeed rather clear and simple language in the beginnings, it become more and more overloaded with features, so it gets almost equally hard to learn Python as to learn C++, and as it's much harder to write efficient code in Python than in C++ (even with NumPy and other goodies), I just see not much point in using it for anything except top-level, glue code...
 
They started the language re-design, circa 2000, and still haven't delivered, so the language became mostly irrelevant in the meantime (well, Perl advocates will fiercely claim that the new version, Perl 6, is actually usable while ago, and that old version, Perl 5.x, was actually updated regularly along the way, but I think at least the fact that the language is irrelevant these days is undeniable). The opinions about re-designed language were mixed: basically, Perl was already write-only language more or less, and this is even more true with the new version.

I agree that Python or Ruby are gaining ground and they have added exceptional features.
However I wouldn't consider Perl irrelevant. It is used more than any other flavor including Python. A lot of system related programming is still done in Perl. Job-offers on tech sites (e.g. Dice) still require Perl more than the other flavors.
http://news.cnet.com/8301-13505_3-10009669-16.html
http://www.eecs.berkeley.edu/~flab/languages.html
http://www.devtopics.com/most-popular-programming-languages/
 
I agree that Python or Ruby are gaining ground and they have added exceptional features.
However I wouldn't consider Perl irrelevant. It is used more than any other flavor including Python. A lot of system related programming is still done in Perl. Job-offers on tech sites (e.g. Dice) still require Perl more than the other flavors.
http://news.cnet.com/8301-13505_3-10009669-16.html
http://www.eecs.berkeley.edu/~flab/languages.html
http://www.devtopics.com/most-popular-programming-languages/

Statistics like what you mentioned above are always skewed; besides, these in particular seem rather outdated... When I stated that Perl is irrelevant, I was primarily considering how much newbie programmers are learning the language. Throughout past couple years there were number of computer science departments switching to Python as their first programming language (even MIT switched their famous 6.001 to Python), and the rest of kids get introduced to the language too, in one way or another. On the other side, one would probably going to have hard time to find someone of this age with Perl knowledge; so it's not hard to see where the situation like this is heading in the next 5 to 10 years...
 
Statistics like what you mentioned above are always skewed; besides, these in particular seem rather outdated... When I stated that Perl is irrelevant, I was primarily considering how much newbie programmers are learning the language. Throughout past couple years there were number of computer science departments switching to Python as their first programming language (even MIT switched their famous 6.001 to Python), and the rest of kids get introduced to the language too, in one way or another. On the other side, one would probably going to have hard time to find someone of this age with Perl knowledge; so it's not hard to see where the situation like this is heading in the next 5 to 10 years...

I don't want to divert the discussion. I think this thread is useful to promote Python.
On the flipside of your argument programming languages usually have a lot of hype. Few languages have survived the test of time. In this category, I would consider only C++, Java and Fortran.

As for the first language used at MIT, I could say it's "irrelevant" :). There was always a "tendenncy" to start with a functional language (e.g. Scheme, Caml). Python has a good basis here so it would be a much likely candidate than C++ or Java.
This doesn't mean that more code will be written in Python than the others ...
 
Back
Top