Python so slow!!
and the spacing thing... what a nightmare for copy/paste
Homogenization of scientific computing – Python is eating other languages’ lunch
141–150 of 184 posts
Re: Homogenization of scientific computing – Python is eating other languages’ lunch
#142Re: Homogenization of scientific computing – Python is eating other languages’ lunch
#143I do scientific computing, and Python is one language I never actually got around to learning for some reason. However, as a long-time hobby, I do have an interest in programming languages so I like exploring things like Haskell, Clojure, Lisp, etc. One language I'm really excited about for scientific computing though is Julia. From a language-design perspective, it's beautiful. It was actually thought out rather tha…
R is really nice for some things, because of how easy it is to work with table-like data, and operations like applying a function over a vector or a matrix, etc are cake. However, it's also slow, leaky (and sometime seems to use more memory after gc()), and often difficult to debug because so many things fail silently. If it wasn't for so many standard bioinformatics packages being available only for R, I'd probably be using Python. Once we stop running microarrays, I'll probably be using R much less.
Re: Homogenization of scientific computing – Python is eating other languages’ lunch
#144I have a Python background and recently signed for the Coursera course on R that just started ( https://www.coursera.org/course/compdata ) because I wanted to get a small taste of R and see how it differed from Python's scientific computing stack. So right now I'm not far enough in the learning curve to see all the benefits R provides. Is it worth investing time in R now if I'm already pretty familiar with a good amo…
Re: Homogenization of scientific computing – Python is eating other languages’ lunch
#145Earlier quoted context omitted.
to those downvoting the parent to this comment ... honestly, do you disagree? If so I must be missing some trick, and if so I would love to hear what it is.
What editor(s) do you use?
emacs
textmate
problem is typically copying and pasting from an editor into a terminal window running python... usually for code blocks that have not just one but at least two (or more) levels of indentation
iPython and pasting with %cpaste usually helps but what if I want plain Python not iPython?
anyway it's a problem I don't have with any other language and so that's why I'm complaining about it
Re: Homogenization of scientific computing – Python is eating other languages’ lunch
#146Earlier quoted context omitted.
Deliberately-straightforward -- agreed. But "highly proficient" after writing one or two scripts? That's quite a stretch. For instance, one of the questions I give in phone screens is for the candidate to write a program to count the number of occurrences of unique words in a text file. The "after writing one or two Python scripts" approach is something like this: counts = {} f = open('test.txt') lines = f.read().spl…
for word, count in Counter(open('test.txt').read().lower().split()).most_common(): print word, count
words=open('test.txt').read().lower().split()
for word, count in Counter(words).most_common():
print word, count
(edited per child comment)Re: Homogenization of scientific computing – Python is eating other languages’ lunch
#147Earlier quoted context omitted.
> My experience is that the whitespace is totally arbitrary: totally inconsistently placed 0 - n spaces with random indentation levels. This is usually due to: 1) Lack of a consistent style guide. 2) Lack of style guide enforcement. 3) A language where white space doesn't matter. If you think about this critically though, these random indentation changes would either break all of the code (e.g. it wouldn't run, or wo…
I guess I'm in a third camp: 3) Python's semantic whitespace is so wonderful I'm baffled that most other programming languages don't have it. It's like they're coding with one eye shut: why not do this wonderful thing that makes everything easier?
Re: Homogenization of scientific computing – Python is eating other languages’ lunch
#148Earlier quoted context omitted.
What are your thoughts on Clojure's suitability as a go-to language for scientific computing (except in lower-level, high-performance scenarios that might recommend Julia)? I think it has serious potential in this field. It's not there yet, but it's getting there, and the core.matrix standardization helps a lot.
I agree with collyw; Lisp is too much for most scientists, who just care about getting their research done and can't be bother to learn all this weird FP/paren stuff [1]. Supplying an obvious, familiar syntax that looks like math written on paper for, e.g., matrix operations, is critical. This is actually one of the core tensions in Julia development imho: balancing having a sane, well designed language (from a progr…
Is it that hard of a gap to cross? I was a math major who took a couple CS courses, and wouldn't say I was "trained as a programmer". I found Scheme pretty easy to get from the go.
I tend to think that anyone who can get a PhD in the physical sciences can become a half-decent programmer-- if the desire is there, the intelligence and work ethic being established (one hopes, at least) by the degree.
Re: Homogenization of scientific computing – Python is eating other languages’ lunch
#149Earlier quoted context omitted.
Deliberately-straightforward -- agreed. But "highly proficient" after writing one or two scripts? That's quite a stretch. For instance, one of the questions I give in phone screens is for the candidate to write a program to count the number of occurrences of unique words in a text file. The "after writing one or two Python scripts" approach is something like this: counts = {} f = open('test.txt') lines = f.read().spl…
Actually that's not 'highly proficient'. This is: def read_words(words_file): return [word for line in open(words_file, 'r') for word in line.split()] len(set(read_words('test.txt')))
Re: Homogenization of scientific computing – Python is eating other languages’ lunch
#150I know that I use python because of how easy it is to code. I can focus wholly, totally on the logic of my code without ever worrying about if I misplaced a semi-colon or left out some weird punctuation. Python frees me to code and not worry about things that get in the way of coding. That's why it's eating other language's lunches, the freedom is almost intoxicating.
It's ironic that you say that, given that if you don't get the whitespace correct, you'll have a syntax error. That's one of the big reason Python rubs me the wrong way: white space is semantic.