Things to keep in mind: |
|
So over the summer I am going to have to teach myself the basics of Python for the lab that I'll be working in. We're going to be doing experiments involving subliminally presented stimuli (20-40 milliseconds), evaluations of pictures and movie/audio clips, and possibly recording reaction time data, as well as asking subjects basic questions - all GUI, obviously. I have programming experience with Java and C++ (I guess that's how I got stuck with this gig) but I don't know much at all about Python. |
|
Things to keep in mind: |
|
Python doesn't use a JIT...??? (As far as I know apart from the PyPy project) |
|
Python is very powerful, from what I've read. But, you have to be a super-indent/space nazi because of the lack of braces. |
|
The indentation is a non-issue. You indent the same way you would for other imperative languages. Python just ensures that other programmers you're working with don't mis-indent a line by accident. I second the official tutorial. Python's a great language for a lot of tasks (anywhere from simple scripts to larger CLI apps to GUI apps to CGI scripts to web applications to games, etc.), and it has a really compact language definition, making it easy to keep in your head (contrast with C++ and Perl). It also has one of the easiest-to-read syntaxes of any imperative language, and Python code tends to be really concise, saving tons of development time. |
|
^ The indentation is a nuisance however. Learning that before {} programming doesn't seem the way to go with me. I have only seen one language use that indenting style, and that's Python. i'm sure there are more, less known languages with that style, but for mainstream programming, {} seems better to me. |
|
Haskell syntax also recognizes indentation, although it's syntactic sugar for braces iirc. Python and Haskell are two of the most efficient programming languages, in terms of productivity as opposed to performance (although Haskell code compiled with `ghc -O2' isn't much slower than the equivalent imperative code written in C), and they both ascribe syntactical meaning to whitespace. |
|
That's why I like C++, the productivity of a powerful OOP language and the raw speed of C and inline assembly |
|
Well, you can write a C extension module and use assembly in that... I doubt it has inline assembly, that would just tempt people to write illegible assembly in the middle of their code - negating the clarity of code that is one of python's goals |
|
Bookmarks